Getting started
There are two ways of capturing card data. The easiest way is to load and display our card capture webpage, the other is to build your own card capture form and submit the details to us via an API endpoint.
- Load and display our card capture page in your application.
- Next, implement a response handler in your application backend.
- Finally, integrate a call to perform a purchase transaction from your application backend.
Using Our Card Capture Page
Simply build the hosted page URL according to the following format and display it in a mobile app webview or iframe etc
https://{{baseUrl}}/defaulthostedpage?returnUrl={{responseHandler}}&merchantId={{yourMerchantId}}&customerId={{yourCustomersId}}
Replace the following...
baseUrl
with the live or test baseUrl ()returnUrl
should be your response handler endpointmerchantId
should be the live or test environment merchantId provided to youcustomerId
should be the unique customerId on your end which you will later use when performing transactions
Response Handler
An endpoint has to be implemented in your application backend that will process a POST request with data submitted as a form (application/x-www-form-urlencoded).
The following fields will be submitted to your endpoint.
- success (true or false)
- message (Card tokenized successfully or an error message)
- token (card token if successfull)
- cardMask (masked card number in the format 4242-42xx-xxxx-4242)
- expiryMonth (two digit month)
- expiryYear (two digit year)
- cardType (V for Visa, M for Mastercard and U for Unionpay)
- merchantId (the merchant id sent with the tokenize api call)
- customerId (the customer id sent with the tokenize api call)
- orderId (the order id sent with the tokenize api call)
It is your responsibility to process the incoming data and save the token with the relevant customer.
You will be using this token in all future transactions related to this card.
Once you complete processing the response, you have to redirect to a different page in your website or
in the case of a mobile app, redirect to a url that can be caught by a listener in your webview and process accordingly.
Purchase Transaction
Send a Purchase Transaction whenever you wish to performa a transaction using a
customer's tokenized card. Initiate this transaction from your application backend. Make every effort to avoid double
submissions.
Refer to Authentication to calculate and include a hash in your request.
You are expected to save the responses from this api call whether successful or not. This data is important during troubleshooting.