Are you looking for test card numbers?

Would you like to contact support?

No momento, esta página não está disponível em português
Developer-resource icon

Libraries

We provide server-side API libraries in several languages. Because the libraries are connected to managed package systems (Composer, Gradle, Maven, npm, NuGet, PyPi, RubyGems) they are easy to include in your project. Installing a library is not required, but will save you development time, because a library:

  • Uses an API version that is up to date.

  • Has generated models to help you construct requests.

    For a point-of-sale integration with Terminal API, the libraries are wrappers around Terminal API. They include the models to create Terminal API requests.

    • With a cloud Terminal API integration, you can use the PHP, Java, Node, C#, or Go libraries.
    • With a local Terminal API integration, you can use the Node, Java, or C# libraries. These also take care of protecting local communications.

  • Sends the request to Adyen using its built-in HTTP client, so you don't have to create your own.

Try our example integration

Requirements

  • Ruby 2.3 or higher.

Installation

You can use RubyGems:

Install the API library
gem install adyen-ruby-api-library

Alternatively, you can download the release on GitHub.

Run bundle install to install dependencies.

Using the library

Set up the client as a singleton resource that you use for the API requests to Adyen and make a test payment request. For example, to make a test credit card payment for 10 EUR (1000 in minor units):

Make a test payment request using the API library
require 'adyen'

# Set up the client.

adyen = Adyen::Client.new
adyen.api_key = "YOUR_API_KEY"
adyen.env = :test 

# Make a test POST /payments request.

response = adyen.checkout.payments({
    :paymentMethod => {
        :type => "scheme",
        :encryptedCardNumber => "test_4111111111111111",
        :encryptedExpiryMonth => "test_03",
        :encryptedExpiryYear => "test_2030",
        :encryptedSecurityCode => "test_737"
    },
    :amount => {
        :currency => 'EUR',
        :value => 1000
    },
    :reference => "YOUR_ORDER_REFERENCE",
    :returnUrl => "https://your-company.com/checkout?shopperOrder=12xy..",
    :merchantAccount => 'YOUR_MERCHANT_ACCOUNT'
})

Próximas etapas