MyBank
Accept MyBank payments in your online store.
MyBank is an online banking-based payment method that allows customers to make secure and convenient payments directly from their bank accounts across Europe. Use the emerchantpay MyBank API to accept MyBank as a payment method across the supported emerchantpay payment integrations.
| Payment method | Countries/regions |
|---|---|
| Bank transfer | Italy |
Prerequisites
To integrate with MyBank, connect to the emerchantpay payment gateway using the emerchantpay API. You should have a working knowledge of web programming languages, HTTP methods in XML and JSON formats, and UTF8 encoding. Use the emerchantpay Payment Gateway SDK libraries with code samples to integrate with the payment gateway in a range of languages.
For a solution that requires less development overhead, accept MyBank payments through the emerchantpay Web Payment Form (WPF). Contact your Account Manager and tell them you want to accept MyBank through the WPF, and refer to the emerchantpay Payment Gateway API WPF documentation.
1. Create a MyBank payment request
To submit a payment using MyBank, create a payment request to the emerchantpay payment gateway. Specify my_bank as the transaction_type.
Example of passing a MyBank transaction request:
<payment_transaction>
<transaction_type>my_bank</transaction_type>
<transaction_id>119643250547501c79d8295</transaction_id>
<usage>40208 concert tickets</usage>
<remote_ip>245.253.2.12</remote_ip>
<return_success_url>http://www.example.com/success</return_success_url>
<return_failure_url>http://www.example.com/failure</return_failure_url>
<return_pending_url>http://www.example.com/pending</return_pending_url>
<amount>100</amount>
<currency>EUR</currency>
<customer_phone>+1987987987987</customer_phone>
<billing_address>
<first_name>John</first_name>
<last_name>Smith</last_name>
<customer_email>jsmith@example.com</customer_email>
<address1>45 North Str</address1>
<zip_code>W1T 2QS</zip_code>
<city>London</city>
<country>UK</country>
</billing_address>
</payment_transaction>’
2. Receive a response
You will receive a Success or Error response to your payment request.
Example of a Success response:
<payment_response>
<transaction_type>my_bank</transaction_type>
<status>pending_async</status>
<mode>live</mode>
<transaction_id>119643250547501c79d8295</transaction_id>
<unique_id>44177a21403427eb96664a6d7e5d5d48</unique_id>
<technical_message>Transaction successful!</technical_message>
<message>Transaction successful!</message>
<redirect_url>https://staging.gate.emerchantpay.net/redirect/to_acquirer/649e1ff35c61</redirect_url>
<timestamp>2023-07-02T14:39:28Z</timestamp>
<descriptor>Acme Co.</descriptor>
<amount>100</amount>
<currency>EUR</currency>
<sent_to_acquirer>true</sent_to_acquirer>
</payment_response>
redirect_url to redirect your customer to authorise the payment with MyBank. See the emerchantpay MyBank API documentation for the complete list of MyBank response parameters and code samples.
Asynchronous notification
Because the MyBank payment transaction is asynchronous, the result of your customer’s payment is sent as a separate HTTP POST notification from the gateway to the notification_url that you supplied with the transaction request.
“transaction_id”: “f44f2856b5d933c04f42d1e922e30cbf”
“terminal_token”: “871bbbd2f9ce1d58dead9848ef5a24ab59a8ee94”
“unique_id”: “832eb553eba838f79113167cbc1002a1”
“transaction_type”: “my_bank”
“status”: “approved”
“signature”: “b74ed54d95589fce6f9d7a229b225fd4a925e9bc”
“amount”: “1200”
“funds_status”: “NOT_EXPECTED”
“account_holder”: “John Smith”
“bank_account_number”: “NL18ABNA0484869868”
“bank_identifier_code”: “ABNANL2A”
status field provides you with information on the outcome of the transaction. See Transaction States for more information about transaction statuses.
Use the signature field to verify that the notification has been sent by the emerchantpay payment gateway. Each session signature is generated by combining the unique_id of the transaction and your API password, and generating a SHA-1 hash function of the combined string.
signature = SHA-1 hash value of <unique_id><API password>
| unique_id | API password | signature |
|---|---|---|
| 26aa150ee68b1b2d6758a0e6c44fce4c | 50fd87e65eb415f42fb5af4c9cf497662e00b785 | c5219b3d385e74496b2b48a549 |
| 3f760162ef57a829011e5e2379b3fa17 | 50fd87e65eb415f42fb5af4c9cf497662e00b785 | 14519d0db2f7f8f407efccc9b099 |
After you have verified the notification state and validity, render an XML page containing the transaction’s unique id to acknowledge that you have received the notification.
Example of a notification reply you use to confirm a notification:<?xml version=”1.0″ encoding=”UTF-8″?>
<notification_echo>
<unique_id>3f760162ef57a829011e5e2379b3fa17</unique_id>
</notification_echo>
Funds status
The FundsStatus field is mandatory for MyBank transactions. A status of approved means the transaction was processed, but it doesn’t guarantee funds have been received. Wait until the FundsStatus is RECEIVED before shipping goods to ensure the money is secured from the customer’s bank account.
| FundsStatus value | Description | Transaction status |
|---|---|---|
| NOT_EXPECTED | The transaction failed due to an error or was declined by the customer or their bank. | Error or Declined |
| WAITING | The initial funds status for successfully processed transactions. The customer has completed the payment process, but funds are not yet secured. | Approved |
| RECEIVED | Funds have been secured from the customer’s bank account. You can proceed with shipping. | Approved |
| MISSING | Funds will not be received due to insufficient balance, a closed account, or another transfer issue. | Approved |
emerchantpay sends you a notification whenever there’s an update to the FundsStatus field.
3. Test your integration
Before you can accept live payments, you must test your integration in the staging environment.
- Add an item to your cart in your online store.
- Proceed to the checkout page and check out using MyBank.
- Follow the redirect link in the response.
- In the payment simulator, follow the instructions to simulate a transaction.
- Complete the order and verify that you are redirected to the order confirmation page.
- Log in to the Gateway Console.
- In the navigation menu, go to Payment transactions.
- Verify that the transaction appears at the top of the list and is successful.
4. Accept live payments
After you have successfully tested your MyBank integration, you are ready to move to the production environment and accept live payments. Contact your emerchantpay Account Manager to get your login credentials for the production environment.