Class: GoCardlessPro::Resources::BillingRequestTemplate

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

Overview

Billing Request Templates are reusable templates that result in numerous Billing Requests with similar attributes. They provide a no-code solution for generating various types of multi-user payment links.

Each template includes a reusable URL that can be embedded in a website or shared with customers via email. Every time the URL is opened, it generates a new Billing Request.

Billing Request Templates overcome the key limitation of the Billing Request: a Billing Request cannot be shared among multiple users because it is intended for single-use and is designed to cater to the unique needs of individual customers.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, response = nil) ⇒ BillingRequestTemplate

Initialize a billing_request_template resource instance

Parameters:

  • object (Hash) —

    an object returned from the API



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/gocardless_pro/resources/billing_request_template.rb', line 50

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

  @authorisation_url = object['authorisation_url']
  @created_at = object['created_at']
  @id = object['id']
  @mandate_request_constraints = object['mandate_request_constraints']
  @mandate_request_currency = object['mandate_request_currency']
  @mandate_request_description = object['mandate_request_description']
  @mandate_request_metadata = object['mandate_request_metadata']
  @mandate_request_scheme = object['mandate_request_scheme']
  @mandate_request_verify = object['mandate_request_verify']
  @metadata = object['metadata']
  @name = object['name']
  @payment_request_amount = object['payment_request_amount']
  @payment_request_currency = object['payment_request_currency']
  @payment_request_description = object['payment_request_description']
  @payment_request_metadata = object['payment_request_metadata']
  @payment_request_scheme = object['payment_request_scheme']
  @redirect_uri = object['redirect_uri']
  @updated_at = object['updated_at']
  @response = response
end

Instance Attribute Details

#authorisation_url ⇒ Object (readonly)

Returns the value of attribute authorisation_url.



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

def authorisation_url
  @authorisation_url
end

#created_at ⇒ Object (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#id ⇒ Object (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#mandate_request_constraints ⇒ Object (readonly)

Returns the value of attribute mandate_request_constraints.



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

def mandate_request_constraints
  @mandate_request_constraints
end

#mandate_request_currency ⇒ Object (readonly)

Returns the value of attribute mandate_request_currency.



33
34
35
# File 'lib/gocardless_pro/resources/billing_request_template.rb', line 33

def mandate_request_currency
  @mandate_request_currency
end

#mandate_request_description ⇒ Object (readonly)

Returns the value of attribute mandate_request_description.



34
35
36
# File 'lib/gocardless_pro/resources/billing_request_template.rb', line 34

def mandate_request_description
  @mandate_request_description
end

#mandate_request_metadata ⇒ Object (readonly)

Returns the value of attribute mandate_request_metadata.



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

def 
  @mandate_request_metadata
end

#mandate_request_scheme ⇒ Object (readonly)

Returns the value of attribute mandate_request_scheme.



36
37
38
# File 'lib/gocardless_pro/resources/billing_request_template.rb', line 36

def mandate_request_scheme
  @mandate_request_scheme
end

#mandate_request_verify ⇒ Object (readonly)

Returns the value of attribute mandate_request_verify.



37
38
39
# File 'lib/gocardless_pro/resources/billing_request_template.rb', line 37

def mandate_request_verify
  @mandate_request_verify
end

#metadata ⇒ Object (readonly)

Returns the value of attribute metadata.



38
39
40
# File 'lib/gocardless_pro/resources/billing_request_template.rb', line 38

def 
  @metadata
end

#name ⇒ Object (readonly)

Returns the value of attribute name.



39
40
41
# File 'lib/gocardless_pro/resources/billing_request_template.rb', line 39

def name
  @name
end

#payment_request_amount ⇒ Object (readonly)

Returns the value of attribute payment_request_amount.



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

def payment_request_amount
  @payment_request_amount
end

#payment_request_currency ⇒ Object (readonly)

Returns the value of attribute payment_request_currency.



41
42
43
# File 'lib/gocardless_pro/resources/billing_request_template.rb', line 41

def payment_request_currency
  @payment_request_currency
end

#payment_request_description ⇒ Object (readonly)

Returns the value of attribute payment_request_description.



42
43
44
# File 'lib/gocardless_pro/resources/billing_request_template.rb', line 42

def payment_request_description
  @payment_request_description
end

#payment_request_metadata ⇒ Object (readonly)

Returns the value of attribute payment_request_metadata.



43
44
45
# File 'lib/gocardless_pro/resources/billing_request_template.rb', line 43

def 
  @payment_request_metadata
end

#payment_request_scheme ⇒ Object (readonly)

Returns the value of attribute payment_request_scheme.



44
45
46
# File 'lib/gocardless_pro/resources/billing_request_template.rb', line 44

def payment_request_scheme
  @payment_request_scheme
end

#redirect_uri ⇒ Object (readonly)

Returns the value of attribute redirect_uri.



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

def redirect_uri
  @redirect_uri
end

#updated_at ⇒ Object (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

Instance Method Details

#api_response ⇒ Object



74
75
76
# File 'lib/gocardless_pro/resources/billing_request_template.rb', line 74

def api_response
  ApiResponse.new(@response)
end

#to_h ⇒ Object

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



79
80
81
# File 'lib/gocardless_pro/resources/billing_request_template.rb', line 79

def to_h
  @object
end