Added ApplicationFee class.

- Currently supports listing, retrieving and refunding.
This commit is contained in:
Felix Kenton 2013-06-22 16:19:11 +01:00 committed by Amber Feng
parent 28ac4ffe00
commit 81e46f4d6c
3 changed files with 24 additions and 1 deletions

View File

@ -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'

View 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

View File

@ -29,7 +29,8 @@ module Stripe
'transfer' => Transfer,
'recipient' => Recipient,
'card' => Card,
'list' => ListObject
'list' => ListObject,
'application_fee' => ApplicationFee
}
end