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
Public Class Methods
Source
# File lib/gocardless_pro/resources/mandate.rb, line 24 def initialize(object, response = nil) @object = object @authorisation_source = object['authorisation_source'] @consent_parameters = object['consent_parameters'] @consent_type = object['consent_type'] @created_at = object['created_at'] @funds_settlement = object['funds_settlement'] @id = object['id'] @links = object['links'] @metadata = object['metadata'] @next_possible_charge_date = object['next_possible_charge_date'] @next_possible_standard_ach_charge_date = object['next_possible_standard_ach_charge_date'] @payments_require_approval = object['payments_require_approval'] @reference = object['reference'] @scheme = object['scheme'] @status = object['status'] @verified_at = object['verified_at'] @response = response end
Initialize a mandate resource instance @param object [Hash] an object returned from the API
Public Instance Methods
Source
# File lib/gocardless_pro/resources/mandate.rb, line 45 def api_response ApiResponse.new(@response) end
Source
# File lib/gocardless_pro/resources/mandate.rb, line 50 def links @mandate_links ||= Links.new(@links) end
Return the links that the resource has
Source
# File lib/gocardless_pro/resources/mandate.rb, line 55 def to_h @object end
Provides the mandate resource as a hash of all its readable attributes