Skip to content

Commit

Permalink
Add support for updating and paying to invoices
Browse files Browse the repository at this point in the history
  • Loading branch information
spakanati committed Aug 31, 2012
1 parent 29cd90b commit 151c258
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/stripe/invoice.rb
@@ -1,16 +1,27 @@
module Stripe
class Invoice < APIResource
include Stripe::APIOperations::List
include Stripe::APIOperations::Update

def self.upcoming(params)
response, api_key = Stripe.request(:get, upcoming_url, @api_key, params)
Util.convert_to_stripe_object(response, api_key)
end

def pay
response, api_key = Stripe.request(:post, pay_url, @api_key)
refresh_from(response, api_key)
self
end

private

def self.upcoming_url
url + '/upcoming'
end

def pay_url
url + '/pay'
end
end
end

0 comments on commit 151c258

Please sign in to comment.