Creating an echeck checkout page with your own form
Background |
---|
Before starting this tutorial, make sure you understand the following topics from the Quick start section:
|
You can use your own form to create a checkout page for echeck (ACH) payments.
Note
Echeck transactions cannot be voided or refunded.
This tutorial provides information about how to set up a checkout page to support receiving echeck payments.
Prerequisites
Before you can run a transaction using your own form you must save an echeck token in one of the following manners:
- With your own form
- With the Nexio save echeck token iframe
- Directly through the API
Echeck tokens can be used to process through any MID on your account. They are not restricted to a specific merchant account or currency.
Complete the following steps to create your own form on an echeck checkout page:
-
Create a form on your checkout web page to collect any necessary information from the customer.
<html> <body> <form id="myForm"> </form> </body> </html>
-
Add fields to your form to capture any information you need from the customer (such as first and last name, address, and so forth). Other information may be predefined by your site (such as amount, currency, and so forth).
The following information is required by Nexio:
- Amount (
data.amount
)
Either of the following is also required:
- Echeck token (
tokenex.token
) This is a previously saved echeck token - Bank account information:
- Account holder name (
bank.accountHolderName
) - Routing number (
bank.routingNumber
) - Account number (
bank.encryptedBankAccountNumber
)
- Account holder name (
Optionally, you can include the currency (
data.currency
). If you do not specify a value for this parameter, the system defaults toUSD
.See the Run echeck transaction endpoint for a complete list of possible parameters.
- Amount (
-
When the customer accesses the checkout page, chooses to pay with a saved echeck ACH, and submits for payment, send a
POST
request to the Run echeck transaction endpoint.
In the body of the request, include at least the required parameters of the payment amount (asdata.amount
) and the echeck token from step 2 (astokenex.token
).curl -X POST https://api.nexiopaysandbox.com/pay/v3/processECheck \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Basic [Base64_encoded_login]' -d '{ "data": { "amount": 29.99, }, "tokenex": { "token": "6ee140a0-05d1-4958-8325-b38a690dbb9d" } }'
Try it out . . .
- Go to the Run echeck transaction endpoint.
- For
Authorization
, type your username and password. - Using the token you got from saving the echeck token (from Prerequisites above), replace the text in the
tokenex.token
parameter. - Provide a value for the
data.amount
parameter. For example,29.99
. - Replace any other content in the body that you want. For example, with the customer address information.
- Click the Try It! button.
The response shows the JSON returned.
-
Listen for Nexio's response and use it to create a success (such as a receipt) or failure page for the customer. You may also want to send a receipt to the customer via email.
Additionally, you may want to store the
id
returned in the response as this is the payment ID and you can use it to query the status of the transaction (using the View transaction by payment ID endpoint) within about a minute. You may also want to store thetransactionId
. You can only get this parameter after the transaction runs. You get it in the webhook with thetransactionId
(note that this parameter is not returned for legacy webhooks) or in theid
returned in any of the following endpoints:
Updated 17 days ago