mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-08-29 00:02:34 -04:00
Add the ability to send options with retrieve requests.
This commit is contained in:
parent
3e30d5ad78
commit
5ffde047d3
@ -1,3 +1,8 @@
|
||||
=== 1.7.10 2013-02-01
|
||||
* Add support for passing options when retrieving Stripe objects
|
||||
e.g., Stripe::Charge.retrieve({id:"foo", expand:["customer"]})
|
||||
Stripe::Charge("foo") is still supported as well
|
||||
|
||||
=== 1.7.9 2013-01-15
|
||||
* Add support for setting a Stripe API version override.
|
||||
|
||||
|
@ -10,39 +10,39 @@ require 'rest_client'
|
||||
require 'multi_json'
|
||||
|
||||
# Version
|
||||
require 'stripe/version'
|
||||
require './lib/stripe/version'
|
||||
|
||||
# API operations
|
||||
require 'stripe/api_operations/create'
|
||||
require 'stripe/api_operations/update'
|
||||
require 'stripe/api_operations/delete'
|
||||
require 'stripe/api_operations/list'
|
||||
require './lib/stripe/api_operations/create'
|
||||
require './lib/stripe/api_operations/update'
|
||||
require './lib/stripe/api_operations/delete'
|
||||
require './lib/stripe/api_operations/list'
|
||||
|
||||
# Resources
|
||||
require 'stripe/util'
|
||||
require 'stripe/json'
|
||||
require 'stripe/stripe_object'
|
||||
require 'stripe/api_resource'
|
||||
require 'stripe/singleton_api_resource'
|
||||
require 'stripe/list_object'
|
||||
require 'stripe/account'
|
||||
require 'stripe/customer'
|
||||
require 'stripe/invoice'
|
||||
require 'stripe/invoice_item'
|
||||
require 'stripe/charge'
|
||||
require 'stripe/plan'
|
||||
require 'stripe/coupon'
|
||||
require 'stripe/token'
|
||||
require 'stripe/event'
|
||||
require 'stripe/transfer'
|
||||
require './lib/stripe/util'
|
||||
require './lib/stripe/json'
|
||||
require './lib/stripe/stripe_object'
|
||||
require './lib/stripe/api_resource'
|
||||
require './lib/stripe/singleton_api_resource'
|
||||
require './lib/stripe/list_object'
|
||||
require './lib/stripe/account'
|
||||
require './lib/stripe/customer'
|
||||
require './lib/stripe/invoice'
|
||||
require './lib/stripe/invoice_item'
|
||||
require './lib/stripe/charge'
|
||||
require './lib/stripe/plan'
|
||||
require './lib/stripe/coupon'
|
||||
require './lib/stripe/token'
|
||||
require './lib/stripe/event'
|
||||
require './lib/stripe/transfer'
|
||||
|
||||
# Errors
|
||||
require 'stripe/errors/stripe_error'
|
||||
require 'stripe/errors/api_error'
|
||||
require 'stripe/errors/api_connection_error'
|
||||
require 'stripe/errors/card_error'
|
||||
require 'stripe/errors/invalid_request_error'
|
||||
require 'stripe/errors/authentication_error'
|
||||
require './lib/stripe/errors/stripe_error'
|
||||
require './lib/stripe/errors/api_error'
|
||||
require './lib/stripe/errors/api_connection_error'
|
||||
require './lib/stripe/errors/card_error'
|
||||
require './lib/stripe/errors/invalid_request_error'
|
||||
require './lib/stripe/errors/authentication_error'
|
||||
|
||||
module Stripe
|
||||
@@ssl_bundle_path = File.join(File.dirname(__FILE__), 'data/ca-certificates.crt')
|
||||
|
@ -19,7 +19,7 @@ module Stripe
|
||||
end
|
||||
|
||||
def refresh
|
||||
response, api_key = Stripe.request(:get, url, @api_key)
|
||||
response, api_key = Stripe.request(:get, url, @api_key, @retrieve_options)
|
||||
refresh_from(response, api_key)
|
||||
self
|
||||
end
|
||||
|
@ -11,6 +11,15 @@ module Stripe
|
||||
end
|
||||
|
||||
def initialize(id=nil, api_key=nil)
|
||||
# parameter overloading!
|
||||
if id.kind_of?(Hash)
|
||||
@retrieve_options = id.dup
|
||||
@retrieve_options.delete(:id)
|
||||
id = id[:id]
|
||||
else
|
||||
@retrieve_options = {}
|
||||
end
|
||||
|
||||
@api_key = api_key
|
||||
@values = {}
|
||||
# This really belongs in APIResource, but not putting it there allows us
|
||||
|
@ -1,3 +1,3 @@
|
||||
module Stripe
|
||||
VERSION = '1.7.9'
|
||||
VERSION = '1.7.10'
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user