gocardless 1.6.0 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.6.1 - November 06, 2012
2
+
3
+ - Fix - update Client references to base_url so custom base_urls work
4
+
1
5
  ## 1.6.0 - November 06, 2012
2
6
 
3
7
  - Allow setting custom base_urls per-client
@@ -22,10 +22,6 @@ module GoCardless
22
22
  def base_url
23
23
  @base_url || BASE_URLS[GoCardless.environment || :production]
24
24
  end
25
-
26
- def api_url
27
- "#{base_url}#{API_PATH}"
28
- end
29
25
  end
30
26
 
31
27
  def initialize(args = {})
@@ -36,7 +32,7 @@ module GoCardless
36
32
  raise ClientError.new("You must provide an app_secret") unless @app_secret
37
33
 
38
34
  @oauth_client = OAuth2::Client.new(@app_id, @app_secret,
39
- :site => self.class.base_url,
35
+ :site => self.base_url,
40
36
  :token_url => '/oauth/access_token')
41
37
 
42
38
  self.access_token = args[:token] if args[:token]
@@ -237,8 +233,8 @@ module GoCardless
237
233
  headers = {
238
234
  'Authorization' => "Basic #{credentials}"
239
235
  }
240
- request(:post, "#{self.class.api_url}/confirm", :data => data,
241
- :headers => headers)
236
+ request(:post, "#{api_url}/confirm", :data => data,
237
+ :headers => headers)
242
238
 
243
239
  # Initialize the correct class according to the resource's type
244
240
  klass = GoCardless.const_get(Utils.camelize(params[:resource_type]))
@@ -283,6 +279,10 @@ module GoCardless
283
279
  @base_url || self.class.base_url
284
280
  end
285
281
 
282
+ def api_url
283
+ "#{base_url}#{API_PATH}"
284
+ end
285
+
286
286
  private
287
287
 
288
288
  # Return the merchant id, throwing a proper error if it's missing.
@@ -312,7 +312,7 @@ module GoCardless
312
312
  opts[:body] = MultiJson.encode(opts[:data]) if !opts[:data].nil?
313
313
 
314
314
  # Reset the URL in case the environment / base URL has been changed.
315
- @oauth_client.site = self.class.base_url
315
+ @oauth_client.site = base_url
316
316
 
317
317
  header_keys = opts[:headers].keys.map(&:to_s)
318
318
  if header_keys.map(&:downcase).include?('authorization')
@@ -380,7 +380,7 @@ module GoCardless
380
380
  # @param [Hash] params the bill parameters
381
381
  # @return [String] the generated URL
382
382
  def new_limit_url(type, limit_params)
383
- url = URI.parse("#{self.class.base_url}/connect/#{type}s/new")
383
+ url = URI.parse("#{base_url}/connect/#{type}s/new")
384
384
 
385
385
  limit_params[:merchant_id] = merchant_id
386
386
  redirect_uri = limit_params.delete(:redirect_uri)
@@ -1,3 +1,3 @@
1
1
  module GoCardless
2
- VERSION = '1.6.0'.freeze
2
+ VERSION = '1.6.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gocardless
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: