twocheckout 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dce977ca3179d64dbcaf3afef749b271d4154601
4
- data.tar.gz: e1a3745495e261b8728e23313fe5211012d5cf7f
3
+ metadata.gz: 16ad57a7fd3ce73cbaabd0986752cdb9c3b2d09c
4
+ data.tar.gz: e06eee45323d2f72e20cf0a6766c44359b174db6
5
5
  SHA512:
6
- metadata.gz: 0e4f9a886771ddb34aef7fdee4c9d14ea94b2e8a28fe23bcd8662aa8219d465b1531c14430db81471300be44a59fcf67c050b4741581bafa181b8793a39dd9c4
7
- data.tar.gz: a28e08851d2d45b3c3be3cd2ed29f3b9e3045cb7457c609c49e81be941fe9ef8ae90ae39e47878c5d3396d143bd92f6a1e8f1aedf186c076533e262800ffcdd8
6
+ metadata.gz: 6347defc9ccd992b6223fc28d08b21827986db1b9de5562630d54ecc83efa0a938363716163331bbbbe67eaab62c29a6976a8fed71f223a3972c8d1a84fe6ca5
7
+ data.tar.gz: 4ae23fcb28ff68f633bc0e37b6af9df9ac6ade4a9686e328c0be0a96ed0b499b0566f47e8dc71b42e9979b5828c787a32810a33dd8e5d6bfc7a90cc0e9a34c20
data/README.md CHANGED
@@ -15,7 +15,7 @@ Or import into your Gemfile.
15
15
  gem "twocheckout"
16
16
  ```
17
17
 
18
- Full documentation for each binding is provided in the **[2Checkout Documentation](https://github.com/2checkout/2checkout-ruby/wiki)**.
18
+ Full documentation for each binding is provided in the **[2Checkout Documentation](https://www.2checkout.com/documentation/libraries/ruby)**.
19
19
 
20
20
 
21
21
  Example Purchase API Usage
@@ -284,4 +284,4 @@ end
284
284
  "Lineitem is not scheduled to recur."
285
285
  ```
286
286
 
287
- Full documentation for each binding is provided in the **[2Checkout Documentation](https://github.com/2checkout/2checkout-ruby/wiki)**.
287
+ Full documentation for each binding is provided in the **[2Checkout Documentation](https://www.2checkout.com/documentation/libraries/ruby)**.
@@ -8,11 +8,11 @@ module Twocheckout
8
8
  API_VERSION = '1'
9
9
 
10
10
  def self.credentials=(opts)
11
- @@username = opts[:username]
12
- @@password = opts[:password]
13
- @@private_key = opts[:private_key]
14
- @@seller_id = opts[:seller_id]
15
- @@sandbox = opts[:sandbox]
11
+ @username = opts[:username]
12
+ @password = opts[:password]
13
+ @private_key = opts[:private_key]
14
+ @seller_id = opts[:seller_id]
15
+ @sandbox = opts[:sandbox]
16
16
  end
17
17
 
18
18
  def self.request(http_method, api_call, params = nil)
@@ -23,9 +23,9 @@ module Twocheckout
23
23
  rescue => e
24
24
  error_hash = JSON.parse(e.response)
25
25
  if error_hash['exception']
26
- raise TwocheckoutError.new(error_hash['exception']['errorMsg']).retrieve
26
+ raise TwocheckoutError.new(error_hash['exception']['errorMsg'])
27
27
  else
28
- raise TwocheckoutError.new(error_hash['errors'][0]['message']).retrieve
28
+ raise TwocheckoutError.new(error_hash['errors'][0]['message'])
29
29
  end
30
30
  end
31
31
  end
@@ -33,11 +33,11 @@ module Twocheckout
33
33
  private
34
34
 
35
35
  def self.set_opts(http_method, api_call, params = null)
36
- url = @@sandbox ? SANDBOX_BASE : PROD_BASE
36
+ url = @sandbox ? SANDBOX_BASE : PROD_BASE
37
37
  if api_call == 'authService'
38
- url += '/checkout/api/' + API_VERSION + '/' + @@seller_id + '/rs/' + api_call
39
- params['sellerId'] = @@seller_id
40
- params['privateKey'] = @@private_key
38
+ url += '/checkout/api/' + API_VERSION + '/' + @seller_id + '/rs/' + api_call
39
+ params['sellerId'] = @seller_id
40
+ params['privateKey'] = @private_key
41
41
  opts = {
42
42
  :method => http_method,
43
43
  :url => url,
@@ -63,8 +63,8 @@ module Twocheckout
63
63
  :content_type => :json,
64
64
  :user_agent => "2Checkout/Ruby/," + Twocheckout::VERSION
65
65
  },
66
- :user => @@username,
67
- :password => @@password,
66
+ :user => @username,
67
+ :password => @password,
68
68
  :payload => params,
69
69
  }
70
70
  end
@@ -5,14 +5,5 @@ module Twocheckout
5
5
  def initialize(message)
6
6
  @message = message
7
7
  end
8
-
9
- def retrieve
10
- if @message.is_a?(Hash)
11
- @message = JSON.generate(@message)
12
- "#{@message}"
13
- else
14
- "#{@message}"
15
- end
16
- end
17
8
  end
18
9
  end
@@ -1,3 +1,3 @@
1
1
  module Twocheckout
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -294,7 +294,7 @@ describe Twocheckout::Checkout do
294
294
  begin
295
295
  result = Twocheckout::Checkout.authorize(params)
296
296
  assert_equal("APPROVED", result['responseCode'])
297
- rescue Exception => e
297
+ rescue Twocheckout::TwocheckoutError => e
298
298
  assert_equal("Unauthorized", e.message)
299
299
  end
300
300
  end
data/twocheckout.gemspec CHANGED
@@ -4,7 +4,7 @@ $:.unshift(File.join(File.dirname(__FILE__), 'lib'))
4
4
  Gem::Specification.new do |s|
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.name = 'twocheckout'
7
- s.version = '0.3.0'
7
+ s.version = '0.3.1'
8
8
  s.summary = '2Checkout Ruby Library'
9
9
  s.description = '0.3.0'
10
10
  s.summary = '2Checkout Ruby Library'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twocheckout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig Christenson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-01 00:00:00.000000000 Z
12
+ date: 2014-05-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client