To create a card payment via API, you first need to tokenize the card. Once you have obtained the token, you can perform charges on the card using its token (see below).
Request:
https://api.pay4bit.net/v1/cardBody:
{
"name": "John Doe",
"email": "johndoe@gmail.com",
"card_number": "4000000000001111",
"exp_month": "11",
"exp_year": "2029",
"cvc": "111",
"secret_key": "c3dz5fc9e6e3be44b551d5297df1f6d1"
}Response:
{
"message": "Card verification successful",
"paysystem": "visa",
"card_token": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"exp_date": "11/2029",
"last4": "1111"
}name, email – Optional parameters.
secret_key – Secret Key.
Perform charges
After tokenizing the card, you can process charges using the token.
Request:
https://api.pay4bit.net/v1/chargeBody:
{
"card_token": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"amount": "10",
"currency": "EUR",
"account": "+380684001000",
"desc": "Kyivstar Payment",
"return_url": "https://pay4bit.net/"
}Successful Response:
{
"paymentId": "17395",
"amount": "10",
"method": "visa",
"currency": "EUR",
"status": "succeeded"
}3DS Required:
{
"paymentId": "17395",
"threedstoken": "abcdefgh",
"status": "3DS Required",
"redirect_url": "https://3ds.pay4bit.net/abcdefgh",
"return_url": "your_return_url"
}account – Unique identifier in your system.
desc – Optional parameter, payment description.
redirect_url – URL to redirect the user to 3D Secure verification.
return_url – Will be used after additional verification 3D Secure.
After the payment is completed, you will receive a notification on your callback (see Payment Confirmation).