curl --request POST \
--url https://waffo.com/web/v1/session/confirm \
--header 'Content-Type: application/json' \
--data '
{
"sessionId": "<string>",
"confirmToken": "<string>",
"payMethodName": "<string>",
"tokenRequestId": "<string>",
"userPaymentAccessToken": "<string>",
"paymentTokenData": "<string>",
"userFields": {}
}
'import requests
url = "https://waffo.com/web/v1/session/confirm"
payload = {
"sessionId": "<string>",
"confirmToken": "<string>",
"payMethodName": "<string>",
"tokenRequestId": "<string>",
"userPaymentAccessToken": "<string>",
"paymentTokenData": "<string>",
"userFields": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
sessionId: '<string>',
confirmToken: '<string>',
payMethodName: '<string>',
tokenRequestId: '<string>',
userPaymentAccessToken: '<string>',
paymentTokenData: '<string>',
userFields: {}
})
};
fetch('https://waffo.com/web/v1/session/confirm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://waffo.com/web/v1/session/confirm",
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>',
'confirmToken' => '<string>',
'payMethodName' => '<string>',
'tokenRequestId' => '<string>',
'userPaymentAccessToken' => '<string>',
'paymentTokenData' => '<string>',
'userFields' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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 := "https://waffo.com/web/v1/session/confirm"
payload := strings.NewReader("{\n \"sessionId\": \"<string>\",\n \"confirmToken\": \"<string>\",\n \"payMethodName\": \"<string>\",\n \"tokenRequestId\": \"<string>\",\n \"userPaymentAccessToken\": \"<string>\",\n \"paymentTokenData\": \"<string>\",\n \"userFields\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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("https://waffo.com/web/v1/session/confirm")
.header("Content-Type", "application/json")
.body("{\n \"sessionId\": \"<string>\",\n \"confirmToken\": \"<string>\",\n \"payMethodName\": \"<string>\",\n \"tokenRequestId\": \"<string>\",\n \"userPaymentAccessToken\": \"<string>\",\n \"paymentTokenData\": \"<string>\",\n \"userFields\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://waffo.com/web/v1/session/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"sessionId\": \"<string>\",\n \"confirmToken\": \"<string>\",\n \"payMethodName\": \"<string>\",\n \"tokenRequestId\": \"<string>\",\n \"userPaymentAccessToken\": \"<string>\",\n \"paymentTokenData\": \"<string>\",\n \"userFields\": {}\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "success",
"data": {
"sessionType": "<string>",
"payment": {
"acquiringOrderId": "<string>",
"orderStatus": "<string>",
"orderAction": "<string>"
},
"subscription": {
"subscriptionId": "<string>",
"subscriptionStatus": "<string>",
"subscriptionAction": "<string>"
}
}
}Submit a payment
The SDK submits the payment credential; acquiring merges it with the session snapshot and creates the real order through the existing order-create kernel.
curl --request POST \
--url https://waffo.com/web/v1/session/confirm \
--header 'Content-Type: application/json' \
--data '
{
"sessionId": "<string>",
"confirmToken": "<string>",
"payMethodName": "<string>",
"tokenRequestId": "<string>",
"userPaymentAccessToken": "<string>",
"paymentTokenData": "<string>",
"userFields": {}
}
'import requests
url = "https://waffo.com/web/v1/session/confirm"
payload = {
"sessionId": "<string>",
"confirmToken": "<string>",
"payMethodName": "<string>",
"tokenRequestId": "<string>",
"userPaymentAccessToken": "<string>",
"paymentTokenData": "<string>",
"userFields": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
sessionId: '<string>',
confirmToken: '<string>',
payMethodName: '<string>',
tokenRequestId: '<string>',
userPaymentAccessToken: '<string>',
paymentTokenData: '<string>',
userFields: {}
})
};
fetch('https://waffo.com/web/v1/session/confirm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://waffo.com/web/v1/session/confirm",
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>',
'confirmToken' => '<string>',
'payMethodName' => '<string>',
'tokenRequestId' => '<string>',
'userPaymentAccessToken' => '<string>',
'paymentTokenData' => '<string>',
'userFields' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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 := "https://waffo.com/web/v1/session/confirm"
payload := strings.NewReader("{\n \"sessionId\": \"<string>\",\n \"confirmToken\": \"<string>\",\n \"payMethodName\": \"<string>\",\n \"tokenRequestId\": \"<string>\",\n \"userPaymentAccessToken\": \"<string>\",\n \"paymentTokenData\": \"<string>\",\n \"userFields\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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("https://waffo.com/web/v1/session/confirm")
.header("Content-Type", "application/json")
.body("{\n \"sessionId\": \"<string>\",\n \"confirmToken\": \"<string>\",\n \"payMethodName\": \"<string>\",\n \"tokenRequestId\": \"<string>\",\n \"userPaymentAccessToken\": \"<string>\",\n \"paymentTokenData\": \"<string>\",\n \"userFields\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://waffo.com/web/v1/session/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"sessionId\": \"<string>\",\n \"confirmToken\": \"<string>\",\n \"payMethodName\": \"<string>\",\n \"tokenRequestId\": \"<string>\",\n \"userPaymentAccessToken\": \"<string>\",\n \"paymentTokenData\": \"<string>\",\n \"userFields\": {}\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "success",
"data": {
"sessionType": "<string>",
"payment": {
"acquiringOrderId": "<string>",
"orderStatus": "<string>",
"orderAction": "<string>"
},
"subscription": {
"subscriptionId": "<string>",
"subscriptionStatus": "<string>",
"subscriptionAction": "<string>"
}
}
}Headers
Body
Payment session id returned by the session create api.
1Confirm token returned at the top level of session/info. Send it back unchanged.
1Pay method name chosen by the user. Required for wallets (APPLEPAY / GOOGLEPAY) and other non-card methods. Optional for cards: the actual card pay method (e.g. CC_VISA or DC_VISA) is resolved by the server from the card BIN.
Token request id returned by the card Element after the card is submitted. Waffo looks up the card token by it. Set it only for a newly entered card; mutually exclusive with userPaymentAccessToken and paymentTokenData.
64Waffo card token of an already saved card. Set it only when paying with a saved card; mutually exclusive with tokenRequestId and paymentTokenData.
256Encrypted payment token returned by Apple Pay / Google Pay after user authorization. Set it only for wallet payments; mutually exclusive with tokenRequestId and userPaymentAccessToken.
8192Values collected by the SDK for the requiredFields list. Key is the field path identical to the order create request body, e.g. userInfo.userEmail.
Show child attributes
Show child attributes
Was this page helpful?