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 generating a capture context. A capture
context is a signed JSON Web Token (JWT) that contains your merchant configuration,
one-time encryption keys, and payment parameters.Follow these steps to make 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:- 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.This JWT contains all the functions compiled from the sessions API response:
The{ "targetOrigins": ["https://merchant.com", "https://reseller.com:8443"], "locale": "en_US", "country": "US", "orderInformation": { "amountDetails": { "totalAmount": "21.00", "currency":"USD"} } }targetOriginsarray must include every origin that will host the SDK. The response JWT is passed to the client-side library.This capture context contains only the minimum required fields. For information about the components of the capture context and how to create one using thesessionsAPI, see Sessions API. For a complete capture context with all available fields, see Example: Unified Checkout Complete Capture Context.
AFTER COMPLETING THE TASK
Proceed to Step 3: Set Up the Client-Side Component.