Skip to content

Adyen

Adyen provides three Express Button providers via Adyen's Drop-in and API-only integrations. All three require an Adyen clientKey obtained from the Adyen Customer Area under Developers → API credentials.

Constraint: Adyen:PayPalExpress and any native PayPal provider cannot be used on the same page. See Known Constraints — Adyen + Native PayPal Mutual Exclusion.

Adyen:PayPalExpress

Renders a PayPal Express button managed by the Adyen Drop-in component.

Options — AdyenPayPalExpressOptions

FieldTypeRequiredDefaultDescription
clientKeystringYesAdyen client key (e.g. 'test_...' or 'live_...')
totalAmountnumberYesAmount in minor units (e.g. 2500 = €25.00)
currencyCodestringYesISO 4217 currency code
countryCodestringNoISO 3166-1 alpha-2 country code
localestringNoIETF locale tag (e.g. 'en-US')
isExpressbooleanNotrueWhether this is an express-checkout flow
showPayButtonbooleanNoWhether the Adyen component renders its own pay button
userAction'continue' | 'pay'No'pay' shows "Pay Now", 'continue' shows "Continue"
intent'capture' | 'authorize'NoPayment intent
blockPayPalCreditButtonbooleanNoHide the PayPal Credit button variant
blockPayPalPayLaterButtonbooleanNoHide the PayPal Pay Later button variant

Example

html
<div id="adyen-paypal-container"></div>
js
{
  providerProtocolType: 'Adyen',
  paymentMethodType: 'PayPalExpress',
  container: '#adyen-paypal-container',
  options: {
    clientKey: 'test_YOUR_CLIENT_KEY',
    totalAmount: 2500,
    currencyCode: 'EUR',
    countryCode: 'DE',
    isExpress: true,
    intent: 'authorize',
    blockPayPalCreditButton: true,
  },
}

Adyen:GooglePay

Renders a Google Pay button managed by the Adyen Drop-in component.

Options — AdyenGooglePayOptions

FieldTypeRequiredDefaultDescription
clientKeystringYesAdyen client key
totalAmountnumberYesAmount in minor units
currencyCodestringYesISO 4217 currency code
countryCodestringNoISO 3166-1 alpha-2 country code
localestringNoIETF locale tag
isExpressbooleanNotrueExpress-checkout flow
callbackIntentsstring[]NoGoogle Pay callback intents
shippingAddressRequiredbooleanNoRequest shipping address
shippingOptionRequiredbooleanNoRequest shipping option
emailRequiredbooleanNoRequest email address
billingAddressRequiredbooleanNoRequest billing address
billingAddressParametersobjectNo{ format?: 'FULL' | 'MIN' }
gatewayMerchantIdstringNoAdyen merchant account ID used as Google Pay gateway merchant ID
merchantNamestringNoMerchant name in payment sheet
merchantIdstringNoGoogle Pay merchant ID
transactionInfoobjectNoGoogle Pay TransactionInfo object for line items

Example

html
<div id="adyen-googlepay-container"></div>
js
{
  providerProtocolType: 'Adyen',
  paymentMethodType: 'GooglePay',
  container: '#adyen-googlepay-container',
  options: {
    clientKey: 'test_YOUR_CLIENT_KEY',
    totalAmount: 1000,
    currencyCode: 'EUR',
    countryCode: 'DE',
    gatewayMerchantId: 'YOUR_ADYEN_MERCHANT_ACCOUNT',
    merchantName: 'My Shop',
    emailRequired: true,
  },
}

Adyen:ApplePay

Renders an Apple Pay button using the Adyen API-only integration with native ApplePaySession.

Requirement: HTTPS and Apple Pay domain validation are required. See Known Constraints — Apple Pay Requires HTTPS.

Your onClick callback must return checkoutData containing:

  • merchantValidationUrl — your backend endpoint that handles Apple Pay merchant session validation (either via Adyen or your own certificate).
  • returnUrl — your backend endpoint that receives the Base64-encoded Apple Pay token and calls Adyen's /payments API.

Options — AdyenApplePayOptions

FieldTypeRequiredDefaultDescription
totalAmountnumberYesAmount in minor units
currencyCodestringYesISO 4217 currency code
countryCodestringNo'DE'ISO 3166-1 alpha-2 country code
supportedNetworksstring[]No['amex','discover','masterCard','visa']Accepted card networks
requiredShippingContactFieldsstring[]NoApple Pay contact fields for shipping
requiredBillingContactFieldsstring[]NoApple Pay contact fields for billing
supportedCountriesstring[]NoISO 3166-1 alpha-2 codes valid for shipping

Example

html
<div id="adyen-applepay-container"></div>
js
{
  providerProtocolType: 'Adyen',
  paymentMethodType: 'ApplePay',
  container: '#adyen-applepay-container',
  style: { buttonstyle: 'black', type: 'buy' },
  options: {
    totalAmount: 1000,
    currencyCode: 'EUR',
    countryCode: 'DE',
    supportedNetworks: ['masterCard', 'visa'],
  },
}

Full Example — All Three Adyen Providers

js
import { ExpressButtons } from 'collana-pay-js';

const buttons = ExpressButtons({
  providers: [
    {
      providerProtocolType: 'Adyen',
      paymentMethodType: 'PayPalExpress',
      container: '#adyen-paypal-container',
      options: {
        clientKey: 'test_YOUR_CLIENT_KEY',
        totalAmount: 2500,
        currencyCode: 'EUR',
        isExpress: true,
      },
    },
    {
      providerProtocolType: 'Adyen',
      paymentMethodType: 'GooglePay',
      container: '#adyen-googlepay-container',
      options: {
        clientKey: 'test_YOUR_CLIENT_KEY',
        totalAmount: 2500,
        currencyCode: 'EUR',
        countryCode: 'DE',
        gatewayMerchantId: 'YOUR_ADYEN_MERCHANT_ACCOUNT',
      },
    },
    {
      providerProtocolType: 'Adyen',
      paymentMethodType: 'ApplePay',
      container: '#adyen-applepay-container',
      style: { buttonstyle: 'black', type: 'buy' },
      options: {
        totalAmount: 2500,
        currencyCode: 'EUR',
        countryCode: 'DE',
      },
    },
  ],

  onClick: async (identity, paymentMethodData) => {
    const res = await fetch('/api/orders', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ provider: identity, paymentMethodData }),
    });
    const order = await res.json();
    return {
      orderId: order.id,
      checkoutData: {
        id: order.checkoutId,
        resultCode: order.resultCode,
        returnUrl: order.returnUrl,
      },
    };
  },

  onApprove: (data) => {
    window.location.href = data.returnUrl ?? `/order/success?id=${data.orderId}`;
  },

  onCancel: (identity) => {
    console.log('Adyen payment cancelled', identity);
  },

  onError: (error) => {
    console.error('Adyen error', error);
  },
});

buttons.render();

CollanaPay SDK Documentation