Performing actions
Gain a better understanding of how to perform customized actions in a Prebuilt Checkout
Last updated
Gain a better understanding of how to perform customized actions in a Prebuilt Checkout
Last updated
In , various callback functions can be assigned to properties in its. Some of these functions accept an optional actions
parameter, which allows you to:
You can use to render specific messages in the Prebuilt Checkout window.
orderSummary
The orderSummary
property in allows you to specify whether you want a customized message to be displayed in the and/or the 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
This property allows you to access the middle
of the window's section.
bottom
This property allows you to access the bottom
of the window's section.
addCustomMessage(message, showInfoIcon)
The default value of showInfoIcon
is true
.
deleteCustomMessage()
thankYouPage
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()
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.
This function displays a customized message in the or of . 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.
This function deletes any customized messages that exists in the or of .
When executes, the following procedure loads your message in the middle of the order summary section.
After users successfully submit their address information and executes, the middle message is deleted, and a different message is added to the bottom.
When executes, the following procedure loads your message, without an information icon, in the middle of the order summary section.
You can use to customize the order confirmation stage.
In , the thankYouPage
property, which defines the , exposes .
If you omit , then you can use replaceDefaultMessage()
to modify the .
If you'd like the order's identifier injected into this message, add {{orderId}}
to the string. When the template renders, Digital River dynamically replaces this placeholder with the order's id
in our system or, if you passed upstreamId
in the , that value.
Invoke replaceDefaultMessage()
inside and make sure to pass checkoutSession
to this callback function.
When onInit
executes, the following procedure loads your replacement message in .
When onInit
executes, the following procedure loads your replacement message without a check circle icon in .
The function, exposed by , allows you to refuse shipping and billing inputs that you deem invalid.
If invoked in , then reject()
(1) blocks customers from proceeding to the checkout's next stage, and (2) displays an error message.