class GoCardlessPro::Resources::Payment
Payment
objects represent payments from a [customer](core-endpoints-customers) to a [creditor](core-endpoints-creditors), taken against a Direct Debit [mandate](core-endpoints-mandates).
GoCardless will notify you via a [webhook](appendix-webhooks) whenever the state of a payment changes.
Attributes
Public Class Methods
Source
# File lib/gocardless_pro/resources/payment.rb, line 26 def initialize(object, response = nil) @object = object @amount = object['amount'] @amount_refunded = object['amount_refunded'] @charge_date = object['charge_date'] @created_at = object['created_at'] @currency = object['currency'] @description = object['description'] @faster_ach = object['faster_ach'] @fx = object['fx'] @id = object['id'] @links = object['links'] @metadata = object['metadata'] @reference = object['reference'] @retry_if_possible = object['retry_if_possible'] @status = object['status'] @response = response end
Initialize a payment resource instance @param object [Hash] an object returned from the API
Public Instance Methods
Source
# File lib/gocardless_pro/resources/payment.rb, line 46 def api_response ApiResponse.new(@response) end
Source
# File lib/gocardless_pro/resources/payment.rb, line 51 def links @payment_links ||= Links.new(@links) end
Return the links that the resource has
Source
# File lib/gocardless_pro/resources/payment.rb, line 56 def to_h @object end
Provides the payment resource as a hash of all its readable attributes