Charge a card
Submit the Flex token or MPGS session after hosted fields. Inspect data.status for fingerprint_required, 3ds_required, success, or failed.
POST
/
payment
/
checkout
/
charge
/
card
Charge a card
curl --request POST \
--url https://server.staging.vestrapay.app/v1/payment/checkout/charge/card \
--header 'Content-Type: application/json' \
--header 'x-access-code: <api-key>' \
--data '
{
"sessionId": "<string>",
"transientToken": "<string>",
"browser": "<string>",
"browserDetails": {
"screenHeight": 123,
"screenWidth": 123,
"colorDepth": 123,
"javaEnabled": true,
"language": "<string>",
"timeZone": 123
}
}
'const options = {
method: 'POST',
headers: {'x-access-code': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sessionId: '<string>',
transientToken: '<string>',
browser: '<string>',
browserDetails: {
screenHeight: 123,
screenWidth: 123,
colorDepth: 123,
javaEnabled: true,
language: '<string>',
timeZone: 123
}
})
};
fetch('https://server.staging.vestrapay.app/v1/payment/checkout/charge/card', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://server.staging.vestrapay.app/v1/payment/checkout/charge/card"
payload = {
"sessionId": "<string>",
"transientToken": "<string>",
"browser": "<string>",
"browserDetails": {
"screenHeight": 123,
"screenWidth": 123,
"colorDepth": 123,
"javaEnabled": True,
"language": "<string>",
"timeZone": 123
}
}
headers = {
"x-access-code": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://server.staging.vestrapay.app/v1/payment/checkout/charge/card",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sessionId' => '<string>',
'transientToken' => '<string>',
'browser' => '<string>',
'browserDetails' => [
'screenHeight' => 123,
'screenWidth' => 123,
'colorDepth' => 123,
'javaEnabled' => true,
'language' => '<string>',
'timeZone' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-code: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"status": "success",
"data": {
"status": "fingerprint_required",
"reference": "<string>",
"message": "<string>",
"fingerprintHtml": "<string>",
"threeDsHtml": "<string>"
}
}Authorizations
Access code from initialize. Query access_code is also accepted.
Body
application/json
⌘I
Charge a card
curl --request POST \
--url https://server.staging.vestrapay.app/v1/payment/checkout/charge/card \
--header 'Content-Type: application/json' \
--header 'x-access-code: <api-key>' \
--data '
{
"sessionId": "<string>",
"transientToken": "<string>",
"browser": "<string>",
"browserDetails": {
"screenHeight": 123,
"screenWidth": 123,
"colorDepth": 123,
"javaEnabled": true,
"language": "<string>",
"timeZone": 123
}
}
'const options = {
method: 'POST',
headers: {'x-access-code': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sessionId: '<string>',
transientToken: '<string>',
browser: '<string>',
browserDetails: {
screenHeight: 123,
screenWidth: 123,
colorDepth: 123,
javaEnabled: true,
language: '<string>',
timeZone: 123
}
})
};
fetch('https://server.staging.vestrapay.app/v1/payment/checkout/charge/card', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://server.staging.vestrapay.app/v1/payment/checkout/charge/card"
payload = {
"sessionId": "<string>",
"transientToken": "<string>",
"browser": "<string>",
"browserDetails": {
"screenHeight": 123,
"screenWidth": 123,
"colorDepth": 123,
"javaEnabled": True,
"language": "<string>",
"timeZone": 123
}
}
headers = {
"x-access-code": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://server.staging.vestrapay.app/v1/payment/checkout/charge/card",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sessionId' => '<string>',
'transientToken' => '<string>',
'browser' => '<string>',
'browserDetails' => [
'screenHeight' => 123,
'screenWidth' => 123,
'colorDepth' => 123,
'javaEnabled' => true,
'language' => '<string>',
'timeZone' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-code: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"status": "success",
"data": {
"status": "fingerprint_required",
"reference": "<string>",
"message": "<string>",
"fingerprintHtml": "<string>",
"threeDsHtml": "<string>"
}
}