Direct Card Payment
These are server to server card payments where you send encrypted card details directed to our server within the request body.
We support direct card collection requests. This means that as a merchant, you can create a payment form on your interface and then send the card details within the request body.
Card data is not sent in plain text but rather as an encrypted string.
To make direct card payments, you are required to provide an extra parameter in the request body, card_cipher
Generating data for the card_cipher
parameter
card_cipher
parameterEncryption
1. Create a JSON String With Card Details
A JSON string with data keys like those that follow should be created in that order. This includes the card details as shown below.
>>Getting a list of billing countries
To get a list of the available billing countries to use when composing the JSON card details string above, use the API description that follows
2. Encrypt the JSON String
To encrypt the JSON string correctly, we have organized a few code samples to illustrate how it could be done as shown below.
>> Downloading Public Key
Download our public key for encryption.
First Download the public key and store it in a text file named dusupay.public.key.pem
. This will be used to encrypt the card details included in the JSON string created earlier.
>> Encryption Code Samples
Set card_cipher parameter
Now that we have encrypted the card details. The resultant string after encryption is what we need to set as the card_cipher
and include it in the Post Collection Request
when making a Card Collection Request
By simply including the parameter, card_cipher
in the collection request body, is enough for Dusupay to know that you want to make a direct card payment.
Since it's 3D by default, it will return the bank authentication URL where you will redirect the customer.
In the future when we support 2D cards, we will simply charge the card as expected and the payment_url
response parameter will be empty
Last updated
Was this helpful?