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

TWINT Android Component

Add TWINT to an existing Components integration.

If you are using Android Components v5.0.0 or later:

This payment method requires no additional configuration.

Follow the Android Components integration guide and use the following module and Component names:

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

Requirements

Requirement Description
Integration type Make sure that you have built your Android 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

Follow the Android Components integration guide and use the following module and Component names:

  • To import the module: twint
  • To launch and show the Component: TwintComponent

Additional configuration for TwintComponent:

setActionHandlingMethod enables you to choose the native or redirect flow:

  • PREFER_NATIVE is the default.
  • PREFER_WEB triggers the redirect flow. In this case, set up the redirect 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

Recurring payments can be made with Sessions or Advanced flow.

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