Performing actions
Gain a better understanding of how to perform customized actions in a Prebuilt Checkout
In Prebuilt Checkout, various callback functions can be assigned to properties in its configuration object. Some of these functions accept an optional actions
parameter, which allows you to:
Display custom order summary messages
You can use orderSummary
to render specific messages in the Prebuilt Checkout window.
orderSummary
orderSummary
The orderSummary
property in actions
allows you to specify whether you want a customized message to be displayed in the middle
and/or the bottom
of this section in Prebuilt Checkout.
You might find this useful if you'd like to, as an example, inform customers that the order summary amounts aren't final until they've selected a shipping option, provided applicable tax identification numbers, and applied the payment.
middle
middle
This property allows you to access the middle
of the window's orderSummary
section.
bottom
bottom
This property allows you to access the bottom
of the window's orderSummary
section.
addCustomMessage(message, showInfoIcon)
addCustomMessage(message, showInfoIcon)
This function displays a customized message in the middle
or bottom
of orderSummary
. It accepts an optional string representing the message you want displayed and an optional boolean, which determines whether Digital River displays an information icon next to your message.
The default value of showInfoIcon
is true
.
deleteCustomMessage()
deleteCustomMessage()
This function deletes any customized messages that exists in the middle
or bottom
of orderSummary
.
Customize the order confirmation
You can use thankYouPage
to customize the order confirmation stage.
thankYouPage
thankYouPage
replaceDefaultMessage(message, showCheckCircleIcon)
replaceDefaultMessage(message, showCheckCircleIcon)
This function accepts a string, which represents the message you want displayed.
The function also accepts an optional boolean that determines whether Digital River displays a circle check icon (a visual cue that the purchase was successful) before your customized message.
The default value of showCheckCircleIcon
is true
.
Reject address inputs
The reject()
function, exposed by actions
, allows you to refuse shipping and billing inputs that you deem invalid.
reject()
reject()
It accepts an optional string representing the error message you'd like displayed. If you don't define this parameter, Digital River displays a default message.
You can use reject()
to screen out specific address categories. For example, with a regular expression and reject()
, you can prevent customers from shipping products to P.O. boxes.
Last updated