Module: Adyen::REST

Defined in:
lib/adyen/rest.rb,
lib/adyen/rest/client.rb,
lib/adyen/rest/errors.rb,
lib/adyen/rest/request.rb,
lib/adyen/rest/response.rb,
lib/adyen/rest/signature.rb,
lib/adyen/rest/modify_payment.rb,
lib/adyen/rest/authorise_payment.rb,
lib/adyen/rest/authorise_recurring_payment.rb

Overview

The Adyen::REST module allows you to interact with Adyen’s REST API.

The primary method here is REST.session, which will yield a Client which you can use to send API requests.

Examples:


Adyen::REST.session do |client|
  client.http.read_timeout = 5
  response = client.api_request(...)
  # ...
end

See Also:

Defined Under Namespace

Modules: AuthorisePayment, AuthoriseRecurringPayment, ListRecurringDetailsPayment, ModifyPayment, ReauthoriseRecurringPayment, Signature Classes: Client, Error, Request, RequestValidationFailed, Response, ResponseError

Class Method Summary collapse

Class Method Details

.clientAdyen::REST::Client

Provides a REST API client this is configured using the values in Adyen.configuration.

Parameters:

  • options (Hash)

    (see Adyen::REST::Client#initialize)

Returns:

See Also:



28
29
30
31
32
33
34
# File 'lib/adyen/rest.rb', line 28

def self.client
  Adyen::REST::Client.new(
    Adyen.configuration.environment,
    Adyen.configuration.api_username,
    Adyen.configuration.api_password
  )
end

.session(client = nil) {|client| ... } ⇒ void

This method returns an undefined value.

Exectutes a session against the Adyen REST API.

It will use a standard client from client, or it uses a provided client. The client will be yielded to the block, and will be closed after the block is finisged

Parameters:

  • client (Adyen::REST::Client) (defaults to: nil)

    A custom API client if a default one won’t do.

Yields:

  • The provided block will be called in which you can interact with the API using the provided client. The client will be closed after the block returns.

Yield Parameters:

See Also:



47
48
49
50
51
52
# File 'lib/adyen/rest.rb', line 47

def self.session(client = nil)
  client ||= self.client
  yield(client)
ensure
  client.close
end