Confirm 3D Secure authentication
curl --request POST \
--url http://localhost:3001/api/v1/business/payment/confirm-3ds \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"transactionId": "<string>",
"sessionToken": "<string>",
"amount": "<string>",
"currency": "<string>",
"paymentId": "<string>"
}
'import requests
url = "http://localhost:3001/api/v1/business/payment/confirm-3ds"
payload = {
"transactionId": "<string>",
"sessionToken": "<string>",
"amount": "<string>",
"currency": "<string>",
"paymentId": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transactionId: '<string>',
sessionToken: '<string>',
amount: '<string>',
currency: '<string>',
paymentId: '<string>'
})
};
fetch('http://localhost:3001/api/v1/business/payment/confirm-3ds', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3001",
CURLOPT_URL => "http://localhost:3001/api/v1/business/payment/confirm-3ds",
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([
'transactionId' => '<string>',
'sessionToken' => '<string>',
'amount' => '<string>',
'currency' => '<string>',
'paymentId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3001/api/v1/business/payment/confirm-3ds"
payload := strings.NewReader("{\n \"transactionId\": \"<string>\",\n \"sessionToken\": \"<string>\",\n \"amount\": \"<string>\",\n \"currency\": \"<string>\",\n \"paymentId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3001/api/v1/business/payment/confirm-3ds")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"transactionId\": \"<string>\",\n \"sessionToken\": \"<string>\",\n \"amount\": \"<string>\",\n \"currency\": \"<string>\",\n \"paymentId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/api/v1/business/payment/confirm-3ds")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transactionId\": \"<string>\",\n \"sessionToken\": \"<string>\",\n \"amount\": \"<string>\",\n \"currency\": \"<string>\",\n \"paymentId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"paymentId": "<string>",
"status": "pending",
"chargedAmount": 10.16,
"serviceFee": 0.16,
"amount": 10,
"currency": "<string>",
"transactionId": "<string>",
"paymentUrl": "<string>",
"refundId": "<string>",
"requiresAction": {},
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}Payments
Confirm 3D Secure authentication
Completes a charge that came back with requiresAction, once the payer has finished the 3-D Secure challenge. Key it on the transactionId the charge returned, not on the payment id. The response carries the verdict from the card platform, but only a failure is written back to the payment: a successful authentication leaves the payment pending until the settlement webhook arrives, so treat your webhook endpoint as the authority on a completed payment.
POST
/
api
/
v1
/
business
/
payment
/
confirm-3ds
Confirm 3D Secure authentication
curl --request POST \
--url http://localhost:3001/api/v1/business/payment/confirm-3ds \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"transactionId": "<string>",
"sessionToken": "<string>",
"amount": "<string>",
"currency": "<string>",
"paymentId": "<string>"
}
'import requests
url = "http://localhost:3001/api/v1/business/payment/confirm-3ds"
payload = {
"transactionId": "<string>",
"sessionToken": "<string>",
"amount": "<string>",
"currency": "<string>",
"paymentId": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transactionId: '<string>',
sessionToken: '<string>',
amount: '<string>',
currency: '<string>',
paymentId: '<string>'
})
};
fetch('http://localhost:3001/api/v1/business/payment/confirm-3ds', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3001",
CURLOPT_URL => "http://localhost:3001/api/v1/business/payment/confirm-3ds",
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([
'transactionId' => '<string>',
'sessionToken' => '<string>',
'amount' => '<string>',
'currency' => '<string>',
'paymentId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3001/api/v1/business/payment/confirm-3ds"
payload := strings.NewReader("{\n \"transactionId\": \"<string>\",\n \"sessionToken\": \"<string>\",\n \"amount\": \"<string>\",\n \"currency\": \"<string>\",\n \"paymentId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3001/api/v1/business/payment/confirm-3ds")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"transactionId\": \"<string>\",\n \"sessionToken\": \"<string>\",\n \"amount\": \"<string>\",\n \"currency\": \"<string>\",\n \"paymentId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/api/v1/business/payment/confirm-3ds")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transactionId\": \"<string>\",\n \"sessionToken\": \"<string>\",\n \"amount\": \"<string>\",\n \"currency\": \"<string>\",\n \"paymentId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"paymentId": "<string>",
"status": "pending",
"chargedAmount": 10.16,
"serviceFee": 0.16,
"amount": 10,
"currency": "<string>",
"transactionId": "<string>",
"paymentUrl": "<string>",
"refundId": "<string>",
"requiresAction": {},
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}