async function validatePaymentResult(resultToken) {
const response = await fetch('https://service.pcibooking.net/api/eWalletOperation/validateResults', {
method: 'POST',
headers: {
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'text/plain'
},
body: resultToken
});
const data = await response.json();
return data.valid; // true if the token is authentic
}
import requests
def validate_payment_result(result_token):
response = requests.post(
'https://service.pcibooking.net/api/eWalletOperation/validateResults',
headers={
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'text/plain'
},
data=result_token
)
data = response.json()
return data['valid'] # True if the token is authentic
{
"upgChargeResults": {
"gatewayName": "stripeProduction",
"gatewayReference": "ch_3PqK8w2eZvKYlo2C1gMD48Zx",
"authorizationCode": "831000",
"amount": 25.00,
"currency": "USD",
"operationType": "Charge",
"operationResultCode": "Success",
"operationResultDescription": "Approved",
"gatewayResultDescription": "succeeded"
},
"directChargeResults": null,
"tokenAndMaskedCardModel": {
"token": "nQGywsQE9gbURtrXEjTZwtWqeMdK9nsO",
"bankCard": {
"type": "Visa",
"number": "************1111",
"expirationMonth": 12,
"expirationYear": 2027,
"nameOnCard": "Jane Smith"
}
},
"failedUpgChargeResults": null
}
{
"code": -125,
"message": "Bad input data",
"moreInfo": "...",
"errorList": null
}
Library Setup & Use
Validate Operation Result
Validate the data returned to the client after a Payments Library operation to ensure it was not altered.
POST
/
api
/
eWalletOperation
/
validateResults
async function validatePaymentResult(resultToken) {
const response = await fetch('https://service.pcibooking.net/api/eWalletOperation/validateResults', {
method: 'POST',
headers: {
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'text/plain'
},
body: resultToken
});
const data = await response.json();
return data.valid; // true if the token is authentic
}
import requests
def validate_payment_result(result_token):
response = requests.post(
'https://service.pcibooking.net/api/eWalletOperation/validateResults',
headers={
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'text/plain'
},
data=result_token
)
data = response.json()
return data['valid'] # True if the token is authentic
{
"upgChargeResults": {
"gatewayName": "stripeProduction",
"gatewayReference": "ch_3PqK8w2eZvKYlo2C1gMD48Zx",
"authorizationCode": "831000",
"amount": 25.00,
"currency": "USD",
"operationType": "Charge",
"operationResultCode": "Success",
"operationResultDescription": "Approved",
"gatewayResultDescription": "succeeded"
},
"directChargeResults": null,
"tokenAndMaskedCardModel": {
"token": "nQGywsQE9gbURtrXEjTZwtWqeMdK9nsO",
"bankCard": {
"type": "Visa",
"number": "************1111",
"expirationMonth": 12,
"expirationYear": 2027,
"nameOnCard": "Jane Smith"
}
},
"failedUpgChargeResults": null
}
{
"code": -125,
"message": "Bad input data",
"moreInfo": "...",
"errorList": null
}
Payments Library Reference
Complete reference for Payments Library operations
Error Responses
| Code | HTTP Status | Condition |
|---|---|---|
-1003 | 401 | API key is missing or invalid. |
-125 | 400 | The results token is invalid or could not be verified. |
Parameters
Headers
string
required
Your API key prefixed with
APIKEY. Example: APIKEY your-api-key. See the Authentication guide.Request Body
string
required
The payment token string received in the client-side callback function. Pass it as the raw request body.
async function validatePaymentResult(resultToken) {
const response = await fetch('https://service.pcibooking.net/api/eWalletOperation/validateResults', {
method: 'POST',
headers: {
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'text/plain'
},
body: resultToken
});
const data = await response.json();
return data.valid; // true if the token is authentic
}
import requests
def validate_payment_result(result_token):
response = requests.post(
'https://service.pcibooking.net/api/eWalletOperation/validateResults',
headers={
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'text/plain'
},
data=result_token
)
data = response.json()
return data['valid'] # True if the token is authentic
Response
A successful validation returns the decoded operation results. Which fields are populated depends on the operation and payment method:upgChargeResults- PSP transaction details for card, Apple Pay, and Google Pay charges. Always a single object holding the final gateway attempt.failedUpgChargeResults- Array of earlier failed attempts when a payment gateway fallback chain ran.nullwhen the first attempt was the only one.directChargeResults- Results for redirect-based methods (PayPal, bank payments, UPI).tokenAndMaskedCardModel- Token and masked card details forTOKENIZE,CHARGE_AND_TOKENIZE, andPREAUTH_AND_TOKENIZEoperations.
-125 with HTTP 400.
{
"upgChargeResults": {
"gatewayName": "stripeProduction",
"gatewayReference": "ch_3PqK8w2eZvKYlo2C1gMD48Zx",
"authorizationCode": "831000",
"amount": 25.00,
"currency": "USD",
"operationType": "Charge",
"operationResultCode": "Success",
"operationResultDescription": "Approved",
"gatewayResultDescription": "succeeded"
},
"directChargeResults": null,
"tokenAndMaskedCardModel": {
"token": "nQGywsQE9gbURtrXEjTZwtWqeMdK9nsO",
"bankCard": {
"type": "Visa",
"number": "************1111",
"expirationMonth": 12,
"expirationYear": 2027,
"nameOnCard": "Jane Smith"
}
},
"failedUpgChargeResults": null
}
{
"code": -125,
"message": "Bad input data",
"moreInfo": "...",
"errorList": null
}

