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) ⇒ Object
Find a refund by charge token returns: a collection of refund objects args: token (String) pin.net.au/docs/api/refunds#get-refunds.
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
21 22 23 24 |
# File 'lib/pin_up/refund.rb', line 21 def self.create(token, amount = nil) = {amount: amount} build_response(auth_post("charges/#{token}/refunds", )) end |
.find(token) ⇒ Object
Find a refund by charge token returns: a collection of refund objects args: token (String) pin.net.au/docs/api/refunds#get-refunds
11 12 13 |
# File 'lib/pin_up/refund.rb', line 11 def self.find(token) build_collection_response(auth_get("charges/#{token}/refunds")) end |