remitano 1.5.2 → 1.5.5

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
  SHA256:
3
- metadata.gz: 771c14e38413252cd78bee824fe142c02a61a3f54c0ce0c8fa5087cbfc64d17b
4
- data.tar.gz: 357085a821207ba87e3f1680ca0f96067c6ba6f67a9c0afc80d347e766cea28d
3
+ metadata.gz: 639f86130a0adae121b66ebe928cc4f8aad1274ec2aa130d7d5b81a102cc98b8
4
+ data.tar.gz: 959634cfec0d7e7735652e27179cd15a03e72d86213af5b8be65b357104f57b0
5
5
  SHA512:
6
- metadata.gz: d6816e92d71700a2a58052024c7748b5bf1aa98be51b98e31f75d9fd5ef0a8df94d8004931d431079ea9610d1d8ef53b39b6908a2ea0d67e2d77b68c499d85ba
7
- data.tar.gz: b74079031419fe7526b58988226411a88c4dbf6f360de583744c72fc27ab51580d064386093cd801ec1a9b7c157aa8bb9e6c9bc1a4c6c897a2d85e066c286193
6
+ metadata.gz: 71f3fd3ed82fcb38a483dc3e180fd812c2d0492b5ef4a572b3bdb6e1141db2ca8e0f4d83ca0208df353ac8c8fb1ac04e947eb21afa40cbbe5f33998c5621e7ff
7
+ data.tar.gz: b3c4bf6f9a9e77c7f447a98b73622eff249418f400e2bf0e59963207c0cffb2ce6e1ce2799b4c3fedcf072962e8c92c9f165c501de4677d5a0bbba94f174482f
data/.gitignore CHANGED
@@ -1,2 +1,4 @@
1
1
  .env
2
2
  tags
3
+
4
+ .byebug_history
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- remitano (1.5.2)
4
+ remitano (1.5.5)
5
5
  activesupport (>= 4.2.10)
6
6
  api-auth (~> 2.1.0)
7
7
  hashie
@@ -12,94 +12,136 @@ PATH
12
12
  GEM
13
13
  remote: http://rubygems.org/
14
14
  specs:
15
- activesupport (5.2.5)
15
+ activesupport (5.2.6)
16
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
17
17
  i18n (>= 0.7, < 2)
18
18
  minitest (~> 5.1)
19
19
  tzinfo (~> 1.1)
20
- addressable (2.5.2)
21
- public_suffix (>= 2.0.2, < 4.0)
20
+ addressable (2.7.0)
21
+ public_suffix (>= 2.0.2, < 5.0)
22
22
  api-auth (2.1.0)
23
- ast (2.4.0)
24
- byebug (3.5.1)
25
- columnize (~> 0.8)
26
- debugger-linecache (~> 1.2)
27
- slop (~> 3.6)
28
- columnize (0.9.0)
29
- concurrent-ruby (1.1.8)
30
- crack (0.4.3)
31
- safe_yaml (~> 1.0.0)
32
- debugger-linecache (1.2.0)
33
- diff-lcs (1.3)
23
+ ast (2.4.2)
24
+ builder (3.2.4)
25
+ byebug (11.1.3)
26
+ concurrent-ruby (1.1.9)
27
+ crack (0.4.5)
28
+ rexml
29
+ descendants_tracker (0.0.4)
30
+ thread_safe (~> 0.3, >= 0.3.1)
31
+ diff-lcs (1.4.4)
34
32
  domain_name (0.5.20190701)
35
33
  unf (>= 0.0.5, < 1.0.0)
36
- dotenv (2.0.0)
37
- git (1.2.5)
38
- hashdiff (0.3.7)
39
- hashie (4.1.0)
34
+ dotenv (2.0.2)
35
+ faraday (1.4.2)
36
+ faraday-em_http (~> 1.0)
37
+ faraday-em_synchrony (~> 1.0)
38
+ faraday-excon (~> 1.1)
39
+ faraday-net_http (~> 1.0)
40
+ faraday-net_http_persistent (~> 1.1)
41
+ multipart-post (>= 1.2, < 3)
42
+ ruby2_keywords (>= 0.0.4)
43
+ faraday-em_http (1.0.0)
44
+ faraday-em_synchrony (1.0.0)
45
+ faraday-excon (1.1.0)
46
+ faraday-net_http (1.0.1)
47
+ faraday-net_http_persistent (1.1.0)
48
+ git (1.8.1)
49
+ rchardet (~> 1.8)
50
+ github_api (0.19.0)
51
+ addressable (~> 2.4)
52
+ descendants_tracker (~> 0.0.4)
53
+ faraday (>= 0.8, < 2)
54
+ hashie (~> 3.5, >= 3.5.2)
55
+ oauth2 (~> 1.0)
56
+ hashdiff (1.0.1)
57
+ hashie (3.6.0)
58
+ highline (2.0.3)
59
+ http-accept (1.7.0)
40
60
  http-cookie (1.0.3)
41
61
  domain_name (~> 0.5)
42
62
  i18n (1.8.10)
43
63
  concurrent-ruby (~> 1.0)
44
- jaro_winkler (1.5.1)
45
- jeweler (1.8.4)
46
- bundler (~> 1.0)
64
+ jeweler (2.0.1)
65
+ builder
66
+ bundler (>= 1.0)
47
67
  git (>= 1.2.5)
68
+ github_api
69
+ highline (>= 1.6.15)
70
+ nokogiri (>= 1.5.10)
48
71
  rake
49
72
  rdoc
50
73
  json (1.8.6)
51
- mime-types (3.2.2)
74
+ jwt (2.2.3)
75
+ mime-types (3.3.1)
52
76
  mime-types-data (~> 3.2015)
53
- mime-types-data (3.2018.0812)
77
+ mime-types-data (3.2021.0225)
78
+ mini_portile2 (2.4.0)
54
79
  minitest (5.14.4)
80
+ multi_json (1.15.0)
81
+ multi_xml (0.6.0)
82
+ multipart-post (2.1.1)
55
83
  netrc (0.11.0)
56
- parallel (1.12.1)
57
- parser (2.5.3.0)
58
- ast (~> 2.4.0)
59
- powerpack (0.1.2)
60
- public_suffix (3.0.2)
84
+ nokogiri (1.10.10)
85
+ mini_portile2 (~> 2.4.0)
86
+ oauth2 (1.4.7)
87
+ faraday (>= 0.8, < 2.0)
88
+ jwt (>= 1.0, < 3.0)
89
+ multi_json (~> 1.3)
90
+ multi_xml (~> 0.5)
91
+ rack (>= 1.2, < 3)
92
+ parallel (1.20.1)
93
+ parser (3.0.1.1)
94
+ ast (~> 2.4.1)
95
+ public_suffix (4.0.6)
96
+ rack (2.2.3)
61
97
  rainbow (3.0.0)
62
- rake (10.0.4)
98
+ rake (13.0.3)
99
+ rchardet (1.8.0)
63
100
  rdoc (3.12.2)
64
101
  json (~> 1.4)
65
- rest-client (2.0.2)
102
+ regexp_parser (2.1.1)
103
+ rest-client (2.1.0)
104
+ http-accept (>= 1.7.0, < 2.0)
66
105
  http-cookie (>= 1.0.2, < 2.0)
67
106
  mime-types (>= 1.16, < 4.0)
68
107
  netrc (~> 0.8)
108
+ rexml (3.2.5)
69
109
  rotp (6.2.0)
70
- rspec (3.8.0)
71
- rspec-core (~> 3.8.0)
72
- rspec-expectations (~> 3.8.0)
73
- rspec-mocks (~> 3.8.0)
74
- rspec-core (3.8.0)
75
- rspec-support (~> 3.8.0)
76
- rspec-expectations (3.8.1)
110
+ rspec (3.10.0)
111
+ rspec-core (~> 3.10.0)
112
+ rspec-expectations (~> 3.10.0)
113
+ rspec-mocks (~> 3.10.0)
114
+ rspec-core (3.10.1)
115
+ rspec-support (~> 3.10.0)
116
+ rspec-expectations (3.10.1)
77
117
  diff-lcs (>= 1.2.0, < 2.0)
78
- rspec-support (~> 3.8.0)
79
- rspec-mocks (3.8.0)
118
+ rspec-support (~> 3.10.0)
119
+ rspec-mocks (3.10.2)
80
120
  diff-lcs (>= 1.2.0, < 2.0)
81
- rspec-support (~> 3.8.0)
82
- rspec-support (3.8.0)
83
- rubocop (0.60.0)
84
- jaro_winkler (~> 1.5.1)
121
+ rspec-support (~> 3.10.0)
122
+ rspec-support (3.10.2)
123
+ rubocop (1.12.1)
85
124
  parallel (~> 1.10)
86
- parser (>= 2.5, != 2.5.1.1)
87
- powerpack (~> 0.1)
125
+ parser (>= 3.0.0.0)
88
126
  rainbow (>= 2.2.2, < 4.0)
127
+ regexp_parser (>= 1.8, < 3.0)
128
+ rexml
129
+ rubocop-ast (>= 1.2.0, < 2.0)
89
130
  ruby-progressbar (~> 1.7)
90
- unicode-display_width (~> 1.4.0)
131
+ unicode-display_width (>= 1.4.0, < 3.0)
132
+ rubocop-ast (1.4.1)
133
+ parser (>= 2.7.1.5)
91
134
  ruby-hmac (0.4.0)
92
- ruby-progressbar (1.10.0)
93
- safe_yaml (1.0.4)
94
- slop (3.6.0)
95
- thor (0.20.0)
135
+ ruby-progressbar (1.11.0)
136
+ ruby2_keywords (0.0.4)
137
+ thor (1.1.0)
96
138
  thread_safe (0.3.6)
97
139
  tzinfo (1.2.9)
98
140
  thread_safe (~> 0.1)
99
141
  unf (0.1.4)
100
142
  unf_ext
101
143
  unf_ext (0.0.7.7)
102
- unicode-display_width (1.4.0)
144
+ unicode-display_width (2.0.0)
103
145
  vcr (4.0.0)
104
146
  webmock (3.3.0)
105
147
  addressable (>= 2.3.6)
@@ -107,13 +149,13 @@ GEM
107
149
  hashdiff
108
150
 
109
151
  PLATFORMS
110
- ruby
152
+ x86_64-darwin-18
111
153
 
112
154
  DEPENDENCIES
113
155
  bundler
114
156
  byebug
115
157
  dotenv (~> 2.0.0)
116
- jeweler (~> 1.8.4)
158
+ jeweler (~> 2.0.0)
117
159
  rdoc (~> 3.12)
118
160
  remitano!
119
161
  rspec
@@ -124,4 +166,4 @@ DEPENDENCIES
124
166
  webmock (~> 3.3.0)
125
167
 
126
168
  BUNDLED WITH
127
- 1.17.3
169
+ 2.2.19
data/README.md CHANGED
@@ -37,7 +37,7 @@ Remitano::Client.default # => the default client
37
37
  ```
38
38
  or
39
39
  ```ruby
40
- client = new Remitano::Client(
40
+ client = Remitano::Client.new(
41
41
  key: YOUR_API_KEY,
42
42
  secret: YOUR_API_SECRET,
43
43
  authenticator_secret: YOUR_AUTHENTICATOR_SECRET,
@@ -106,6 +106,13 @@ to get the updated information and process accordingly.
106
106
  ### Errors
107
107
  When receiving non 200-299 http code, a Remitano::Client::Request::RequestError will be raised.
108
108
 
109
+ ### Sandbox testing
110
+ We have a Testnet at https://remidemo.com.
111
+
112
+ You could register an account there, then submit a request at [this google form](https://forms.gle/jvJyWPBNwTWfowSm9) with your Remidemo username, so we could help to setup your testing account as a merchant.
113
+
114
+ After that, you could start your sandbox testing by setting `ENV["REMITANO_SANDBOX"]` to `"true"`.
115
+
109
116
  ## Contributing
110
117
 
111
118
  1. Fork it
@@ -1,4 +1,6 @@
1
- require 'api-auth'
1
+ # frozen_string_literal: true
2
+
3
+ require "api-auth"
2
4
 
3
5
  module Remitano
4
6
  class Client::Request
@@ -22,16 +24,20 @@ module Remitano
22
24
  class Client::Net
23
25
  attr_reader :config
24
26
 
27
+ REMITANO_PRODUCTION_SERVER = "https://api.remitano.com"
28
+ REMITANO_SANDBOX_SERVER = "https://api.remidemo.com"
29
+
25
30
  def initialize(config:)
26
31
  @config = config
27
32
  end
28
33
 
29
34
  def self.to_uri(path)
30
- return "#{server}/api/v1#{path}"
35
+ "#{server}/api/v1#{path}"
31
36
  end
32
37
 
33
38
  def self.server
34
- @server ||= (ENV['REMITANO_SERVER'] || "https://api.remitano.com")
39
+ ENV["REMITANO_SERVER"] ||
40
+ (ENV["REMITANO_SANDBOX"] == "true" ? REMITANO_SANDBOX_SERVER : REMITANO_PRODUCTION_SERVER)
35
41
  end
36
42
 
37
43
  def self.public_get(path, params = {})
@@ -1,3 +1,3 @@
1
1
  module Remitano
2
- VERSION = "1.5.2"
2
+ VERSION = "1.5.5"
3
3
  end
data/remitano.gemspec CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency("rspec-mocks", [">= 3.8"])
31
31
  spec.add_development_dependency("rdoc", ["~> 3.12"])
32
32
  spec.add_development_dependency("bundler")
33
- spec.add_development_dependency("jeweler", ["~> 1.8.4"])
33
+ spec.add_development_dependency("jeweler", ["~> 2.0.0"])
34
34
  spec.add_development_dependency("dotenv", ["~> 2.0.0"])
35
35
  spec.add_development_dependency("vcr", ["~> 4.0.0"])
36
36
  spec.add_development_dependency("webmock", ["~> 3.3.0"])
@@ -0,0 +1,57 @@
1
+ require 'spec_helper'
2
+
3
+ describe Remitano::Client::Net do
4
+ describe "#server" do
5
+ context "REMITANO_SERVER not set, REMITANO_SANDBOX not set" do
6
+ it "returns production server" do
7
+ stub_const(
8
+ "ENV",
9
+ ENV.to_hash.merge(
10
+ "REMITANO_SERVER" => nil,
11
+ "REMITANO_SANDBOX" => nil
12
+ )
13
+ )
14
+ expect(Remitano::Client::Net.server).to eq Remitano::Client::Net::REMITANO_PRODUCTION_SERVER
15
+ end
16
+ end
17
+
18
+ context "REMITANO_SERVER not set, REMITANO_SANDBOX set to true" do
19
+ it "returns sandbox server" do
20
+ stub_const(
21
+ "ENV",
22
+ ENV.to_hash.merge(
23
+ "REMITANO_SERVER" => nil,
24
+ "REMITANO_SANDBOX" => "true"
25
+ )
26
+ )
27
+ expect(Remitano::Client::Net.server).to eq Remitano::Client::Net::REMITANO_SANDBOX_SERVER
28
+ end
29
+ end
30
+
31
+ context "REMITANO_SERVER not set, REMITANO_SANDBOX set to false" do
32
+ it "returns production server" do
33
+ stub_const(
34
+ "ENV",
35
+ ENV.to_hash.merge(
36
+ "REMITANO_SERVER" => nil,
37
+ "REMITANO_SANDBOX" => "false"
38
+ )
39
+ )
40
+ expect(Remitano::Client::Net.server).to eq Remitano::Client::Net::REMITANO_PRODUCTION_SERVER
41
+ end
42
+ end
43
+
44
+ context "REMITANO_SERVER set to a specific server" do
45
+ it "returns specified server" do
46
+ stub_const(
47
+ "ENV",
48
+ ENV.to_hash.merge(
49
+ "REMITANO_SERVER" => "https://someserver.com",
50
+ "REMITANO_SANDBOX" => "true"
51
+ )
52
+ )
53
+ expect(Remitano::Client::Net.server).to eq "https://someserver.com"
54
+ end
55
+ end
56
+ end
57
+ end
@@ -1,6 +1,6 @@
1
- ENV['REMITANO_KEY'] = 'b4a3f24f3dcf340693432462ae23771e7efc7e0472cd3885fe046e47915790b1'
2
- ENV['REMITANO_SECRET'] = 'osXCsK2bgAyKHGl/+2wPH0MbRON1UlncIl1A1PpfgFyOwOF1GxpcPinvarVeCTUOieOpbjqvwrcll8wZToOK5w=='
3
- ENV['REMITANO_AUTHENTICATOR_SECRET'] = 'OYND3RBF3Z5ZB367AUILJ7QNRB5W3COC'
1
+ ENV['REMITANO_KEY'] = 'key'
2
+ ENV['REMITANO_SECRET'] = 'secret'
3
+ ENV['REMITANO_AUTHENTICATOR_SECRET'] = 'secret'
4
4
  ENV["REMITANO_SERVER"] = "http://localhost:3100"
5
5
 
6
6
  RSpec.configure do |config|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remitano
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phuong Nguyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-31 00:00:00.000000000 Z
11
+ date: 2021-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 1.8.4
159
+ version: 2.0.0
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 1.8.4
166
+ version: 2.0.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: dotenv
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -272,6 +272,7 @@ files:
272
272
  - remitano.gemspec
273
273
  - spec/client/merchant_charges_spec.rb
274
274
  - spec/client/merchant_withdrawals_spec.rb
275
+ - spec/client/net_spec.rb
275
276
  - spec/coin_accounts_spec.rb
276
277
  - spec/fiat_accounts_spec.rb
277
278
  - spec/fixtures/vcr_cassettes/Remitano_Client_merchant_charges/_create/invalid_params/raises_error.yml
@@ -322,7 +323,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
322
323
  - !ruby/object:Gem::Version
323
324
  version: '0'
324
325
  requirements: []
325
- rubygems_version: 3.0.6
326
+ rubygems_version: 3.2.19
326
327
  signing_key:
327
328
  specification_version: 4
328
329
  summary: Remitano Ruby API