Payment Menu Functions
During operation in the Payment Menu, you have several options on interacting with the client script, as described below.
Initialization / Configuration
After placing the client script onto your website, you can start to use the functions to load in the payment UI, but before you can open up the UI you need to configure it. This involves giving the payment UI a place to load in the iFrame. Provide the location where we can embed our iFrame INSIDE OF, by adding the ID as the “container” in the object. See the example below.
Configuring the UI
1
2
3
4
5
6
7
payex.hostedView.checkout({
container: "string",
culture: "string",
style: { "object" },
theme: "string",
integration: "string"
});
container
string
culture
string
style
object
theme
string
integration
string
If you want more details about how to style the Payment UI, check out our section on the Custom Styling (only for merchants with a special agreement with us).
Open
This function is used to open up the Payment UI inside of the specified container.
Opening the Checkout UI
1
payex.hostedView.checkout().open();
Take care not to run this function multiple times, as this will open up multiple payment windows at the same time.
Update
Allows you to update the language and/or the style of the Payment UI.
Changing the configuration after initialization
1
2
3
4
5
payex.hostedView.checkout().update({
culture: "string",
style: { "object" },
theme: "string"
});
culture
string
style
object
theme
string
If you want more details about how to style the Payment UI, check out our section on the Custom Styling (only for merchants with a special agreement with us).
Refresh
Used to refresh the UI in case you have updated the Payment, like
adding / removing items from the OrderItems section, or updating the total
cost of the purchase.
Refreshing the UI after updating the payment
1
payex.hostedView.checkout().refresh();
Close
Used to close the Payment UI. This removes the iFrame, but not the script,
allowing you to open() it up again if you need to.
Closing the Checkout UI
1
payex.hostedView.checkout().close();
Cancel
Used to cancel the payment. Equivalent to pressing the cancel link in
Redirect mode.
Canceling the payment with the client script
1
payex.hostedView.checkout().cancel();
Resume
Allows you to resume the payment flow in cases where you have subscribed to the
onPaymentButtonPressed function. If you do, you HAVE to send the resume
function to be able to finish the payment flow.
If you do not run the function with valid input before 2 minutes has passed,
resume will be called automatically with the confirmation value of false.
Resuming the payment with a onPaymentButtonPressed flow
1
2
3
4
payex.hostedView.checkout().resume({
paymentOrderId: "string",
confirmation: true
});