Create a redirect URL
When using Token.io's Hosted Pages (HP) v2 redirect integration, you'll need to create a redirect URL to redirect the user to Token.io's HP. The following information provides instructions on how to do this.
Payments v2
Create the redirect URL by appending the payment.id in the response to the redirect base URL, then send it to the user to request explicit consent for the payment.
https://{{BASE_URL}}/session/{{Insert payment.id here}}
// examples =
https://app.sandbox.token.io/session/pm:3RKfCA7KQEEZERLoFsAt3MoAnoP5:5zKtXEAq
https://app.token.io/session/pm:3RKfCA7KQEEZERLoFsAt3MoAnoP5:5zKtXEAq
Payments v1
Create the redirect URL by appending the request-id in the response to the redirect base URL, then send it to the user to request explicit consent for the payment.
https://{{BASE_URL}}/session/{{Insert request-id here}}
// examples =
https://app.sandbox.token.io/session/rq:3RKfCA7KQEEZERLoFsAt3MoAnoP5:5zKtXEAq
https://app.token.io/session/rq:3RKfCA7KQEEZERLoFsAt3MoAnoP5:5zKtXEAq
Support for query parameters
A number of query parameters are supported in the Hosted Pages redirect URL. These include parameters that improve the UX by eliminating unnecessary or extraneous user selection, as well as authentication and session parameters using direct references to existing and/or stored
All queries are prepended by a question mark ('?').
Localization parameters
Supported query parameters for localization currently comprise language (lang) and country (country).
You can specify a particular language by passing its alpha-2 language code (lang=country-code) as a query parameter appended to the redirect URL.
Here are examples for passing the desired ISO 639-1 language code for German (de).
https://app.token.io/session/pm:3RKfCA7KQEEZERLoFsAt3MoAnoP5:5zKtXEAq
https://app.token.io/session/rq:o9adbFqJXcaDGNDaykPvpSZFZDW:5zKtXEAq
Users can override the language preselect in the HP by clicking the language button in the top-right.
Similarly, to specify a desired country, append an ISO alpha-2 country code to the URL using the country parameter (country=country-code).
Here are examples for passing the desired ISO alpha-2 country code for Austria (at).
https://app.token.io/session/pm:3RKfCA7KQEEZERLoFsAt3MoAnoP5:5zKtXEAq
https://app.token.io/session/rq:o9adbFqJXcaDGNDaykPvpSZFZDW:5zKtXEAq
Concatenation
You can concatenate multiple query parameters for the same URL by separating them with an ampersand ('&'). For example:
https://app.token.io/session/pm:3RKfCA7KQEEZERLoFsAt3MoAnoP5:5zKtXEAq
https://app.token.io/session/rq:o9adbFqJXcaDGNDaykPvpSZFZDW:5zKtXEAq