Introduction: What is Adyen and Why It Matters
Adyen is a global payment platform that enables businesses to accept e-commerce, mobile, and point-of-sale payments. As an all-in-one payment solution, Adyen:
- Processes payments across online, mobile, and in-store channels
- Supports 250+ payment methods and 150+ currencies globally
- Offers built-in risk management and authentication
- Provides unified commerce capabilities with a single platform
- Delivers data-driven insights through its analytics dashboard
This unified approach eliminates the need for multiple payment providers, simplifies reconciliation, and offers valuable customer insights through a single integration.
Core Concepts of Adyen Payments
Key Components of the Adyen Platform
Component | Description | Purpose |
---|
Payment Processing | Core service handling payment transactions | Process payments securely and efficiently |
Risk Management | Fraud prevention tools | Minimize fraud while maximizing conversions |
Account Insights | Analytics and reporting tools | Provide business intelligence and optimization data |
RevenueAccelerate | Revenue optimization suite | Increase authorization rates and boost revenue |
RevenueProtect | Fraud prevention suite | Balance fraud defense and customer experience |
Customer Area | Management dashboard | Configure settings and analyze performance |
Payment Flow Overview
- Shopper Checkout: Customer selects products and proceeds to checkout
- Payment Method Selection: Customer chooses payment method
- Payment Details Submission: Customer enters payment details
- Payment Processing: Adyen processes the transaction
- Authorization: Payment is authorized or declined
- Notification: Merchant receives payment status notification
- Capture: Funds are captured (automatically or manually)
- Settlement: Funds are transferred to merchant account
Payment Statuses
- Authorised: Payment has been approved and funds reserved
- Refused: Payment was declined or failed
- Cancelled: Payment was cancelled before processing
- Pending: Payment is being processed
- Received: Payment has been received but not yet settled
- SentForSettle: Payment has been sent for settlement
- Settled: Funds have been transferred to merchant account
- Error: An error occurred during processing
- ChargeBacked: Payment has been charged back by the customer
Step-by-Step Integration Process
1. Account Setup
- Create an Adyen account at dashboard.adyen.com
- Complete the onboarding process
- Set up your legal entity and business details
- Configure your processing currencies
- Set up notification webhooks
2. Choose Integration Method
Integration Method | Use Case | Complexity | Control |
---|
Drop-in | Quick implementation with minimal customization | Low | Limited |
Components | Customizable UI with maintained PCI compliance | Medium | High |
API-only | Full control, requires PCI compliance | High | Complete |
Checkout API | Server-side integration with multiple use cases | Medium-High | High |
3. Implement Server-Side Integration
// Example: Creating a payment session with Node.js
const { Client, Config } = require('@adyen/api-library');
const config = new Config();
config.apiKey = 'YOUR_API_KEY';
config.merchantAccount = 'YOUR_MERCHANT_ACCOUNT';
const client = new Client({ config });
const checkout = new checkout(client);
async function createPaymentSession(amount, currency, reference) {
try {
const response = await checkout.sessions({
amount: { currency, value: amount },
reference,
returnUrl: 'https://your-company.com/checkout/result',
merchantAccount: config.merchantAccount,
});
return response;
} catch (error) {
console.error(error);
}
}
4. Implement Client-Side Integration
// Example: Drop-in integration with JavaScript
const configuration = {
environment: 'test', // Change to 'live' for production
clientKey: 'YOUR_CLIENT_KEY',
paymentMethodsResponse: paymentMethodsResponse, // From your server
locale: 'en-US',
showPayButton: true,
onSubmit: (state, dropin) => {
makePayment(state.data);
},
onAdditionalDetails: (state, dropin) => {
submitAdditionalDetails(state.data);
}
};
const checkout = new AdyenCheckout(configuration);
const dropin = checkout.create('dropin').mount('#dropin-container');
5. Set Up Webhooks
// Example: Handling webhook notifications with Express
app.post('/api/webhooks/notifications', (req, res) => {
const notification = req.body;
// Process notification
if (notification.notificationItems) {
notification.notificationItems.forEach(item => {
const notificationItem = item.NotificationRequestItem;
if (notificationItem.eventCode === 'AUTHORISATION') {
if (notificationItem.success === 'true') {
// Payment was authorized
updateOrderStatus(notificationItem.merchantReference, 'PAID');
} else {
// Payment failed
updateOrderStatus(notificationItem.merchantReference, 'FAILED');
}
}
});
}
res.status(200).send('[accepted]');
});
6. Test the Integration
- Use test cards and payment methods
- Test success and failure scenarios
- Test refunds and cancellations
- Test different payment methods
- Validate webhook handling
7. Go Live
- Switch from test to live environment
- Update API keys and credentials
- Perform end-to-end testing in production
- Monitor transactions and performance
Payment Methods by Region
Europe
- Cards: Visa, Mastercard, American Express, Diners Club
- Bank Transfers: SEPA Direct Debit, iDEAL (Netherlands), Sofort (Germany)
- Digital Wallets: PayPal, Apple Pay, Google Pay
- Buy Now Pay Later: Klarna, Afterpay, Clearpay
North America
- Cards: Visa, Mastercard, American Express, Discover
- Digital Wallets: PayPal, Apple Pay, Google Pay, Venmo
- ACH: Direct Debit, ACH Credit Transfer
- Buy Now Pay Later: Affirm, Klarna
Asia-Pacific
- Cards: Visa, Mastercard, JCB, UnionPay
- Digital Wallets: Alipay, WeChat Pay, GrabPay
- Bank Transfers: BACS, FPX (Malaysia), NEFT/IMPS (India)
- Local Methods: PayNow (Singapore), Boleto (Brazil), QIWI (Russia)
API Endpoints Reference
Payment API
Endpoint | HTTP Method | Description |
---|
/payments | POST | Process a payment |
/payments/details | POST | Submit additional details |
/payments/{paymentPspReference}/captures | POST | Capture a payment |
/payments/{paymentPspReference}/cancels | POST | Cancel a payment |
/payments/{paymentPspReference}/refunds | POST | Refund a payment |
Account API
Endpoint | HTTP Method | Description |
---|
/me | GET | Get account information |
/me/allowedOrigins | GET | Get allowed origins |
/merchants/{merchantId} | GET | Get merchant details |
Checkout API
Endpoint | HTTP Method | Description |
---|
/sessions | POST | Create a payment session |
/paymentMethods | POST | Get available payment methods |
/orders | POST | Create pre-payment order |
/orders/{orderReference}/payments | POST | Pay for an order |
Common Challenges and Solutions
Challenge | Solution |
---|
Payment Declined | Check for sufficient funds, validate card details, ensure supported payment method |
3D Secure Failures | Properly handle redirects, implement 3DS2 for better UX, test with specific test cards |
Webhook Issues | Verify correct webhook URL, check server connectivity, validate HMAC signatures |
Integration Errors | Review API responses for error codes, check documentation, test in sandbox environment |
Currency Mismatches | Ensure currency codes match ISO standards, verify supported currencies for payment methods |
Authorization/Authentication | Verify API keys, check IP restrictions, validate client credentials |
Best Practices and Tips
Security
- Never store card data directly
- Implement proper PCI DSS compliance measures
- Use HTTPS for all communications
- Validate webhook signatures using HMAC
- Implement proper error handling and logging
- Use tokenization for recurring payments
Performance
- Implement client-side validation before submission
- Optimize API calls to reduce latency
- Use asynchronous processing for webhooks
- Cache payment methods where appropriate
- Monitor response times and transaction success rates
User Experience
- Show clear error messages for declined payments
- Display localized payment methods based on shopper country
- Optimize mobile checkout experience
- Minimize redirects where possible
- Save and offer previously used payment methods
- Support one-click payments for returning customers
Testing
Test Card Number | Brand | Scenario |
---|
4111 1111 1111 1111 | Visa | Successful payment |
4917 6100 0000 0000 | Visa | Successful 3D Secure payment |
5454 5454 5454 5454 | Mastercard | Successful payment |
5212 3456 7890 1234 | Mastercard | Referred (hold) |
3714 4963 5398 431 | American Express | Declined payment |
Advanced Features
Recurring Payments
// Example: Creating a recurring payment
const recurringPayment = {
amount: { currency: "EUR", value: 1000 },
reference: "YOUR_PAYMENT_REFERENCE",
merchantAccount: "YOUR_MERCHANT_ACCOUNT",
shopperReference: "YOUR_UNIQUE_SHOPPER_ID",
recurring: {
contract: "RECURRING"
},
shopperInteraction: "ContAuth",
selectedRecurringDetailReference: "LATEST"
};
Dynamic 3D Secure
// Example: Configuring Dynamic 3D Secure
const paymentRequest = {
amount: { currency: "EUR", value: 1000 },
reference: "YOUR_PAYMENT_REFERENCE",
merchantAccount: "YOUR_MERCHANT_ACCOUNT",
additionalData: {
"executeThreeD": "true",
"scaExemption": "lowValue"
},
threeDS2RequestData: {
deviceChannel: "browser",
threeDSRequestorChallengeInd: "01"
}
};
Multi-Currency Processing
// Example: Processing a payment in a different currency
const paymentRequest = {
amount: {
currency: "JPY", // Transaction currency
value: 10000
},
reference: "YOUR_PAYMENT_REFERENCE",
merchantAccount: "YOUR_MERCHANT_ACCOUNT",
additionalData: {
processingCurrency: "USD" // Settlement currency
}
};
Resources for Further Learning
Official Documentation
API Libraries
Testing Tools
Community and Support
Remember: This cheatsheet provides a general overview of Adyen integration. Always refer to the official Adyen documentation for the most up-to-date information, as payment processing features and requirements change frequently.