stripe-ruby/lib/stripe/application_fee.rb
Brandur 3fab2cd59f Pass params and opts through on ApplicationFee#refund
`params` and `opts` are not currently passed through when using the
`#refund` helper on `ApplicationFee`. This was an omission on the
original refactor to use the new endpoint, and wasn't an intentional
design.

Fixes #386.
2016-03-02 13:45:57 -08:00

21 lines
584 B
Ruby

module Stripe
class ApplicationFee < APIResource
extend Stripe::APIOperations::List
def self.url
'/v1/application_fees'
end
# If you don't need access to an updated fee object after the refund, it's
# more performant to just call `fee.refunds.create` directly.
def refund(params={}, opts={})
self.refunds.create(params, opts)
# now that a refund has been created, we expect the state of this object
# to change as well (i.e. `refunded` will now be `true`) so refresh it
# from the server
self.refresh
end
end
end