mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-09-22 00:00:31 -04:00
Added ApplicationFee class.
- Currently supports listing, retrieving and refunding.
This commit is contained in:
parent
28ac4ffe00
commit
81e46f4d6c
@ -36,6 +36,7 @@ require 'stripe/event'
|
||||
require 'stripe/transfer'
|
||||
require 'stripe/recipient'
|
||||
require 'stripe/card'
|
||||
require 'stripe/application_fee'
|
||||
|
||||
# Errors
|
||||
require 'stripe/errors/stripe_error'
|
||||
|
21
lib/stripe/application_fee.rb
Normal file
21
lib/stripe/application_fee.rb
Normal file
@ -0,0 +1,21 @@
|
||||
module Stripe
|
||||
class ApplicationFee < APIResource
|
||||
include Stripe::APIOperations::List
|
||||
|
||||
def self.url
|
||||
'/v1/application_fees'
|
||||
end
|
||||
|
||||
def refund(params={})
|
||||
response, api_key = Stripe.request(:post, refund_url, @api_key, params)
|
||||
refresh_from(response, api_key)
|
||||
self
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def refund_url
|
||||
url + '/refund'
|
||||
end
|
||||
end
|
||||
end
|
@ -29,7 +29,8 @@ module Stripe
|
||||
'transfer' => Transfer,
|
||||
'recipient' => Recipient,
|
||||
'card' => Card,
|
||||
'list' => ListObject
|
||||
'list' => ListObject,
|
||||
'application_fee' => ApplicationFee
|
||||
}
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user