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
amount[R]
amount_refunded[R]
charge_date[R]
created_at[R]
currency[R]
description[R]
fx[R]
id[R]
metadata[R]
reference[R]
retry_if_possible[R]
status[R]
Public Class Methods
new(object, response = nil)
click to toggle source
Initialize a payment resource instance @param object [Hash] an object returned from the API
# File lib/gocardless_pro/resources/payment.rb, line 38 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'] @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
Public Instance Methods
api_response()
click to toggle source
# File lib/gocardless_pro/resources/payment.rb, line 57 def api_response ApiResponse.new(@response) end
links()
click to toggle source
Return the links that the resource has
# File lib/gocardless_pro/resources/payment.rb, line 62 def links @payment_links ||= Links.new(@links) end
to_h()
click to toggle source
Provides the payment resource as a hash of all its readable attributes
# File lib/gocardless_pro/resources/payment.rb, line 67 def to_h @object end