easyship-rates-ruby-api 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 175eacb565636cc6b781053822beecfa8e7fb274
4
- data.tar.gz: e0c738c96f7c98ece8dae119033803340beea7a2
3
+ metadata.gz: 23e3975acf0eb8e6da09bec9e99096bd022bbf9c
4
+ data.tar.gz: 358dded34510f12456e9fd0808aea4084af60885
5
5
  SHA512:
6
- metadata.gz: 726b84aa0df2a24ee31e0588bba6c2f354c2b1f15a823d6d5390c7d4fd66e72c0c66e0f35a6f5d281db9ee9f7ea7e4aeb98bd6a99041fd1847713f41d949e960
7
- data.tar.gz: 7314dff470e1d06684f6377257c7a795617ada837ef8f4a6e38aef55f3a629ac2ea55cb13decc259acad149042b6ac456713043f3bbe2c2626ddbe615647e041
6
+ metadata.gz: a6b83ad6e84b3d8fe750190ea445df20e70a0642ffd7fdf3ee67df689cece92b6c3cfb50537de4a0e832e0097fe014a4e9be8f8801fb5712dee57e145706b55d
7
+ data.tar.gz: dce7dfea58e9a463e28d7b04c0d1db5139d5832561219f22cc7c5fe0efb542185739385cf9cc29afbb83ab4c4610e90d7fac6ae6ecc936fdbe1bc4a94c442e86
data/README.md CHANGED
@@ -27,6 +27,8 @@ require 'easyship_rates_ruby_api'
27
27
  EasyshipRatesRubyApi.configure do |config|
28
28
  config.uid = 'RATE_CALCULATOR_APPID'
29
29
  config.secret = 'RATE_CALCULATOR_SECRET'
30
+ # if you want to use sandbox
31
+ config.sandbox = true
30
32
  end
31
33
  ```
32
34
 
@@ -28,5 +28,8 @@ module EasyshipRatesRubyApi
28
28
 
29
29
  # Raised when a 502 or 503 response status code is received
30
30
  class UnavailableError < StandardError; end
31
+
32
+ # Raised when user's secret is not correct
33
+ class ClientSecretError < StandardError; end
31
34
  end
32
35
  end
@@ -39,6 +39,8 @@ module EasyshipRatesRubyApi
39
39
  private_key: OpenSSL::PKey::RSA.new(@client_secret),
40
40
  scope: 'get_rate get_all_rate me'
41
41
  }.merge(client_params)
42
+ rescue OpenSSL::PKey::RSAError
43
+ raise EasyshipRatesRubyApi::Errors::ClientSecretError, 'Client Secret is not correct'
42
44
  end
43
45
  end
44
46
  end
@@ -1,7 +1,7 @@
1
1
  module EasyshipRatesRubyApi
2
2
  module Version #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 1
4
+ MINOR = 2
5
5
  PATCH = 0
6
6
  PRE = nil
7
7
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easyship-rates-ruby-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - aloha
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-27 00:00:00.000000000 Z
11
+ date: 2016-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2