Adyen API library for Dart
A type-safe Dart library for Adyen's payment APIs, generated from official OpenAPI specifications.
Pure Dart HTTP client - no native dependencies. Unlike wrapping Java/Swift SDKs via MethodChannel, this library works across Flutter, web, server-side, and CLI without native platform bridging. Note: Terminal Local API is not available on web due to browser security model's limitation.
Why This Over Native SDKs?
| This Library | MethodChannel + Native SDKs | |
|---|---|---|
| Platform Support | Flutter, web, server, CLI | Mobile only |
| Native Dependencies | None | Java/Swift SDKs |
| Bundle Size | Tree-shaken, only what you use | Full SDK bundled |
| Bridge Overhead | None | MethodChannel calls |
| Debugging | Pure Dart stack traces | Platform-specific debugging |
| Maintenance | Single codebase | Multi-language maintenance |
Features
- Pure Dart - No MethodChannel, FFI, or native code. Works on Flutter, web, server, and CLI.
- Comprehensive API Coverage - Checkout, Payments, Terminal, Balance Platform, and more
- Webhook Support - Complete handlers for all Adyen webhooks
- Tested - Comprehensive test suite with mocking support
Installation
dependencies:
adyen_api: ^0.1.0
dart pub get
Quick Start
import 'package:adyen_api/adyen_api.dart';
import 'package:adyen_api/checkout_models.dart' as checkout;
void main() async {
// Configure client
final config = Config(
apiKey: 'your-api-key',
environment: EnvironmentEnum.test,
);
final client = Client(config);
final checkoutApi = CheckoutAPI(client);
// Create payment
final paymentRequest = checkout.PaymentRequest(
(b) => b
..amount.currency = 'USD'
..amount.value = 1000
..merchantAccount = 'your-merchant-account'
..reference = 'ORDER-1001'
..returnUrl = 'https://your-company.example/checkout/return',
);
final response = await checkoutApi.unwrap(
checkoutApi.paymentsApi.postPayments(paymentRequest: paymentRequest),
);
print('Result: ${response?.resultCode}');
}
Supported APIs
Checkout & Payments
- Checkout API, Payment API, Recurring API, Payout API
Terminal
- Terminal Local API, Terminal Cloud API, Terminal Management API
Balance Platform
- Balance Control API, Balance Platform API
Other Services
- BinLookup, Disputes, Data Protection, Legal Entity, Open Banking,
- Stored Value, Transfers, Platforms, POS Mobile, Payments App, Session Authentication
Webhooks
Complete support for all Adyen webhook types including transaction, balance, configuration, dispute, tokenization, transfer, and more.
Documentation
See the example/ directory for complete examples:
- Basic checkout payment
- Terminal management with NEXO encryption
Support
- π Adyen Documentation
- π Issue Tracker
- π¬ Discussions
License
MIT License - see LICENSE for details.
Acknowledgments
Generated from Adyen OpenAPI specifications using openapi-generator.
Libraries
- adyen_api
- balance_control_models
- balance_platform_models
- binlookup_models
- checkout_models
- data_protection_models
- disputes_models
- legal_entity_models
- management_models
- open_banking_models
- payment_models
- payments_app_models
- payout_models
- platforms_account_models
- platforms_fund_models
- platforms_hop_models
- platforms_notification_configuration_models
- pos_mobile_models
- recurring_models
- session_authentication_models
- stored_value_models
- terminal_api_models
- terminal_management_models
- terminal_models
- transfers_models
- webhook_acs_models
- webhook_balance_models
- webhook_configuration_models
- webhook_dispute_models
- webhook_management_models
- webhook_negative_balance_models
- webhook_notification_models
- webhook_platforms_notifications_models
- webhook_report_models
- webhook_tokenization_models
- webhook_transaction_models
- webhook_transfer_models