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.

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



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

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

  @actions = object['actions']
  @created_at = object['created_at']
  @fallback_enabled = object['fallback_enabled']
  @id = object['id']
  @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.



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

def actions
  @actions
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#fallback_enabledObject (readonly)

Returns the value of attribute fallback_enabled.



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

def fallback_enabled
  @fallback_enabled
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#mandate_requestObject (readonly)

Returns the value of attribute mandate_request.



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

def mandate_request
  @mandate_request
end

#metadataObject (readonly)

Returns the value of attribute metadata.



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

def 
  @metadata
end

#payment_requestObject (readonly)

Returns the value of attribute payment_request.



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

def payment_request
  @payment_request
end

#purpose_codeObject (readonly)

Returns the value of attribute purpose_code.



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

def purpose_code
  @purpose_code
end

#resourcesObject (readonly)

Returns the value of attribute resources.



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

def resources
  @resources
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#subscription_requestObject (readonly)

Returns the value of attribute subscription_request.



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

def subscription_request
  @subscription_request
end

Instance Method Details

#api_responseObject



46
47
48
# File 'lib/gocardless_pro/resources/billing_request.rb', line 46

def api_response
  ApiResponse.new(@response)
end

Return the links that the resource has



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

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

#to_hObject

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



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

def to_h
  @object
end