Comment on page

DigitalRiverCheckout object

Learn about the functionality exposed by the DigitalRiverCheckout object
Once you initialize DigitalRiverCheckout.js, you can use the DigitalRiverCheckout object to:

Create an instance of the checkout modal

The DigitalRiverCheckout object exposes createModal() which creates an instance of the checkout modal and displays it in the browser.
document.getElementById('YOUR_CHECKOUT_BUTTON_ID').addEventListener('click', async (event) => {
// An example asynchronous function that creates the checkout session
const checkoutSessionId = await createCheckoutSession();
// Creates and opens the modal
drCheckout.createModal(checkoutSessionId, config);

createModal(checkoutSessionId, config)

checkout session identifier

This required parameter identifies the checkout-session.


This optional parameter defines checkout options and event handlers.
For details, refer to Configuring the modal.

Creating an instance of components

The DigitalRiver object exposes components(). For details, refer to Components.

Display the checkout button

The DigitalRiverCheckout object exposes renderButton(), which displays a checkout button and allows you to initiate the checkout process. For details, refer to Rendering a checkout button.

Determine the status of the modal

The DigitalRiverCheckout object exposes getStatus(), which returns data on the modal's current state. For details, refer to Checking the status of the modal.