Skip to main content
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.

Engine Constructor

UI Options

Control how the CardPay card-entry form is displayed. Other providers are not affected.
displayMode applies to the CardPay form only. Apple Pay, Google Pay, PayPal, BankPay, and UPI continue to use their standard flows.

Localization

The library supports 20 languages. Pass a language code to the constructor:

Supported Languages

checkAvailability()

Returns the list of payment methods available on the current device and browser:
Use this to filter which buttons to display. For example, Apple Pay is only available on Safari/iOS, and Google Pay only on Chrome/Android.

payBy() Method

A requiredAncillaryInfo passed to payBy replaces the one given to the constructor. Pass undefined for any optional argument you skip. For iframeStyleConfig, see Card Form Appearance. Each button is an object with name and domEntitySelector:

Button Styling

Customize button appearance with ButtonProperties:

Card Form Appearance

Pass iframeStyleConfig as the fifth argument of payBy to restyle the CardPay forms: the new card form, the CVV form and the stored card list. It applies in both popup and iframe display modes. Every property is optional. Anything you leave out keeps its default. Other payment methods are not affected.

Parsing Results

Use parseResultToken() to decode the result token into structured data:
The method returns a tuple:
  • data - The parsed result object containing payment details
  • success - Boolean indicating if the token was successfully decoded (not whether the payment succeeded)
To determine if a payment succeeded, check data.clientSuccess:

getSessionType()

Returns the operation type for this session:

getSelectedProviderName()

Returns which payment method the customer used:

Result Data Structure

directChargeResults.data is intentionally untyped. Its contents are provider-specific (PayPal, BankPay, UPI each return different fields) and may change as those providers update their APIs. Use success and message to determine the payment outcome - do not build logic that depends on the contents of data.

Address Collection

Request billing and/or shipping addresses from the payment method (supported by the CardPay form, Google Pay, Apple Pay and PayPal).

Configuration

Address Levels

Choosing Single Fields

To ask for exactly the billing fields you need, set billingInfo.fields. When it is set, only the fields marked true are shown, and details, phoneRequired and emailAddressRequired are ignored.
Fields: name, phoneNumber, emailAddress, countryCode, postalCode, addressLines, locality, administrativeArea.
  • fields applies to the CardPay form only. Apple Pay and Google Pay show their own address sheets: Google Pay follows details and phoneRequired, and Apple Pay asks for the full billing address, name, phone and email whenever billingInfo is set. If you offer either wallet, set details as well.
  • fields applies to billing only. shippingInfo always asks for the full address.
Ask for every billing field your payment gateways need, including any fallback gateways. A field the payer was not asked for is left empty, and a gateway that requires it may reject the charge.

Retrieving Addresses

After payment completes, retrieve the collected addresses:

Operations

The session operation (set when creating the session) determines what the library does:
Tokenization is only available for CardPay, ApplePay, and GooglePay. PayPal, BankPay, and UPI support charge only.

Payment Method Requirements

CardPay, ApplePay, GooglePay

Requires a payment processor (PSP) configured in your Orchestra account. Pass paymentGatewayAccountId when creating the session. Orchestra supports many payment gateways. For the full list, see our integrations page or call List All Payment Gateways.

ApplePay, GooglePay

In addition to PSP credentials, these require:
  • Merchant registration with Apple/Google
  • Domain verification
  • A PSP that supports 3DS
See ApplePay Setup and GooglePay Setup for details.

PayPal

Requires PayPal merchant credentials configured in the Orchestra Portal. See PayPal Setup for details.

BankPay

Requires a BankPay eWallet account configured in the Orchestra Portal. We set up the bank payment provider for you. Contact our team to confirm regional support.

UPI

Requires a UPI provider account configured in the Orchestra Portal. Only available for INR transactions in India.

Library Setup

Quick start guide

Supported Payment Methods

All payment methods

Result Handling

Parse payment results

Payments Library API

Backend endpoint reference