Открыта бета 1С:ПредприятияОставить заявку
P

Payment adyen

Adyen payment provider for Medusa

Входит в @medusajs/medusa, ставить отдельно не нужно
Категория
Создано
Версия
2.22.4
Последнее обновление
7 часов назад
Ежемесячные загрузки
Загрузка данных

Medusa logo

@medusajs/payment-adyen

Documentation | Website

Building blocks for digital commerce

Medusa is released under the MIT license. PRs welcome! Discord Chat Follow @medusajs

Adyen Payment Module Provider for Medusa: processes card payments, including 3D Secure, with Adyen's Checkout API (Advanced flow). Use it with Adyen's Drop-in or Components in your storefront. It ships with and is registered through the path.

At a glance

Package
TypeModule Provider (Payment Module)
Provider ID, for example
Registered by defaultNo
Import from

Installation

No installation needed. The provider is a dependency of .

Usage

Register the provider in the Payment Module's array in :

Then enable the provider in a region, for example from the Medusa Admin.

In the Adyen Customer Area, create a standard webhook pointing to , where is the registered ID without the prefix, such as . Generate its HMAC key and set it as .

Storefront flow

  1. Initialize a payment session with the provider. The session's holds the response of Adyen's , which you pass to Drop-in.
  2. In Drop-in's , pass and to the session with , as and . Optionally pass and .
  3. Complete the cart. If the session's status is , pass its to Drop-in.
  4. In Drop-in's , pass as , then complete the cart again.

If a payment is refused, the session's status is . Pass a new to the same session to retry.

Saved cards

For logged-in customers, the customer's account holder ID is sent to Adyen as the :

  • lists the customer's saved cards, which Drop-in shows. Paying with one works like any other payment method.
  • To save the card used in a payment, pass Drop-in's as . Enable Drop-in's option to show the checkbox.
  • The Payment Module's , , and methods list, save, and delete the customer's saved cards. Saving a card without a payment takes Drop-in's , including a , as , and requires the "API tokenise payment details" role on your API credential.
  • Deleting the account holder deletes the customer's saved cards.

Off-session payments

Your backend can charge a saved card without the shopper present, for example to pay for an order once it's approved. Create the payment session with the customer's account holder in its context and , then authorize it. To save a card for this, pass in ' .

Off-session payments skip the shopper's authentication, such as 3D Secure. As with the Stripe provider, storefronts can also pass these fields in a payment session's , which lets logged-in customers charge their own saved cards this way. Adyen rejects cards saved for another shopper.

Limitations

  • Only cards (including 3D Secure), Apple Pay, and Google Pay are supported, so Drop-in only shows these even if other payment methods are enabled on your merchant account. Payment methods that redirect the shopper or are confirmed asynchronously by webhook, such as iDEAL, PayPal, or bank transfers, aren't supported yet.
  • Captures, refunds, and cancellations are recorded in Medusa when they're requested. Adyen confirms them asynchronously, and failures (for example, a refund rejected for insufficient funds) are only logged.
  • Medusa doesn't pass capture amounts to providers, so the first capture captures the full authorized amount.
  • Captures and refunds made in the Adyen Customer Area aren't synced to Medusa.

Configuration

OptionTypeDescriptionDefault
Required. The API key of your Adyen API credential.-
Required. The merchant account to process payments with.-
The HMAC key of the standard webhook. Webhooks are rejected without it.-
The Adyen environment.
Required in . Find it in the Customer Area under Developers > API URLs.-
Capture payments immediately instead of only authorizing them.
The URL to return shoppers to after a redirect, unless the storefront passes .-

Resources