Class: GoCardlessPro::Services::BankAccountDetailsService

Inherits:
BaseService
  • Object
show all
Defined in:
lib/gocardless_pro/services/bank_account_details_service.rb

Overview

Service for making requests to the BankAccountDetail endpoints

Instance Method Summary collapse

Methods inherited from BaseService

#initialize, #make_request, #sub_url

Constructor Details

This class inherits a constructor from GoCardlessPro::Services::BaseService

Instance Method Details

#get(identity, options = {}) ⇒ Object

Returns bank account details in the flattened JSON Web Encryption format described in RFC 7516 Example URL: /bank_account_details/:identity

Parameters:

  • identity

    # Unique identifier, beginning with “BA”.

  • options (Hash) (defaults to: {})

    parameters as a hash, under a params key.



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/gocardless_pro/services/bank_account_details_service.rb', line 19

def get(identity, options = {})
  path = sub_url('/bank_account_details/:identity', {
                   'identity' => identity
                 })

  options[:retry_failures] = true

  response = make_request(:get, path, options)

  return if response.body.nil?

  Resources::BankAccountDetail.new(unenvelope_body(response.body), response)
end