class GoCardless::Resources::Refund
# The API allows you to create, show, list and update your refunds.
GoCardless
will notify you via a [webhook](developer.gocardless.com/pro/#webhooks) whenever a refund is created.
Note: A payment that has been (partially) refunded can still receive a late failure or chargeback from the banks. Represents an instance of a refund resource returned from the API
Attributes
amount[R]
created_at[R]
currency[R]
id[R]
metadata[R]
Public Class Methods
new(object)
click to toggle source
initialize a resource instance @param object [Hash] an object returned from the API
# File lib/gocardless-pro/resources/refund.rb, line 42 def initialize(object) @object = object @amount = object['amount'] @created_at = object['created_at'] @currency = object['currency'] @id = object['id'] @links = object['links'] @metadata = object['metadata'] end
Public Instance Methods
links()
click to toggle source
return the links that the resource has
# File lib/gocardless-pro/resources/refund.rb, line 54 def links Struct.new( *{ payment: '' }.keys.sort ).new(*@links.sort.map(&:last)) end
to_h()
click to toggle source
Provides the resource as a hash of all it’s readable attributes
# File lib/gocardless-pro/resources/refund.rb, line 65 def to_h @object end