Skip to main content
This page is part of the Payments Library Guides. Prefer direct API calls instead? See REST API Guides.
Prerequisites: Complete the Library Setup first. All payment methods return results through the same callback function. This page covers how to parse results, check for success, and handle different payment types.

Parsing Results

Use parseResultToken() to decode the result token:
The method returns a tuple:
  • data - The parsed result object
  • success - Boolean indicating if the token was decoded (not whether payment succeeded)

Checking Payment Success

Always check clientSuccess first:

Result Types

Results vary based on the payment method used:

PSP Results (CardPay, Apple Pay, Google Pay)

Card-based payments return results through upgChargeResults:
Available fields:

Direct Results (PayPal, BankPay, UPI)

Redirect-based payments return results through directChargeResults:

Tokenization Results

When using TOKENIZE, CHARGE_AND_TOKENIZE, or PREAUTH_AND_TOKENIZE, card details are returned in tokenAndMaskedCardModel:

Complete Example

Server-Side Validation

Always validate results on your server before fulfilling orders:

Getting Selected Payment Method

Use getSelectedProviderName() to know which payment method the customer used:

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