/adyen-ruby-api-library

Adyen API Library for Ruby

Primary LanguageRubyMIT LicenseMIT

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:

For more information, refer to our documentation or the API Explorer.

Prerequisites

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.

See also