Online Payments

Seamless View Functions

Possible functions to be used with Seamless View payments

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"
});
Field
Type
container string
Required: The ID of the DOM element you want to embed the Payment UI inside of.
culture string
Locale identifier string for the language the Payment UI should launch with. Examples includes: sv-SE, nb-NO and en-US
style object
Key/Value object with the details of the colors and borders you want for the various components of the payment button.
theme string
Used to define which style set the Payment UI should use.
integration string
Specify the integration used for the UI. Values include `HostedView`, `Redirect` and `App`.

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"
});
Field
Type
culture string
Locale identifier string for the language the Payment UI should launch with.
style object
Key/Value object with the details of the colors and borders you want for the various components of the payment button.
theme string
Deprecated: Used to define which style set the Payment UI should use.

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
});
Field
Type
paymentOrderId string
The PaymentOrderId of the purchase you want to resume.
confirmation object
Boolean value that determines if the payment should continue or if you want to stop the payment flow due to validation issues or otherwise.
Mermaid-diagram