Class: GoCardlessPro::Resources::BankAuthorisation

Inherits:
Object
  • Object
show all
Defined in:
lib/gocardless_pro/resources/bank_authorisation.rb

Overview

Bank Authorisations can be used to authorise Billing Requests. Authorisations are created against a specific bank, usually the bank that provides the payer’s account.

Creation of Bank Authorisations is only permitted from GoCardless hosted UIs (see Billing Request Flows) to ensure we meet regulatory requirements for checkout flows.

Defined Under Namespace

Classes: Links

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, response = nil) ⇒ BankAuthorisation

Initialize a bank_authorisation resource instance

Parameters:

  • object (Hash)

    an object returned from the API



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 29

def initialize(object, response = nil)
  @object = object

  @authorisation_type = object['authorisation_type']
  @authorised_at = object['authorised_at']
  @created_at = object['created_at']
  @expires_at = object['expires_at']
  @id = object['id']
  @last_visited_at = object['last_visited_at']
  @links = object['links']
  @qr_code_url = object['qr_code_url']
  @redirect_uri = object['redirect_uri']
  @url = object['url']
  @response = response
end

Instance Attribute Details

#authorisation_typeObject (readonly)

Returns the value of attribute authorisation_type.



24
25
26
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 24

def authorisation_type
  @authorisation_type
end

#authorised_atObject (readonly)

Returns the value of attribute authorised_at.



24
25
26
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 24

def authorised_at
  @authorised_at
end

#created_atObject (readonly)

Returns the value of attribute created_at.



24
25
26
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 24

def created_at
  @created_at
end

#expires_atObject (readonly)

Returns the value of attribute expires_at.



24
25
26
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 24

def expires_at
  @expires_at
end

#idObject (readonly)

Returns the value of attribute id.



24
25
26
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 24

def id
  @id
end

#last_visited_atObject (readonly)

Returns the value of attribute last_visited_at.



24
25
26
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 24

def last_visited_at
  @last_visited_at
end

#qr_code_urlObject (readonly)

Returns the value of attribute qr_code_url.



24
25
26
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 24

def qr_code_url
  @qr_code_url
end

#redirect_uriObject (readonly)

Returns the value of attribute redirect_uri.



24
25
26
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 24

def redirect_uri
  @redirect_uri
end

#urlObject (readonly)

Returns the value of attribute url.



24
25
26
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 24

def url
  @url
end

Instance Method Details

#api_responseObject



45
46
47
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 45

def api_response
  ApiResponse.new(@response)
end

Return the links that the resource has



50
51
52
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 50

def links
  @bank_authorisation_links ||= Links.new(@links)
end

#to_hObject

Provides the bank_authorisation resource as a hash of all its readable attributes



55
56
57
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 55

def to_h
  @object
end