Redirect URLs

When a user completes or cancels the Trustly UI workflow, the SDK will redirect to the return or cancelUrl ,respectively. Several pieces of information will be provided to the redirect URL by query parameters. This information may be used to call Trustly APIs or prompt the user to select another method of payment.

Receiving the Redirect

Trustly will return the User to your cancelUrl or returnUrl via a GET request, appending a number of fields to the provided URL. You can then pass this data to your backend for further processing.

🚧

Security Considerations

To prevent tampering of the redirect URL when handling the redirect make sure that:

  • The merchantReference sent on the Establish Data is unique and associated with the end-user session
  • The merchantReference on the return URL is the same as the merchantReference sent on the EstablishData for this user session
  • Ensure you check the validity of the request by verifying the Redirect Signature in your back end before you process it or by calling the Get Transaction API and checking if the values returned are the same as the parameters sent on the redirect URL.

Example Redirect Request

https://merchant.com/Trustly/return?transactionId=1002633191&transactionType=1&merchantReference=123123&status=2&payment.paymentType=2&payment.paymentProvider.type=1&payment.account.verified=false&panel=1&requestSignature=b7yr%2F3qOupPa1B7VeI32PhGQ7C8%3D

Parameters

ParameterDefinition
transactionIdA unique Trustly transaction identifier. (15 characters)
transactionTypeSee Transaction Types for a complete list of values and their definitions.
merchantReferenceA specific merchant reference for this cancelation. For example, this could be your order number or session id.
statusSee Transaction Status Values for a complete list of values and their definitions.
payment.paymentTypeSee Payment Types for a complete list of values and their definitions.
payment.paymentProvider.typeSee Payment Provider Types
payment.account.verified...
panelInteger value representing the Trustly screen the user exited the flow on. Refer to Panel Values for a complete list of values and their definitions.
payment.paymentProviderTransaction.statusInteger value representing the Payment Provider Transaction Status of the transaction. Refer to Payment Provider Transaction Status for a complete list of values and their definitions.
requestSignatureThis is a signature that you can calculate to ensure the request you receive is coming from Trustly. See Verifying the Redirect Request for more information.