Class: GoCardlessPro::Resources::BillingRequestWithAction

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

Overview

Billing Requests help create resources that require input or action from a customer. An example of required input might be additional customer billing details, while an action would be asking a customer to authorise a payment using their mobile banking app.

See Billing Requests: Overview (https://developer.gocardless.com/getting-started/billing-requests/overview/) for how-to's, explanations and tutorials.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, response = nil) ⇒ BillingRequestWithAction

Initialize a billing_request_with_action resource instance

Parameters:

  • object (Hash)

    an object returned from the API



27
28
29
30
31
32
33
# File 'lib/gocardless_pro/resources/billing_request_with_action.rb', line 27

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

  @bank_authorisations = object['bank_authorisations']
  @billing_requests = object['billing_requests']
  @response = response
end

Instance Attribute Details

#bank_authorisationsObject (readonly)

Returns the value of attribute bank_authorisations.



22
23
24
# File 'lib/gocardless_pro/resources/billing_request_with_action.rb', line 22

def bank_authorisations
  @bank_authorisations
end

#billing_requestsObject (readonly)

Returns the value of attribute billing_requests.



23
24
25
# File 'lib/gocardless_pro/resources/billing_request_with_action.rb', line 23

def billing_requests
  @billing_requests
end

Instance Method Details

#api_responseObject



35
36
37
# File 'lib/gocardless_pro/resources/billing_request_with_action.rb', line 35

def api_response
  ApiResponse.new(@response)
end

#to_hObject

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



40
41
42
# File 'lib/gocardless_pro/resources/billing_request_with_action.rb', line 40

def to_h
  @object
end