class GoCardlessPro::Resources::Mandate
Mandates represent the Direct Debit mandate with a [customer](core-endpoints-customers).
GoCardless will notify you via a [webhook](appendix-webhooks) whenever the status of a mandate changes.
Attributes
created_at[R]
id[R]
metadata[R]
next_possible_charge_date[R]
payments_require_approval[R]
reference[R]
scheme[R]
status[R]
Public Class Methods
new(object, response = nil)
click to toggle source
Initialize a mandate resource instance @param object [Hash] an object returned from the API
# File lib/gocardless_pro/resources/mandate.rb, line 32 def initialize(object, response = nil) @object = object @created_at = object['created_at'] @id = object['id'] @links = object['links'] @metadata = object['metadata'] @next_possible_charge_date = object['next_possible_charge_date'] @payments_require_approval = object['payments_require_approval'] @reference = object['reference'] @scheme = object['scheme'] @status = object['status'] @response = response end
Public Instance Methods
api_response()
click to toggle source
# File lib/gocardless_pro/resources/mandate.rb, line 47 def api_response ApiResponse.new(@response) end
links()
click to toggle source
Return the links that the resource has
# File lib/gocardless_pro/resources/mandate.rb, line 52 def links @mandate_links ||= Links.new(@links) end
to_h()
click to toggle source
Provides the mandate resource as a hash of all its readable attributes
# File lib/gocardless_pro/resources/mandate.rb, line 57 def to_h @object end