This page explains how to add Trustly to your existing iOS Components integration.
Requirements
Requirement | Description |
---|---|
Integration type | Make sure that you have an existing iOS Components integration. |
Setup steps | Before you begin, add Trustly in your test Customer Area. |
API reference
You do not need to send additional fields for Trustly. To see optional fields that you can send for all payment methods, choose the endpoint you integrated:
- /sessions: This is the default with Components v5.0.0 or later.
- /payments: If you implemented an additional use case.
Component configuration
v5.0.0 or later
If your integration uses iOS Components v5.0.0 or later, configure and create an instance of the Trustly Component:
v4.x.x
If your integration uses an earlier version of iOS Components:
There are no configuration steps specific to Trustly required for Components.
Recurring payments
Recurring payments using Trustly can only be processed in Sweden and requires additional configuration. Contact Support Team team to enable this.
We support recurring transactions for Trustly. To make recurring payments, you need to:
Create a token
To create a token, include in your /payments request:
storePaymentMethod
: true- shopperReference: Your unique identifier for the shopper.
- shopperEmail: The shopper's email address.
When the payment has been settled, you receive a webhook containing:
eventCode
: RECURRING_CONTRACToriginalReference
: ThepspReference
of the initial payment.pspReference
: This is the token that you need to make recurring payments for this shopper.
Make sure that your server is able to receive RECURRING_CONTRACT as part of your standard webhooks. You can enable the RECURRING_CONTRACT event code in the webhook settings page.
Make a payment with a token
To make a payment with the token, include in your /payments request:
-
paymentMethod.storedPaymentMethodId
: ThepspReference
from the RECURRING_CONTRACT.You can also get this value using the /listRecurringDetails endpoint.
-
shopperReference
: The unique shopper identifier that you specified when creating the token. -
shopperInteraction
: ContAuth. -
recurringProcessingModel
: Subscription or UnscheduledCardOnFile.
For more information about the shopperInteraction
and recurringProcessingModel
fields, refer to Tokenization.
Test and go live
Trustly provides a simulated bank environment to complete your testing end to end. Follow the instructions provided in their documentation. You can check the status of Trustly test payments in your Customer Area > Transactions > Payments.
Before you can accept live Trustly payments, you need to submit a request for Trustly in your live Customer Area.