This page is part of the Payments Library Guides. For what your backend does after capture, like charging stored tokens and refunds, see the REST API Guides.
Parsing Results
UseparseResultToken() to decode the result token:
data- The parsed result objectsuccess- Boolean indicating if the token was decoded (not whether payment succeeded)
Checking Payment Success
Always checkclientSuccess first:
Result Types
Results vary based on the payment method used:PSP Results (CardPay, Apple Pay, Google Pay)
Card-based payments return results throughupgChargeResults:
Decline Reasons
Every gateway words its declines differently.rejectReasonCode normalizes them, so you can react to a decline without writing gateway-specific parsing. It is None when nothing was rejected.
upgChargeResults is always a single object holding the final gateway attempt. If your account has a gateway fallback chain and earlier attempts failed, those failed attempts are returned separately as an array in failedUpgChargeResults. When there was only one attempt, failedUpgChargeResults is null.Direct Results (PayPal, BankPay, UPI)
Redirect-based payments return results throughdirectChargeResults:
Tokenization Results
When usingTOKENIZE, CHARGE_AND_TOKENIZE, or PREAUTH_AND_TOKENIZE, card details are returned in tokenAndMaskedCardModel:
Persist these non-sensitive fields alongside the token if you plan to offer stored-card payments later - they are needed to display the saved card, and cannot be retrieved afterwards.
Complete Example
Server-Side Validation
Always validate results on your server before fulfilling orders:Getting Selected Payment Method
UsegetSelectedProviderName() to know which payment method the customer used:
Related
Library Reference
Full API reference
Complete Example
End-to-end integration
Start Session API
Create a session token
Validate Results API
Server-side validation endpoint