If you implement embed() and want Digital River to add the iframe which displays a Prebuilt Checkout to a specific HTML element, then assigns that element's identifier to containerElementId.
Defining the checkout experience
In options, you can control the appearance and behavior of a Prebuilt Checkout. Specifically, you can use options to:
In options, the displayMode, whose value can either be standard (default) or fullPage, controls the size of the checkout window.
A standard value results in a window whose dimensions are less than those of the browser window while fullPage expands the window to the edges of the browser window.
Stylize the modal
Set style.experience in options to alter the checkout window's logo, theme, borders, text fields, and fonts. For details, refer to Defining experience.
Localize the experience
Digital River localizes the Prebuilt Checkout window by default based on the customer’s browser settings. But if you want to control the language of the experience, set language in options.
If you do define options.language, then Digital River assigns the same value to language in the checkout-session.
Custom page: To redirect customers to your fully customized order confirmation page, pass the appropriate web address.
Default window: To display Digital River's default order confirmation, omit thankYouPage. You can customize this default confirmation by calling replaceDefaultMessage(), which is exposed by actions.thankYouPage.
Close window: If you want the Prebuilt Checkout window to immediately close after customers place an order, set thankYouPage to none.
Restrict shipping and billing countries
By setting shipToCountries and/or billToCountries in options, you can restrict the values displayed in the drop-down menus that customers use to select a country in the name and address collection stage.
The values you pass must be formatted as two-letter Alpha-2 country codes as described in the ISO 3166 international standard.
Modify the text of the country drop-down menu's label
To capture secure payment details, Prebuilt Checkout wraps elements with a predetermined style. But you can customize their look and feel by defining style.
placeholderText: The placeholder that appears in the online banking selector.
Enable and disable payment methods
To display and hide specific payment methods, provide a list of enabledPaymentMethods and disabledPaymentMethods.
For details on how to format these values, refer to Source types.
If you don't populate either of these arrays, then, by default, Prebuilt Checkout displays all transaction-applicable payment methods. If enabledPaymentMethods contains a value that doesn't meet this precondition, then it's not presented as an option to customers.
As events occur during the checkout process, these methods are executed.
onInit
The onInit method, which accepts checkoutSession and actions, executes when Prebuilt Checkout initializes.
onReady
The onReady method executes when the checkout-session is created, and the Prebuilt Checkout is loaded and ready for customer interaction.
onAddressComplete
The onAddressComplete method, which accepts an optional address and actions, executes when customers successfully submit their shipping and/or billing information and the checkout-session's shipTo and/or billTo is updated.
If passed, then onAddressComplete returns address, which contains the customer’s billing and shipping data.
If passed, then onCheckoutComplete returns the order.
onClose
The onClose method, which optionally accepts checkoutCompleted, executes when customers close Prebuilt Checkout.
If passed, checkoutCompleted returns a boolean that indicates whether it closed before the checkout process is completed. If true, customers close the window in the order confirmation stage. If false, it was closed in an earlier stage.
onError
The onError method, which optionally accepts error, executes when a problem occurs during the checkout process.
If passed, then onError returns an error that contains a type and an array of errors[], each element of which provides more details on the triggering event.