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 ParameterTypeDescription
PaymentTypestringIt accepts 2 values as a string: "card", and "token".
Bypass3DSboolean, optionalSpecify either this transaction should be verified by 3DS or not.
SaveTokenboolean, optional"true" or "false" to save card data and returns a token.
Tokenstring, optionalThe token value that needs to execute the transaction against
CardCardModel 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 ParameterTypeDescription
Number stringRepresents the 16 digits of the card that will be charged for the transaction
ExpiryMonth stringCard expiry month
ExpiryYear stringCard expiry year
SecurityCode stringCard CVV / CVC
HolderNamestringName 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 FieldTypeDescription
Status stringThe transaction status
ErrorMessage stringIn case of error, the error message that is returned from the gateway.
PaymentId stringThe payment ID that is associated for the transaction.
Token stringIn case of "SaveToken" is requested, this value returns the token of the card.
PaymentURL stringThe OTP link. You should redirect your customer to this page.
CardInfoCardInfoModel array

CardInfoModel

Response FieldTypeDescription
Number stringThe card number that executed the payment, displays on the first and last 4 digits
ExpiryMonth stringCard expiry month
ExpiryYear stringCard expiry year
Brand stringCard brand (VISA or Master)
Issuer stringThe card issuer bank