Class: PinPays::Refunds

Inherits:
Api
  • Object
show all
Defined in:
lib/pin_pays/refunds.rb

Constant Summary collapse

PATH =
'/charges'

Constants inherited from Api

Api::LIVE_URI, Api::TEST_URI

Class Method Summary collapse

Methods inherited from Api

setup

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)
  options = (amount.nil? ? nil : { amount: amount })
  api_response(api_post("#{PATH}/#{charge_token}/refunds", options))
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