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



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/gocardless_pro/resources/billing_request_template.rb', line 34

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

  @authorisation_url = object['authorisation_url']
  @created_at = object['created_at']
  @id = object['id']
  @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_urlObject (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_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#mandate_request_currencyObject (readonly)

Returns the value of attribute mandate_request_currency.



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

def mandate_request_currency
  @mandate_request_currency
end

#mandate_request_descriptionObject (readonly)

Returns the value of attribute mandate_request_description.



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

def mandate_request_description
  @mandate_request_description
end

#mandate_request_metadataObject (readonly)

Returns the value of attribute mandate_request_metadata.



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

def 
  @mandate_request_metadata
end

#mandate_request_schemeObject (readonly)

Returns the value of attribute mandate_request_scheme.



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

def mandate_request_scheme
  @mandate_request_scheme
end

#mandate_request_verifyObject (readonly)

Returns the value of attribute mandate_request_verify.



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

def mandate_request_verify
  @mandate_request_verify
end

#metadataObject (readonly)

Returns the value of attribute metadata.



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

def 
  @metadata
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#payment_request_amountObject (readonly)

Returns the value of attribute payment_request_amount.



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

def payment_request_amount
  @payment_request_amount
end

#payment_request_currencyObject (readonly)

Returns the value of attribute payment_request_currency.



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

def payment_request_currency
  @payment_request_currency
end

#payment_request_descriptionObject (readonly)

Returns the value of attribute payment_request_description.



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

def payment_request_description
  @payment_request_description
end

#payment_request_metadataObject (readonly)

Returns the value of attribute payment_request_metadata.



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

def 
  @payment_request_metadata
end

#payment_request_schemeObject (readonly)

Returns the value of attribute payment_request_scheme.



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

def payment_request_scheme
  @payment_request_scheme
end

#redirect_uriObject (readonly)

Returns the value of attribute redirect_uri.



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

def redirect_uri
  @redirect_uri
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

Instance Method Details

#api_responseObject



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

def api_response
  ApiResponse.new(@response)
end

#to_hObject

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



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

def to_h
  @object
end