Adyen API Library for Ruby
This is the officially supported Ruby library for using Adyen's APIs.
Integration
The library supports all APIs under the following services:
- Checkout API: Our latest integration for accepting online payments. Current supported version: v68
- Payments API: Our classic integration for online payments. Current supported version: v64
- Recurring API: Endpoints for managing saved payment details. Current supported version: v49
- Payouts API: Endpoints for sending funds to your customers. Current supported version: v64
- Platforms APIs: Set of APIs when using Adyen for Platforms.
- Account API Current supported version: v6
- Fund API Current supported version: v6
- Notification Configuration API Current supported version: v6
- POS Terminal Management API: Current supported version: v1
- Adyen BinLookup API: Current supported version: v50
- Data Protection API: Current supported version: v1
- Disputes API: Current supported version: v50
For more information, refer to our documentation or the API Explorer.
Prerequisites
- Adyen test account
- API key. For testing, your API credential needs to have the API PCI Payments role.
- Ruby >= 2.1
Installation
The sole dependency is faraday for HTTP communication. Run the following command to install faraday if you don't already have it:
bundle install
To validate functionality of client and run mock API tests use
bundle install --with development
and
rspec
Documentation
Follow the rest of our guides from the documentation on how to use this library.
Using the library
General use with API key
require 'adyen-ruby-api-library'
adyen = Adyen::Client.new
adyen.api_key = 'AF5XXXXXXXXXXXXXXXXXXXX'
Make a Payment
response = adyen.checkout.payments({ :amount => { :currency => "EUR", :value => 1000 }, :reference => "Your order number", :paymentMethod => { :type => "scheme", :encryptedCardNumber => "test_4111111111111111", :encryptedExpiryMonth => "test_03", :encryptedExpiryYear => "test_2030", :encryptedSecurityCode => "test_737" }, :returnUrl => "https://your-company.com/checkout/", :merchantAccount => "YourMerchantAccount" })Change API Version
adyen.checkout.version = 68
Example integration
For a closer look at how our Ruby library works, clone our example integration. This includes commented code, highlighting key features and concepts, and examples of API calls that can be made using the library.
Running the tests
To run the tests use :
bundle install --with development
Contributing
We encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements. Have a look at our contributing guidelines to find out how to raise a pull request.
Support
If you have a feature request, or spotted a bug or a technical problem, create an issue here.
For other questions, contact our Support Team.
Licence
This repository is available under the MIT license.