Bank Redirect Payments Guide
The OpenTransact API is able to connect to payment processing providers that enable the receipt of electronic bank transfers by redirecting a user to their banks website or an aggregating service that processes payments from multiple participating banks. This guide will walk you through integrating with the OpenTransact API for the purposes of connecting to one of the integrated partners that supports processing payments at supported banks.
Processing Workflow
In general, the customer will visit your site or application and select a supported bank transfer method at checkout. When creating the transaction in the OpenTransact API, your application will receive a redirect URL that the user should be sent to in order to complete the authentication of the transaction. After completing the transaction on the bank or third-party aggretator’s site, the user will be redirected back to your site to complete the checkout process, view confirmation, or resolve errors.
Available Options for Bank Redirects
Identifier | Name | Icon | Cancelable? | Expirable? | Refundable | Min Expiration | Max Expiration |
---|---|---|---|---|---|---|---|
mx_bbva_bank | BBVA Mexico | false | false | true | |||
mx_banorte_bank | Banorte Mexico | false | false | true | |||
mx_banamex_bank | Banamex Mexico | false | false | true | |||
mx_banorteempresas_bank | Banorte Empresas | false | false | true |
Sample JSON for Transaction Request
When creating a Transaction in the API, set payment-method.type
to bank_redirect
and payment-method.options.identifier
to the identifier value for the bank the user has selected. Set the payment-method.options.completion_redirect_url
and payment-method.options.error_redirect_url
to values you want the user to be redirected to in either case.
{
"data": {
"type": "transactions",
"attributes": {
"transaction-type": "debit",
"amount": 100,
"precision": 2,
"currency": "MXN",
"memo": "Test Transaction",
"payment-method": {
"type": "bank_redirect",
"options": {
"identifier": "mx_banamex_bank",
"completion_redirect_url": "https://my-app.com/complte",
"error_redirect_url": "https://my-app.com/error"
}
},
"metadata": {
}
},
"relationships": {
"profile": {
"data": {
"type": "profiles",
"id": profile_id
}
}
}
}
}
Sample JSON for Transaction Response
When you create a transaction that should trigger a bank redirect, the details required to complete the bank redirect will be present on the metadata attributre of the transaction. Grab the redirect_url from metadata.charge.Rapyd.response.params.redirect_url
and redirect the user to complete processing.
- metadata object is truncated for clarity.
{
"data": {
"id": "example-uuid",
"type": "transactions",
"attributes": {
"transaction-type": "debit",
"amount": 100,
"currency": "MXN",
"precision": 2,
"memo": "Test Transaction",
"status": "pending",
"metadata": {
"charge": {
"Rapyd": {
"duration": 1144,
"release": "0.1.1-alpha.21197",
"processor-configuration-id": "example-uuid",
"response": {
"params": {
"redirect_url": "https://sandbox.rapyd.net/complete-bank-payment?token=payment_d562969cbe32f8ff175c98ad99a82d4e"
}
}
}
}
},
"created-at": "2021-01-01T02:01:22Z",
"updated-at": "2021-01-01T02:01:27Z"
},
"relationships": {
"profile": {
"data": {
"id": "example-uuid",
"type": "profiles"
}
}
},
"links": {
"self": "https://api.opentransact.com/v1/transactions/sample-uuid"
}
}
}