Adyen-ruby-api-library

Adyen API Library for ruby

View the Project on GitHub Adyen/adyen-ruby-api-library

Available methods

Authentication

Payments are authenticated via webservice username and password.

adyen.ws_user = "ws@Company.TestCompany"
adyen.ws_passord = "super_secure_password123"

Usage

The Payments service can be used to authorise and modify payments by sending data directly to Adyen's servers.

The simplest example is an authorise call with raw card data:

response = adyen.payments.authorise('{
  "card": {
    "number": "4111111111111111",
    "expiryMonth": "08",
    "expiryYear": "2018",
    "holderName": "Test Person",
    "cvc": "737"
  },
  "amount": {
    "value": 1500,
    "currency": "USD"
  },
  "reference": "YOUR_REFERENCE",
  "merchantAccount": "YOUR_MERCHANT_ACCOUNT"
}')

You can then capture the payment with a subsequent call to the capture method:

response = adyen.payments.capture('{
  "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
  "originalReference": "<PSP reference from authorise response>",
  "modificationAmount": {
    "value": 1500,
    "currency": "USD"
  }
}')

Refunds and cancellations work in the same way.

The adjust_authorisation method can be used to change the amount of an authorisation after the initial submission. However this is only available for certain MCC's, so please contact support@adyen.com before sending your own requests.