DirectPayment
Endpoint
Overview
The "DirectPayment" endpoint is a POST request. It is used to facilitate the payment process for your buyers. Detailed functionality of how to use this endpoint is explained in the Direct Payment and Tokenization sections.
The endpoint on Swagger is: Payment_DirectPaymentAsync.
Now, we are going to declare the endpoint and its models along with each accepted parameter and possible value.
Request Header
Add "Authorization": "Bearer {Token}" to request header. Token of demo configuration can be found here.
Request Model
The request is a POST request with the following parameters:
Input Parameter | Type | Description |
---|---|---|
PaymentType | string | It accepts 2 values as a string: "card", and "token". |
Bypass3DS | boolean, optional | Specify either this transaction should be verified by 3DS or not. |
SaveToken | boolean, optional | "true" or "false" to save card data and returns a token. |
Token | string, optional | The token value that needs to execute the transaction against |
Card | CardModel array, optional |
Card or Token Parameters
You have to provide at least one value of the two parameters:
- You have to provide Card Model data if the PaymentType parameter is "card".
- You have to provide the Token parameter value if the PaymentType parameter is "token".
CardModel
Input Parameter | Type | Description |
---|---|---|
Number | string | Represents the 16 digits of the card that will be charged for the transaction |
ExpiryMonth | string | Card expiry month |
ExpiryYear | string | Card expiry year |
SecurityCode | string | Card CVV / CVC |
HolderName | string | Name on card |
Response Model
After viewing the Response Model that you will get as a result of your request, here, you will find full details about the Data Model of this API endpoint. Let's check it and its contents.
Response Field | Type | Description |
---|---|---|
Status | string | The transaction status |
ErrorMessage | string | In case of error, the error message that is returned from the gateway. |
PaymentId | string | The payment ID that is associated for the transaction. |
Token | string | In case of "SaveToken" is requested, this value returns the token of the card. |
PaymentURL | string | The OTP link. You should redirect your customer to this page. |
CardInfo | CardInfoModel array |
CardInfoModel
Response Field | Type | Description |
---|---|---|
Number | string | The card number that executed the payment, displays on the first and last 4 digits |
ExpiryMonth | string | Card expiry month |
ExpiryYear | string | Card expiry year |
Brand | string | Card brand (VISA or Master) |
Issuer | string | The card issuer bank |
Updated 12 months ago