Presenting Checkout via SDK

We strongly recommend integrating our SDKs and use the SDK methods to present the Trustly Checkout.

The following sequence diagram describes the order initiation and presentation of the Checkout through the SDK when the consumer application has opt-in to receiving callback events and providing custom handlers.

Should your application not opt-in to providing custom handlers, the SDK provides sensible defaults.

📘

Please note that the redirect to a third party can happen more than once, depending on the bank integration type.

In this case, we will use the ReturnToAppURL parameter to return the user back to your application so that she can continue with the next steps of the checkout. During this, the checkout webview component needs to be alive and on top of the navigation stack, without being re-created.

Handling redirect callbacks

When the SDK invokes the redirect callback, it means that the user needs to be redirected to a third party entity usually for purposes of digital identification and/or authorisation. In a mobile application, redirects and launching of third party applications needs to be handled by the native layer.

The SDKs provide a default implementation for handling redirects. But if you decide to provide custom handlers for the SDK callbacks, you will need to handle redirects yourself.

There are two different ways of redirecting to a third party application and it’s worth describing them in detail, because the order mechanics differ.

1. Outward redirect via ReturnToAppURL

Some bank integrations require launching of a third party application through a urlscheme.

When handling redirect requests for launching third party applications through urlschemes, it’s important to follow our developer guidelines and best practices to prevent the system from blocking the launch request. More information can be found under the Integration documentation for each platform.

2. Outward redirect via Universal/Application links

Some banking integrations require launching of a third party application through universal/application links.

📘

Universal links (Apple ecosystem) and Application links (Android ecosystem) are a special type of https:// URLs offering a two-way association between a web site and a native application.

The user experience will differ depending on whether the user has the third party application installed or if they’ll need to be redirected to the corresponding third party website.

Please note that in both cases, the user will be briefly redirected to the standalone browser from where she will be automatically redirected back your native application via the ReturnToAppURL parameter.

Fallback options - redirect to stand alone browser

If implementing the SDK is not an option, prefer doing a fallback implementation for presenting the checkout.
When redirecting the user to a standalone browser, the Trustly checkout will be loaded in a stand-alone browser.

In this case, you can pass a deep link to your application via the SuccessURL/FailURL order parameters. We will use these parameters to navigate the user back to your application once the order is completed.

📘

If redirecting the user to stand-alone browser, ReturnToAppURL parameter must not be passed in the order initiation.