On This Page
Step 2: Set Up the Server-Side Component
To initialize
Unified Checkout
within your webpage, you need to set
up the server-side component. This task involves making a server-to-server call to the
sessions API to authenticate your merchant credentials and establish how the Unified Checkout
front-end components will function.For detailed information about .
Unified Checkout
and
the integration process, see the Unified Checkout
Integration
Guide- Implement a server-to-server call to the sessions API.
ADDITIONAL INFORMATION
This call should include parameters that define howUnified Checkoutperforms. - Handle the response from the sessions API.
ADDITIONAL INFORMATION
The response will contain:- A transaction-specific public key for securing the transaction in the customer's browser.
- An authenticated context description package that manages the payment experience on the client side, including available payment options, interface styling, and payment methods.
- Store and manage the JSON Web Token (JWT) object, referred to as thecapture context.
ADDITIONAL INFORMATION
This JWT contains all the functions compiled from the sessions API response.
REST Example: Set Up the Server-Side Component
In this example, the
targetOrigins
and the
allowedPaymentTypes
fields define the target origin and the accepted
digital payment methods in your capture context. { "clientReferenceInformation": { "code": "TAGX001" }, "targetOrigins": [ "https://www.test.com" ], "clientVersion": "0.26", "allowedCardNetworks": [ "VISA", "MASTERCARD", "AMEX" ], "allowedPaymentTypes": [ "PANENTRY", "CLICKTOPAY", "GOOGLEPAY" ], "country": "US", "locale": "en_US", "captureMandate": { "billingType": "FULL", "requestEmail": true, "requestPhone": true, "requestShipping": true, "shipToCountries": [ "US", "GB" ], "showAcceptedNetworkIcons": true }, "orderInformation": { "amountDetails": { "totalAmount": "1.01", "currency": "USD" } }, "completeMandate": { "type": "CAPTURE", "decisionManager": true } }
AFTER COMPLETING THE TASK
Proceed to Step 3: Set Up the Client-Side Component.