class GoCardlessPro::Resources::Refund
Refund
objects represent (partial) refunds of a [payment](core-endpoints-payments) back to the [customer](core-endpoints-customers).
GoCardless will notify you via a [webhook](appendix-webhooks) whenever a refund is created, and will update the ‘amount_refunded` property of the payment.
Attributes
Public Class Methods
Source
# File lib/gocardless_pro/resources/refund.rb, line 25 def initialize(object, response = nil) @object = object @amount = object['amount'] @created_at = object['created_at'] @currency = object['currency'] @fx = object['fx'] @id = object['id'] @links = object['links'] @metadata = object['metadata'] @reference = object['reference'] @status = object['status'] @response = response end
Initialize a refund resource instance @param object [Hash] an object returned from the API
Public Instance Methods
Source
# File lib/gocardless_pro/resources/refund.rb, line 40 def api_response ApiResponse.new(@response) end
Source
# File lib/gocardless_pro/resources/refund.rb, line 45 def links @refund_links ||= Links.new(@links) end
Return the links that the resource has
Source
# File lib/gocardless_pro/resources/refund.rb, line 50 def to_h @object end
Provides the refund resource as a hash of all its readable attributes