mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-11-28 00:02:45 -05:00
commit
fb29711a4f
@ -1,3 +1,6 @@
|
||||
=== 1.7.9 2013-01-15
|
||||
* Add support for setting a Stripe API version override.
|
||||
|
||||
=== 1.7.8 2012-11-21
|
||||
* Relax the version constraint on multi_json (github issue #44)
|
||||
|
||||
|
||||
@ -49,6 +49,7 @@ module Stripe
|
||||
@@api_key = nil
|
||||
@@api_base = 'https://api.stripe.com'
|
||||
@@verify_ssl_certs = true
|
||||
@@api_version = nil
|
||||
|
||||
def self.api_url(url='')
|
||||
@@api_base + url
|
||||
@ -78,6 +79,14 @@ module Stripe
|
||||
@@verify_ssl_certs
|
||||
end
|
||||
|
||||
def self.api_version=(version)
|
||||
@@api_version = version
|
||||
end
|
||||
|
||||
def self.api_version
|
||||
@@api_version
|
||||
end
|
||||
|
||||
def self.request(method, url, api_key, params={}, headers={})
|
||||
api_key ||= @@api_key
|
||||
raise AuthenticationError.new('No API key provided. (HINT: set your API key using "Stripe.api_key = <API-KEY>". You can generate API keys from the Stripe web interface. See https://stripe.com/api for details, or email support@stripe.com if you have any questions.)') unless api_key
|
||||
@ -139,6 +148,11 @@ module Stripe
|
||||
:authorization => "Bearer #{api_key}",
|
||||
:content_type => 'application/x-www-form-urlencoded'
|
||||
}.merge(headers)
|
||||
|
||||
if self.api_version
|
||||
headers[:stripe_version] = self.api_version
|
||||
end
|
||||
|
||||
opts = {
|
||||
:method => method,
|
||||
:url => url,
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
module Stripe
|
||||
VERSION = '1.7.8'
|
||||
VERSION = '1.7.9'
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user