Class: Pin::Refund
Overview
This class models Pin’s Charges API
Class Method Summary collapse
-
.create(token, amount = nil) ⇒ Object
Create a refund for a charge args: token (String), amount (String - optional) returns: a refund object if no amount is passed in, the full amount of the charge will be refunded pin.net.au/docs/api/refunds#post-refunds.
-
.find(token, page = nil, pagination = false) ⇒ Object
Find a refund by charge token returns: a collection of refund objects args: token (String).
Methods inherited from Base
Constructor Details
This class inherits a constructor from Pin::Base
Class Method Details
.create(token, amount = nil) ⇒ Object
Create a refund for a charge args: token (String), amount (String - optional) returns: a refund object if no amount is passed in, the full amount of the charge will be refunded pin.net.au/docs/api/refunds#post-refunds
25 26 27 28 |
# File 'lib/pin_up/refund.rb', line 25 def self.create(token, amount = nil) = {amount: amount} build_response(auth_post("charges/#{token}/refunds", )) end |
.find(token, page = nil, pagination = false) ⇒ Object
Find a refund by charge token returns: a collection of refund objects args: token (String)
if pagination is passed, access the response hash with [:response] and the pagination hash with [:pagination]
15 16 17 |
# File 'lib/pin_up/refund.rb', line 15 def self.find(token, page = nil, pagination = false) build_collection_response(auth_get("charges/#{token}/refunds?page=#{page}"), pagination) end |