Class: PinPays::Refunds
Constant Summary collapse
- PATH =
'/charges'
Constants inherited from Api
Class Method Summary collapse
-
.create(charge_token, amount = nil) ⇒ Object
Create a refund Amount - amount of charge to refund (optional).
-
.list(charge_token) ⇒ Object
List all refunds for a charge Note: does not return the usual paginated response.
Methods inherited from Api
Class Method Details
.create(charge_token, amount = nil) ⇒ Object
Create a refund Amount - amount of charge to refund (optional)
9 10 11 12 |
# File 'lib/pin_pays/refunds.rb', line 9 def create(charge_token, amount = nil) = (amount.nil? ? nil : { amount: amount }) api_response(api_post("#{PATH}/#{charge_token}/refunds", )) end |
.list(charge_token) ⇒ Object
List all refunds for a charge Note: does not return the usual paginated response. Instead returns only an array.
16 17 18 |
# File 'lib/pin_pays/refunds.rb', line 16 def list(charge_token) api_response(api_get("#{PATH}/#{charge_token}/refunds")) end |