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

TWINT Component

Add TWINT to an existing Components integration.

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

Requirements

Select the server-side flow that your integration uses:

Import resources for v6

If you are using Web Components v6, import the Component that you need for TWINT:

import { AdyenCheckout, Twint } from '@adyen/adyen-web'

API reference

You do not need to send additional fields for TWINT. To see optional fields that you can send for all payment methods, choose the endpoint you integrated:

Component configuration

Step 1: Create a DOM element

Create a DOM element on your checkout page, placing it where you want the payment method form to be rendered:

 <div id="twint-container"></div>

Step 2: Create an instance of the Component

v6.0.0 or later

Create an instance of the Component, passing:

  • Your instance of AdyenCheckout.
const twint = new Twint(checkout).mount('#twint-container');

Use the create method of your AdyenCheckout instance, in this case checkout, to create the Component:

const twintComponent = checkout.create('twint').mount('#twint-container');

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.

Capture the payment

By default, TWINT payments are captured automatically. This means that the Capture Delay setting in your Customer Area is set to Immediate or 1–7 days.

In case Capture Delay is set to Manual, then you need to manually capture the payment. The authorization for TWINT payments expires after 7 days, so make sure you capture the payment before then.

Partial capture

TWINT supports partial capture, but not multiple partial captures. To partially capture a TWINT payment, specify in your  /payments/{paymentPspReference}/captures request:

  • modificationAmount: The amount that the shopper should pay.

The following example shows how to make a partial capture request:

Any unclaimed amount that is left over after partially capturing a payment is automatically cancelled.

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.