No momento, esta página não está disponível em português
Payment-method icon

TWINT Redirect Component

Add TWINT to your existing iOS Components integration.

This page explains how to add TWINT to your existing Components integration.

The focus of this page is on describing how to use the TwintComponent of the native Twint SDK to enable Twint payments on Components.

Requirements

Requirement Description
Integration type Make sure that you have built your Components integration.
Setup steps Before you begin, add TWINT in your test Customer Area.

How it works

  1. When a shopper on your app clicks the button to pay with Twint, TwintComponent makes a /payments request which contains subtype: sdk. The ActionComponent is triggered, which determines the transaction flow.

  2. The shopper is redirected to the Twint app on their device (or an error is displayed if a Twint app is not installed).

  3. After the payment is processed, Twint app will return back to your app using the redirectURL, contained in the payment result.

  4. If the payment is successful a /payments/details request is made that contains paymentData, otherwise an error is shown.

Component configuration

Add the following configuration:

  • Configure the actionComponent with a returnUrl scheme.

  • Set your AdyenSession instance as the delegate to let it handle the flow.

Recurring payments

To make recurring payments for TWINT, you need to:

  1. Create a shopper token.
  2. Use the token to make future payments for the shopper.

Create a token

To create a token, include in your /payments request:

  • storePaymentMethod: true
  • shopperReference: Your unique identifier for the shopper (minimum length three characters).

When the payment details have been stored, you receive a webhook containing:

  • eventCode: RECURRING_CONTRACT
  • originalReference: The pspReference of the initial payment.
  • pspReference: This is the token 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. If you have not requested this additional configuration yet, contact our Support Team.

Make a payment with a token

To make a payment with the token, include in your /payments request:

  • paymentMethod.storedPaymentMethodId: The pspReference from the RECURRING_CONTRACT webhook.

    You can also get this value using the /listRecurringDetails endpoint.

  • shopperReference: The unique shopper identifier that you specified when creating the token (minimum length three characters).

  • shopperInteraction: ContAuth.

  • recurringProcessingModel: Subscription or UnscheduledCardOnFile.

For more information about the shopperInteraction and recurringProcessingModel fields, refer to Tokenization.

Recurring payments only work when the amount is equal to zero.

Test and go live

Check the status of TWINT test payments in your Customer Area > Transactions > Payments.

Before you can accept live TWINT payments, you need to submit a request for TWINT in your live Customer Area.

See also