Payment adyen
Adyen payment provider for Medusa
@medusajs/payment-adyen
Documentation | Website
Building blocks for digital commerce
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 | |
| Type | Module Provider (Payment Module) |
| Provider ID | , for example |
| Registered by default | No |
| 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
- Initialize a payment session with the provider. The session's holds the response of Adyen's , which you pass to Drop-in.
- In Drop-in's , pass and to the session with , as and . Optionally pass and .
- Complete the cart. If the session's status is , pass its to Drop-in.
- 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
| Option | Type | Description | Default |
|---|---|---|---|
| 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 . | - |

