Class: GoCardlessPro::Resources::BillingRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/gocardless_pro/resources/billing_request.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](developer.gocardless.com/getting-started/billing-requests/overview/) for how-to’s, explanations and tutorials. <p class=“notice”><strong>Important</strong>: All properties associated with ‘subscription_request` and `instalment_schedule_request` are only supported for ACH and PAD schemes.</p>

Defined Under Namespace

Classes: Links

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, response = nil) ⇒ BillingRequest

Initialize a billing_request resource instance

Parameters:

  • object (Hash)

    an object returned from the API



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/gocardless_pro/resources/billing_request.rb', line 30

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

  @actions = object['actions']
  @created_at = object['created_at']
  @fallback_enabled = object['fallback_enabled']
  @fallback_occurred = object['fallback_occurred']
  @id = object['id']
  @instalment_schedule_request = object['instalment_schedule_request']
  @links = object['links']
  @mandate_request = object['mandate_request']
  @metadata = object['metadata']
  @payment_request = object['payment_request']
  @purpose_code = object['purpose_code']
  @resources = object['resources']
  @status = object['status']
  @subscription_request = object['subscription_request']
  @response = response
end

Instance Attribute Details

#actionsObject (readonly)

Returns the value of attribute actions.



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

def actions
  @actions
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#fallback_enabledObject (readonly)

Returns the value of attribute fallback_enabled.



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

def fallback_enabled
  @fallback_enabled
end

#fallback_occurredObject (readonly)

Returns the value of attribute fallback_occurred.



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

def fallback_occurred
  @fallback_occurred
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#instalment_schedule_requestObject (readonly)

Returns the value of attribute instalment_schedule_request.



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

def instalment_schedule_request
  @instalment_schedule_request
end

#mandate_requestObject (readonly)

Returns the value of attribute mandate_request.



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

def mandate_request
  @mandate_request
end

#metadataObject (readonly)

Returns the value of attribute metadata.



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

def 
  @metadata
end

#payment_requestObject (readonly)

Returns the value of attribute payment_request.



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

def payment_request
  @payment_request
end

#purpose_codeObject (readonly)

Returns the value of attribute purpose_code.



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

def purpose_code
  @purpose_code
end

#resourcesObject (readonly)

Returns the value of attribute resources.



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

def resources
  @resources
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#subscription_requestObject (readonly)

Returns the value of attribute subscription_request.



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

def subscription_request
  @subscription_request
end

Instance Method Details

#api_responseObject



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

def api_response
  ApiResponse.new(@response)
end

Return the links that the resource has



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

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

#to_hObject

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



60
61
62
# File 'lib/gocardless_pro/resources/billing_request.rb', line 60

def to_h
  @object
end