Last updated

State

The Trustap API uses state in creating full Trustap users and in the payment screen.

The state parameter in the Trustap API serves two main purposes.

  1. It protects against CSRF.
  2. It allows you to pass contextual information like a shopping cart ID or buyer details.

Payment continuation using state

The Trustap payment screen supports payment continuation. To reduce additional friction, you can choose to pre-populate your buyer`s details in the payment screen.

The Base64 encoded string is passed in the URL that you send your buyer using the state parameter. The string is delimited using the colon character :. The format of the string is parameter 1=value 1:parameter 2=value 2:parameter 3=value 3.

https://actions.stage.trustap.com/online/transactions/25273/guest_pay?redirect_uri=https://www.example.com&state=bmFtZT1EYXZleSBKb25lczpsaW5lMT1NYXJrZXQgU3RyZWV0OmxpbmUyPURvd250b3duOmNpdHk9Qm9zdG9uOnN0YXRlPU1BOnBvc3Rjb2RlPURZMTAgNUZTOmNvdW50cnk9VVM=

You can use additional unspecified parameters for your own purposes that will be ignored by payment continuation. For example, token=678fe24e01dbe4a798eeb85de6a31940:.

Supported parameters

ParameterDescription
nameBuyer's name. Should contain first and surname
line1Address line 1 (e.g., street, PO Box, or company name)
line2Address line 2 (e.g., apartment, suite, unit, or building)
cityCity, district, suburb, town, or village
stateState, county, province, or region
postcodeZIP or postal code.
countryTwo-letter country code (ISO 3166-1 alpha-2)

Preview payment continuation using state

Use the following example to test how the payment form looks with pre-filled buyer information. Edit the State string to see the sample payment form pre-populated.

Billing details

By submitting my payment, I agree to Trustap's Terms of Service, and acknowledge the Buyer Protection level applied to this order.