mandarin-api 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d915e0b1f5d9bd316207797bae8588277a1ab41
|
4
|
+
data.tar.gz: a5c02e3876d9d249de648157344d4234471bc82e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1963fb92ed527f4f8c4d44be2691e5dbac8cfc44ca35b51d6c7aeeee87054c9d59f87a6ad12ce7e012bd099a195e74187b659f8c1b9b8f9e6e7bd33613d54407
|
7
|
+
data.tar.gz: 197b41facf0619ef4a3a1cafc8f06b0c2b63be8fbfe3a093c2d67735bda73e4a81bc813399034cab8174d614551127d142420fb88262410805dfa84c9f32f9dc
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mandarin-api (0.3.
|
4
|
+
mandarin-api (0.3.1)
|
5
5
|
rest-client (>= 2.0, < 3.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -87,7 +87,7 @@ DEPENDENCIES
|
|
87
87
|
faker (>= 1.6, < 1.7)
|
88
88
|
mandarin-api!
|
89
89
|
pry (~> 0)
|
90
|
-
pry-byebug
|
90
|
+
pry-byebug (~> 3.0)
|
91
91
|
pry-doc (~> 0)
|
92
92
|
rake
|
93
93
|
rb-readline (~> 0.5)
|
@@ -5,9 +5,10 @@ module MandarinApi
|
|
5
5
|
def assign_card(user, urls)
|
6
6
|
params = { customer_info: { email: user.email, phone: phone(user) } }
|
7
7
|
params[:urls] = urls unless urls.empty?
|
8
|
-
MandarinApi::Wrapper.new(
|
9
|
-
|
10
|
-
|
8
|
+
MandarinApi::Wrapper.new(
|
9
|
+
merchant_id: MandarinApi.config.merchant_id, secret: MandarinApi.config.secret,
|
10
|
+
logger: MandarinApi.config.logger
|
11
|
+
).request('/api/card-bindings', params)
|
11
12
|
end
|
12
13
|
|
13
14
|
def one_side_assign_card(user, card)
|
@@ -27,7 +27,8 @@ module MandarinApi
|
|
27
27
|
def perform(params, action, body)
|
28
28
|
MandarinApi::Wrapper.new(
|
29
29
|
merchant_id: MandarinApi.config.merchant_id,
|
30
|
-
secret: MandarinApi.config.secret
|
30
|
+
secret: MandarinApi.config.secret,
|
31
|
+
logger: MandarinApi.config.logger
|
31
32
|
).request('/api/transactions', send(body, params, action))
|
32
33
|
end
|
33
34
|
|
data/mandarin-api.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'mandarin-api'
|
5
|
-
s.version = '0.3.
|
5
|
+
s.version = '0.3.1'
|
6
6
|
s.authors = ['Vladimir Bogaevsky']
|
7
7
|
s.email = 'gitvbogaevsky@gmail.com'
|
8
8
|
s.licenses = ['MIT']
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.add_development_dependency('pry-doc', '~> 0')
|
21
21
|
s.add_development_dependency('rdoc', '>= 2.4.2', '< 5.0')
|
22
22
|
s.add_development_dependency('faker', '>= 1.6', '< 1.7')
|
23
|
-
s.add_development_dependency('pry-byebug')
|
23
|
+
s.add_development_dependency('pry-byebug', '~> 3.0')
|
24
24
|
|
25
25
|
s.add_dependency 'rest-client', '>= 2.0', '< 3.0'
|
26
26
|
|
@@ -25,6 +25,8 @@ RSpec.describe MandarinApi::CardManager do
|
|
25
25
|
receive_message_chain(:config, :merchant_id).and_return(merchant_id)
|
26
26
|
allow(MandarinApi).to \
|
27
27
|
receive_message_chain(:config, :secret).and_return(merchant_id)
|
28
|
+
allow(MandarinApi).to \
|
29
|
+
receive_message_chain(:config, :logger).and_return(nil)
|
28
30
|
allow_any_instance_of(MandarinApi::Wrapper).to receive(:request)
|
29
31
|
.with('/api/card-bindings', params)
|
30
32
|
expect_any_instance_of(MandarinApi::Wrapper).to receive(:request)
|
@@ -42,6 +42,8 @@ RSpec.describe MandarinApi::PaymentManager do
|
|
42
42
|
receive_message_chain(:config, :merchant_id).and_return(merchant_id)
|
43
43
|
allow(MandarinApi).to \
|
44
44
|
receive_message_chain(:config, :secret).and_return(merchant_id)
|
45
|
+
allow(MandarinApi).to \
|
46
|
+
receive_message_chain(:config, :logger).and_return(nil)
|
45
47
|
allow_any_instance_of(MandarinApi::Wrapper).to receive(:request)
|
46
48
|
.with('/api/transactions', charge_request_body)
|
47
49
|
expect_any_instance_of(MandarinApi::Wrapper).to receive(:request)
|
@@ -57,6 +59,8 @@ RSpec.describe MandarinApi::PaymentManager do
|
|
57
59
|
receive_message_chain(:config, :merchant_id).and_return(merchant_id)
|
58
60
|
allow(MandarinApi).to \
|
59
61
|
receive_message_chain(:config, :secret).and_return(merchant_id)
|
62
|
+
allow(MandarinApi).to \
|
63
|
+
receive_message_chain(:config, :logger).and_return(nil)
|
60
64
|
allow_any_instance_of(MandarinApi::Wrapper).to receive(:request)
|
61
65
|
.with('/api/transactions', normal_request_body)
|
62
66
|
expect_any_instance_of(MandarinApi::Wrapper).to receive(:request)
|
@@ -72,6 +76,8 @@ RSpec.describe MandarinApi::PaymentManager do
|
|
72
76
|
receive_message_chain(:config, :merchant_id).and_return(merchant_id)
|
73
77
|
allow(MandarinApi).to \
|
74
78
|
receive_message_chain(:config, :secret).and_return(merchant_id)
|
79
|
+
allow(MandarinApi).to \
|
80
|
+
receive_message_chain(:config, :logger).and_return(nil)
|
75
81
|
allow_any_instance_of(MandarinApi::Wrapper).to receive(:request)
|
76
82
|
.with('/api/transactions', normal_request_body)
|
77
83
|
expect_any_instance_of(MandarinApi::Wrapper).to receive(:request)
|
@@ -112,6 +118,8 @@ RSpec.describe MandarinApi::PaymentManager do
|
|
112
118
|
receive_message_chain(:config, :merchant_id).and_return(merchant_id)
|
113
119
|
allow(MandarinApi).to \
|
114
120
|
receive_message_chain(:config, :secret).and_return(merchant_id)
|
121
|
+
allow(MandarinApi).to \
|
122
|
+
receive_message_chain(:config, :logger).and_return(nil)
|
115
123
|
allow_any_instance_of(MandarinApi::Wrapper).to receive(:request)
|
116
124
|
.with('/api/transactions', refund_request_body)
|
117
125
|
expect_any_instance_of(MandarinApi::Wrapper).to receive(:request)
|
@@ -124,6 +132,8 @@ RSpec.describe MandarinApi::PaymentManager do
|
|
124
132
|
receive_message_chain(:config, :merchant_id).and_return(merchant_id)
|
125
133
|
allow(MandarinApi).to \
|
126
134
|
receive_message_chain(:config, :secret).and_return(merchant_id)
|
135
|
+
allow(MandarinApi).to \
|
136
|
+
receive_message_chain(:config, :logger).and_return(nil)
|
127
137
|
allow_any_instance_of(MandarinApi::Wrapper).to receive(:request)
|
128
138
|
.with('/api/transactions', refund_request_body)
|
129
139
|
expect_any_instance_of(MandarinApi::Wrapper).to receive(:request)
|
@@ -150,6 +160,8 @@ RSpec.describe MandarinApi::PaymentManager do
|
|
150
160
|
receive_message_chain(:config, :merchant_id).and_return(merchant_id)
|
151
161
|
allow(MandarinApi).to \
|
152
162
|
receive_message_chain(:config, :secret).and_return(merchant_id)
|
163
|
+
allow(MandarinApi).to \
|
164
|
+
receive_message_chain(:config, :logger).and_return(nil)
|
153
165
|
allow_any_instance_of(MandarinApi::Wrapper).to receive(:request)
|
154
166
|
.with('/api/transactions', rebill_request_body)
|
155
167
|
expect_any_instance_of(MandarinApi::Wrapper).to receive(:request)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mandarin-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Bogaevsky
|
@@ -124,16 +124,16 @@ dependencies:
|
|
124
124
|
name: pry-byebug
|
125
125
|
requirement: !ruby/object:Gem::Requirement
|
126
126
|
requirements:
|
127
|
-
- - "
|
127
|
+
- - "~>"
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version: '0'
|
129
|
+
version: '3.0'
|
130
130
|
type: :development
|
131
131
|
prerelease: false
|
132
132
|
version_requirements: !ruby/object:Gem::Requirement
|
133
133
|
requirements:
|
134
|
-
- - "
|
134
|
+
- - "~>"
|
135
135
|
- !ruby/object:Gem::Version
|
136
|
-
version: '0'
|
136
|
+
version: '3.0'
|
137
137
|
- !ruby/object:Gem::Dependency
|
138
138
|
name: rest-client
|
139
139
|
requirement: !ruby/object:Gem::Requirement
|