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



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 36

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.



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

def authorised_at
  @authorised_at
end

#created_atObject (readonly)

Returns the value of attribute created_at.



26
27
28
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 26

def created_at
  @created_at
end

#expires_atObject (readonly)

Returns the value of attribute expires_at.



27
28
29
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 27

def expires_at
  @expires_at
end

#idObject (readonly)

Returns the value of attribute id.



28
29
30
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 28

def id
  @id
end

#last_visited_atObject (readonly)

Returns the value of attribute last_visited_at.



29
30
31
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 29

def last_visited_at
  @last_visited_at
end

#qr_code_urlObject (readonly)

Returns the value of attribute qr_code_url.



30
31
32
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 30

def qr_code_url
  @qr_code_url
end

#redirect_uriObject (readonly)

Returns the value of attribute redirect_uri.



31
32
33
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 31

def redirect_uri
  @redirect_uri
end

#urlObject (readonly)

Returns the value of attribute url.



32
33
34
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 32

def url
  @url
end

Instance Method Details

#api_responseObject



52
53
54
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 52

def api_response
  ApiResponse.new(@response)
end

Return the links that the resource has



57
58
59
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 57

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

#to_hObject

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



62
63
64
# File 'lib/gocardless_pro/resources/bank_authorisation.rb', line 62

def to_h
  @object
end