Global Options

This guide is for the JavaScript integration of Smart Checkout. If you feel not confident with it, or before you start a new integration, please get in touch with our friendly help desk:Link

You can set all global options using secupayCheckout.setOptions(options).

The only mandatory option is the contract ID of the merchant. Further you can set:

  • demo mode for test orders;

  • URLs to direct the customer back to the shop after successful checkout;

  • the language the Checkout Wizard shall show on start;

  • the view mode of the Checkout Wizard.

A complete example:

JavaScript
secupayCheckout.setOptions({
contractId: "GCR_2H69XY35227V2VKP9WRA3SJ0W95RP0",
isDemo: true,
purpose: "123",
intent: "order",
merchantUrls: {
url_success: "https://shop.example.org/survey",
url_error: "https://shop.example.org/basket?msg=HELPLINE",
url_abort: "https://shop.example.org/basket?msg=VOUCHER"
},
lang: "de",
urlParams: {
viewMode: "fullscreen",
initPaymentMethod: "Debit"
}
});

Detailed description of the object attributes:

Attribute

Type

Description

contractId

string

Contract ID of the merchant

Note: Please do not forget to replace the contract ID in the above example with your real contract ID, assigned during the onboarding process.

intent

string

A Smart Transaction can have one of two basic operating modes, called intent:

  • order for purchase orders;

  • sale for payment without assuming a contract type.

An order requires an agreement about shipping or collection. The button for the conclosure has a different label (Buy Now! instead of Pay Now!). Incoming orders are found in SecuOffice under Orders » Completed.

Payments can be used for donation, crowd funding, or reservation fees, to name a few examples.

isDemo

boolean

Optional flag to designate demo or test orders:

  • true for demo/test orders;

  • false for real orders.

If the flag is not present, it defaults to false for a real order.

The payment for demo/test orders is not processed. Demo orders cannot be changed into productive ones, but productive ones can be cancelled.

Demo transactions are also marked in SecuOffice.

Note: Please do not forget to switch this flag properly.

purpose

string

Optional line of text. It is the purpose that appears on the bank statements of the customer, and on the advice note of the merchant. This works only with intent sale and authorization, but is likely to be changed.

merchantUrls/url_success

string

Optional http: or https: URL to direct the user back to the shop after the order was placed successfully. It may have up to 2000 characters.

If not present, the static succuess URL is used, that was defined in SecuOffice. If there is no success URL at all, there is no back link or close botton after final confirmation.

merchantUrls/url_error

string

Optional http: or https: URL to direct the user back to the shop after the user stopped the checkout explicitly, or in case of a technical problem. It may have up to 2000 characters.

If not present, the static failure URL is used, that was defined in SecuOffice. If there is no failure URL at all, there is no back link.

merchantUrls/url_abort

string

Optional http: or https: URL to direct the user back to the shop after the user stopped the checkout explicitly. It defines the failure URL for this special case. It may have up to 2000 characters.

If not present, the static abort URL is used, that was defined in SecuOffice. If this is also not present, it falls back to the failure URL. If there is no effective abort URL at all, there is no close button before final confirmation.

lang

string

Optional. Initial language of the Checkout Wizard:

  • "de" to start in German;

  • "en" to start in English.

If this setting is not present, it defaults to German.

urlParams/viewMode

string

Optional switch from layer to fullscreen mode:

  • "layer" starts the Checkout Wizard in a modal layer above the shop;

  • "fullscreen" starts the Checkout Wizard fullscreen, replacing the shop.

Note: In some browsers it is not possible to start the Checkout Wizard in a modal layer due to restrictive implementations of Cross-Origin Ressource Sharing (CORS). Also some particular workflows can force the browser to switch to fullscreen mode, and replace to shop page. So we recommend you to test your integration, whether it would work in fullscreen mode too.

If this setting is not present, it defaults to the modal layer.

urlParams/initPaymentMethod

string

Optional payment method for sale or authorization:

  • Debit for SEPA direct debit;

  • Creditcard;

  • Invoice;

  • Prepaid for advance payment.

If you don't pass a payment method, the customer can choose of all available payment methods.