espago 0.1.8 → 0.1.10
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 +5 -5
- data/.travis.yml +15 -8
- data/Gemfile +2 -0
- data/Gemfile.lock +254 -130
- data/README.md +13 -15
- data/app/views/espago_secure_web_page/_form.html.haml +3 -2
- data/espago.gemspec +13 -12
- data/lib/espago/api_connection/charges_complete_post.rb +1 -1
- data/lib/espago/api_connection/refunds_post.rb +9 -0
- data/lib/espago/api_connection/secure_web_page_register_post.rb +9 -0
- data/lib/espago/api_connection/tokens_post.rb +1 -1
- data/lib/espago/api_connection/visacheckout_post.rb +9 -0
- data/lib/espago/api_connection.rb +4 -2
- data/lib/espago/client.rb +5 -6
- data/lib/espago/secure_web_page.rb +13 -10
- data/lib/espago/version.rb +1 -1
- data/spec/espago/api_connection_spec.rb +1 -1
- data/spec/espago/back_request_spec.rb +11 -11
- data/spec/espago/client_spec.rb +8 -8
- data/spec/espago/error_spec.rb +4 -3
- data/spec/espago/response_spec.rb +10 -10
- data/spec/espago/router_spec.rb +5 -6
- data/spec/features/apis_spec.rb +2 -2
- data/spec/features/charges_spec.rb +19 -19
- data/spec/features/charges_spec_with_params_spec.rb +22 -22
- data/spec/features/clients_spec.rb +28 -28
- data/spec/features/dcc_decision_spec.rb +7 -7
- data/spec/features/invoice_items_spec.rb +9 -9
- data/spec/features/invoices_spec.rb +6 -6
- data/spec/features/line_items_spec.rb +5 -5
- data/spec/features/plans_spec.rb +14 -14
- data/spec/features/secure_web_page_register_spec.rb +23 -0
- data/spec/features/subscriptions_spec.rb +13 -13
- data/spec/features/tokens_spec.rb +15 -16
- data/spec/fixtures/cassettes/api_2.yml +1 -1
- data/spec/fixtures/cassettes/api_3.yml +1 -1
- data/spec/fixtures/cassettes/charges_complete.yml +1 -1
- data/spec/fixtures/cassettes/charges_complete_deprecation.yml +1 -1
- data/spec/fixtures/cassettes/charges_destroy.yml +1 -1
- data/spec/fixtures/cassettes/charges_get.yml +1 -1
- data/spec/fixtures/cassettes/charges_get_pay_mTOngouLTJWZ0w.yml +3 -1
- data/spec/fixtures/cassettes/charges_post.yml +3 -1
- data/spec/fixtures/cassettes/charges_refund.yml +3 -1
- data/spec/fixtures/cassettes/clients_authorize.yml +3 -1
- data/spec/fixtures/cassettes/clients_delete.yml +3 -1
- data/spec/fixtures/cassettes/clients_get.yml +3 -1
- data/spec/fixtures/cassettes/clients_get_cli_w0Se2smYwyQ0Uw.yml +3 -1
- data/spec/fixtures/cassettes/clients_invoices.yml +3 -1
- data/spec/fixtures/cassettes/clients_post.yml +3 -1
- data/spec/fixtures/cassettes/clients_put.yml +3 -1
- data/spec/fixtures/cassettes/clients_subscriptions.yml +3 -1
- data/spec/fixtures/cassettes/dcc_decision_post.yml +3 -1
- data/spec/fixtures/cassettes/error_400.yml +3 -1
- data/spec/fixtures/cassettes/error_401.yml +3 -1
- data/spec/fixtures/cassettes/error_500.yml +3 -1
- data/spec/fixtures/cassettes/invoice_items_delete_ii_WDzszvhTshe78Xd.yml +3 -1
- data/spec/fixtures/cassettes/invoice_items_get_ii_5LS-YR7S1QaJBl3.yml +3 -1
- data/spec/fixtures/cassettes/invoice_items_post_ii_5LS-YR7S1QaJBl3.yml +3 -1
- data/spec/fixtures/cassettes/invoices_get.yml +3 -1
- data/spec/fixtures/cassettes/invoices_get_in_tUCMhwlg2nkvAaL.yml +3 -1
- data/spec/fixtures/cassettes/line_items_get.yml +1 -1
- data/spec/fixtures/cassettes/plans_delete.yml +1 -1
- data/spec/fixtures/cassettes/plans_get.yml +1 -1
- data/spec/fixtures/cassettes/plans_get_pl_12345.yml +1 -1
- data/spec/fixtures/cassettes/plans_post.yml +3 -1
- data/spec/fixtures/cassettes/plans_put.yml +3 -1
- data/spec/fixtures/cassettes/secure_web_page_register_post.yml +56 -0
- data/spec/fixtures/cassettes/subscriptions_delete_sub_8yYuCBKdywr7e2.yml +3 -1
- data/spec/fixtures/cassettes/subscriptions_get.yml +1 -1
- data/spec/fixtures/cassettes/subscriptions_get_sub_8yYuCBKdywr7e2.yml +1 -1
- data/spec/fixtures/cassettes/subscriptions_post.yml +3 -1
- data/spec/fixtures/cassettes/tokens_get.yml +3 -1
- data/spec/fixtures/cassettes/tokens_post.yml +3 -1
- data/spec/spec_helper.rb +4 -7
- metadata +58 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 58622fe56f6d0fcdcf4a95e4471b59333ea9ae33361322f8ee96b14df49013f5
|
4
|
+
data.tar.gz: dced9ad9a5fadd4495929a35a534fe50fe7510385a074ad43ce9707cce66c1c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a03a86f370585caf4713df6b350ca38a695ca100240838617686d08e06a6113de589ba5101334fb7c0f6cb5e2c7236cfa9b50cde8052ef00e58d7f7ef8bf88f6
|
7
|
+
data.tar.gz: bb7617c6db025d979a7cd672806e8e4b5447f85099e01b90a573985f5ae650ead9d8093a2c283a6cc4989d42324d82c50c0381b6a83f25d3272d636907184f43
|
data/.travis.yml
CHANGED
@@ -1,10 +1,17 @@
|
|
1
|
+
before_install: bundle update --bundler
|
2
|
+
env:
|
3
|
+
global:
|
4
|
+
- CC_TEST_REPORTER_ID=6c7689ce08533f243c6949aabf49abada63dc24f5e1bf5c4a6dfdb20080b95fa
|
1
5
|
language: ruby
|
2
6
|
rvm:
|
3
|
-
-
|
4
|
-
-
|
5
|
-
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
- 2.4.6
|
8
|
+
- 2.5.5
|
9
|
+
- 2.6.2
|
10
|
+
before_script:
|
11
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
12
|
+
- chmod +x ./cc-test-reporter
|
13
|
+
- ./cc-test-reporter before-build
|
14
|
+
script:
|
15
|
+
- bundle exec rspec
|
16
|
+
after_script:
|
17
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,154 +1,278 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
espago (0.1.
|
4
|
+
espago (0.1.10)
|
5
5
|
facets
|
6
|
-
faraday
|
6
|
+
faraday (>= 2.0.0)
|
7
|
+
json (>= 2.3.1)
|
7
8
|
rails
|
8
9
|
|
9
10
|
GEM
|
10
11
|
remote: https://rubygems.org/
|
11
12
|
specs:
|
12
|
-
|
13
|
-
actionpack (=
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
rspec
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
13
|
+
actioncable (7.0.4.3)
|
14
|
+
actionpack (= 7.0.4.3)
|
15
|
+
activesupport (= 7.0.4.3)
|
16
|
+
nio4r (~> 2.0)
|
17
|
+
websocket-driver (>= 0.6.1)
|
18
|
+
actionmailbox (7.0.4.3)
|
19
|
+
actionpack (= 7.0.4.3)
|
20
|
+
activejob (= 7.0.4.3)
|
21
|
+
activerecord (= 7.0.4.3)
|
22
|
+
activestorage (= 7.0.4.3)
|
23
|
+
activesupport (= 7.0.4.3)
|
24
|
+
mail (>= 2.7.1)
|
25
|
+
net-imap
|
26
|
+
net-pop
|
27
|
+
net-smtp
|
28
|
+
actionmailer (7.0.4.3)
|
29
|
+
actionpack (= 7.0.4.3)
|
30
|
+
actionview (= 7.0.4.3)
|
31
|
+
activejob (= 7.0.4.3)
|
32
|
+
activesupport (= 7.0.4.3)
|
33
|
+
mail (~> 2.5, >= 2.5.4)
|
34
|
+
net-imap
|
35
|
+
net-pop
|
36
|
+
net-smtp
|
37
|
+
rails-dom-testing (~> 2.0)
|
38
|
+
actionpack (7.0.4.3)
|
39
|
+
actionview (= 7.0.4.3)
|
40
|
+
activesupport (= 7.0.4.3)
|
41
|
+
rack (~> 2.0, >= 2.2.0)
|
42
|
+
rack-test (>= 0.6.3)
|
43
|
+
rails-dom-testing (~> 2.0)
|
44
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
45
|
+
actiontext (7.0.4.3)
|
46
|
+
actionpack (= 7.0.4.3)
|
47
|
+
activerecord (= 7.0.4.3)
|
48
|
+
activestorage (= 7.0.4.3)
|
49
|
+
activesupport (= 7.0.4.3)
|
50
|
+
globalid (>= 0.6.0)
|
51
|
+
nokogiri (>= 1.8.5)
|
52
|
+
actionview (7.0.4.3)
|
53
|
+
activesupport (= 7.0.4.3)
|
54
|
+
builder (~> 3.1)
|
55
|
+
erubi (~> 1.4)
|
56
|
+
rails-dom-testing (~> 2.0)
|
57
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
58
|
+
activejob (7.0.4.3)
|
59
|
+
activesupport (= 7.0.4.3)
|
60
|
+
globalid (>= 0.3.6)
|
61
|
+
activemodel (7.0.4.3)
|
62
|
+
activesupport (= 7.0.4.3)
|
63
|
+
activerecord (7.0.4.3)
|
64
|
+
activemodel (= 7.0.4.3)
|
65
|
+
activesupport (= 7.0.4.3)
|
66
|
+
activestorage (7.0.4.3)
|
67
|
+
actionpack (= 7.0.4.3)
|
68
|
+
activejob (= 7.0.4.3)
|
69
|
+
activerecord (= 7.0.4.3)
|
70
|
+
activesupport (= 7.0.4.3)
|
71
|
+
marcel (~> 1.0)
|
72
|
+
mini_mime (>= 1.1.0)
|
73
|
+
activesupport (7.0.4.3)
|
74
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
75
|
+
i18n (>= 1.6, < 2)
|
76
|
+
minitest (>= 5.1)
|
77
|
+
tzinfo (~> 2.0)
|
78
|
+
addressable (2.8.0)
|
79
|
+
public_suffix (>= 2.0.2, < 5.0)
|
80
|
+
ast (2.4.2)
|
81
|
+
builder (3.2.4)
|
82
|
+
byebug (11.1.3)
|
83
|
+
coderay (1.1.3)
|
84
|
+
concurrent-ruby (1.2.2)
|
85
|
+
crack (0.4.5)
|
86
|
+
rexml
|
87
|
+
crass (1.0.6)
|
88
|
+
date (3.3.3)
|
89
|
+
diff-lcs (1.5.0)
|
90
|
+
docile (1.4.0)
|
91
|
+
erubi (1.12.0)
|
92
|
+
facets (3.1.0)
|
93
|
+
faraday (2.7.3)
|
94
|
+
faraday-net_http (>= 2.0, < 3.1)
|
95
|
+
ruby2_keywords (>= 0.0.4)
|
96
|
+
faraday-net_http (3.0.2)
|
97
|
+
ffi (1.15.5)
|
98
|
+
formatador (1.1.0)
|
99
|
+
fuubar (2.5.1)
|
100
|
+
rspec-core (~> 3.0)
|
101
|
+
ruby-progressbar (~> 1.4)
|
102
|
+
globalid (1.1.0)
|
103
|
+
activesupport (>= 5.0)
|
104
|
+
guard (2.18.0)
|
105
|
+
formatador (>= 0.2.4)
|
106
|
+
listen (>= 2.7, < 4.0)
|
107
|
+
lumberjack (>= 1.0.12, < 2.0)
|
108
|
+
nenv (~> 0.1)
|
109
|
+
notiffany (~> 0.0)
|
110
|
+
pry (>= 0.13.0)
|
111
|
+
shellany (~> 0.0)
|
112
|
+
thor (>= 0.18.1)
|
113
|
+
guard-compat (1.2.1)
|
114
|
+
guard-rspec (4.7.3)
|
115
|
+
guard (~> 2.1)
|
116
|
+
guard-compat (~> 1.1)
|
117
|
+
rspec (>= 2.99.0, < 4.0)
|
118
|
+
hashdiff (1.0.1)
|
119
|
+
i18n (1.12.0)
|
120
|
+
concurrent-ruby (~> 1.0)
|
121
|
+
json (2.6.3)
|
122
|
+
language_server-protocol (3.16.0.3)
|
123
|
+
listen (3.0.8)
|
124
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
125
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
126
|
+
loofah (2.19.1)
|
127
|
+
crass (~> 1.0.2)
|
128
|
+
nokogiri (>= 1.5.9)
|
129
|
+
lumberjack (1.2.8)
|
130
|
+
mail (2.8.1)
|
131
|
+
mini_mime (>= 0.1.1)
|
132
|
+
net-imap
|
133
|
+
net-pop
|
134
|
+
net-smtp
|
135
|
+
marcel (1.0.2)
|
136
|
+
method_source (1.0.0)
|
137
|
+
mini_mime (1.1.2)
|
138
|
+
minitest (5.18.0)
|
139
|
+
nenv (0.3.0)
|
140
|
+
net-imap (0.3.4)
|
141
|
+
date
|
142
|
+
net-protocol
|
143
|
+
net-pop (0.1.2)
|
144
|
+
net-protocol
|
145
|
+
net-protocol (0.2.1)
|
146
|
+
timeout
|
147
|
+
net-smtp (0.3.3)
|
148
|
+
net-protocol
|
149
|
+
nio4r (2.5.8)
|
150
|
+
nokogiri (1.14.2-arm64-darwin)
|
151
|
+
racc (~> 1.4)
|
152
|
+
notiffany (0.1.3)
|
153
|
+
nenv (~> 0.1)
|
154
|
+
shellany (~> 0.0)
|
155
|
+
parallel (1.22.1)
|
156
|
+
parser (3.1.2.0)
|
157
|
+
ast (~> 2.4.1)
|
158
|
+
prettier_print (0.1.0)
|
159
|
+
pry (0.14.1)
|
160
|
+
coderay (~> 1.1)
|
161
|
+
method_source (~> 1.0)
|
162
|
+
public_suffix (4.0.7)
|
163
|
+
racc (1.6.2)
|
164
|
+
rack (2.2.6.4)
|
165
|
+
rack-test (2.1.0)
|
166
|
+
rack (>= 1.3)
|
167
|
+
rails (7.0.4.3)
|
168
|
+
actioncable (= 7.0.4.3)
|
169
|
+
actionmailbox (= 7.0.4.3)
|
170
|
+
actionmailer (= 7.0.4.3)
|
171
|
+
actionpack (= 7.0.4.3)
|
172
|
+
actiontext (= 7.0.4.3)
|
173
|
+
actionview (= 7.0.4.3)
|
174
|
+
activejob (= 7.0.4.3)
|
175
|
+
activemodel (= 7.0.4.3)
|
176
|
+
activerecord (= 7.0.4.3)
|
177
|
+
activestorage (= 7.0.4.3)
|
178
|
+
activesupport (= 7.0.4.3)
|
179
|
+
bundler (>= 1.15.0)
|
180
|
+
railties (= 7.0.4.3)
|
181
|
+
rails-dom-testing (2.0.3)
|
182
|
+
activesupport (>= 4.2.0)
|
183
|
+
nokogiri (>= 1.6)
|
184
|
+
rails-html-sanitizer (1.5.0)
|
185
|
+
loofah (~> 2.19, >= 2.19.1)
|
186
|
+
railties (7.0.4.3)
|
187
|
+
actionpack (= 7.0.4.3)
|
188
|
+
activesupport (= 7.0.4.3)
|
189
|
+
method_source
|
190
|
+
rake (>= 12.2)
|
191
|
+
thor (~> 1.0)
|
192
|
+
zeitwerk (~> 2.5)
|
193
|
+
rainbow (3.1.1)
|
194
|
+
rake (13.0.6)
|
195
|
+
rb-fsevent (0.9.8)
|
196
|
+
rb-inotify (0.10.1)
|
197
|
+
ffi (~> 1.0)
|
198
|
+
regexp_parser (2.5.0)
|
199
|
+
rexml (3.2.5)
|
200
|
+
rspec (3.11.0)
|
201
|
+
rspec-core (~> 3.11.0)
|
202
|
+
rspec-expectations (~> 3.11.0)
|
203
|
+
rspec-mocks (~> 3.11.0)
|
204
|
+
rspec-core (3.11.0)
|
205
|
+
rspec-support (~> 3.11.0)
|
206
|
+
rspec-expectations (3.11.0)
|
207
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
208
|
+
rspec-support (~> 3.11.0)
|
209
|
+
rspec-its (1.3.0)
|
210
|
+
rspec-core (>= 3.0.0)
|
211
|
+
rspec-expectations (>= 3.0.0)
|
212
|
+
rspec-mocks (3.11.1)
|
213
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
214
|
+
rspec-support (~> 3.11.0)
|
215
|
+
rspec-support (3.11.0)
|
216
|
+
rubocop (1.30.1)
|
217
|
+
parallel (~> 1.10)
|
218
|
+
parser (>= 3.1.0.0)
|
219
|
+
rainbow (>= 2.2.2, < 4.0)
|
220
|
+
regexp_parser (>= 1.8, < 3.0)
|
221
|
+
rexml (>= 3.2.5, < 4.0)
|
222
|
+
rubocop-ast (>= 1.18.0, < 2.0)
|
223
|
+
ruby-progressbar (~> 1.7)
|
224
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
225
|
+
rubocop-ast (1.18.0)
|
226
|
+
parser (>= 3.1.1.0)
|
227
|
+
ruby-lsp (0.1.0)
|
228
|
+
language_server-protocol
|
229
|
+
rubocop (>= 1.0)
|
230
|
+
sorbet-runtime
|
231
|
+
syntax_tree (>= 2.4)
|
232
|
+
ruby-progressbar (1.11.0)
|
233
|
+
ruby2_keywords (0.0.5)
|
234
|
+
shellany (0.0.1)
|
235
|
+
simplecov (0.21.2)
|
236
|
+
docile (~> 1.1)
|
237
|
+
simplecov-html (~> 0.11)
|
238
|
+
simplecov_json_formatter (~> 0.1)
|
239
|
+
simplecov-html (0.12.3)
|
240
|
+
simplecov_json_formatter (0.1.4)
|
241
|
+
sorbet-runtime (0.5.10109)
|
242
|
+
syntax_tree (2.8.0)
|
243
|
+
prettier_print
|
244
|
+
thor (1.2.1)
|
245
|
+
timeout (0.3.2)
|
246
|
+
tzinfo (2.0.6)
|
247
|
+
concurrent-ruby (~> 1.0)
|
248
|
+
unicode-display_width (2.1.0)
|
249
|
+
vcr (6.1.0)
|
250
|
+
webmock (3.14.0)
|
251
|
+
addressable (>= 2.8.0)
|
138
252
|
crack (>= 0.3.2)
|
253
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
254
|
+
websocket-driver (0.7.5)
|
255
|
+
websocket-extensions (>= 0.1.0)
|
256
|
+
websocket-extensions (0.1.5)
|
257
|
+
zeitwerk (2.6.7)
|
139
258
|
|
140
259
|
PLATFORMS
|
141
260
|
ruby
|
142
261
|
|
143
262
|
DEPENDENCIES
|
144
|
-
|
263
|
+
byebug
|
145
264
|
espago!
|
146
265
|
fuubar
|
147
266
|
guard-rspec
|
148
267
|
pry
|
149
268
|
rake
|
150
269
|
rb-fsevent (~> 0.9.1)
|
151
|
-
rspec
|
270
|
+
rspec (>= 3.11.0)
|
271
|
+
rspec-its
|
272
|
+
ruby-lsp (~> 0.1.0)
|
152
273
|
simplecov
|
153
274
|
vcr
|
154
275
|
webmock
|
276
|
+
|
277
|
+
BUNDLED WITH
|
278
|
+
2.3.3
|
data/README.md
CHANGED
@@ -3,8 +3,6 @@ Espago gem
|
|
3
3
|
|
4
4
|
[](https://travis-ci.org/espago/espago)
|
5
5
|
[](http://badge.fury.io/rb/espago)
|
6
|
-
[](https://codeclimate.com/github/espago/espago)
|
7
|
-
[](https://codeclimate.com/github/espago/espago)
|
8
6
|
|
9
7
|
### Installing Espago gem
|
10
8
|
|
@@ -14,7 +12,7 @@ or just add it to your Gemfile if you are running a Rails project
|
|
14
12
|
|
15
13
|
## Configuration
|
16
14
|
|
17
|
-
After registering at <http://espago.com> configure your app with the security credentials. More information about configuration of merchant account you can find in our documentation <https://espago.com/
|
15
|
+
After registering at <http://espago.com> configure your app with the security credentials. More information about configuration of merchant account you can find in our documentation <https://developers.espago.com/en>
|
18
16
|
|
19
17
|
The most standard way of configuring Espago is to do it globally on the Espago class.
|
20
18
|
|
@@ -22,7 +20,7 @@ The most standard way of configuring Espago is to do it globally on the Espago c
|
|
22
20
|
Espago.app_password = 'your-espago-secret'
|
23
21
|
Espago.public_key = 'your-espago-key'
|
24
22
|
Espago.production = false #sets Espago enviroment to sandbox
|
25
|
-
Espago.api_version =
|
23
|
+
Espago.api_version = 3
|
26
24
|
|
27
25
|
## Sending request
|
28
26
|
|
@@ -31,9 +29,9 @@ The first possibility is to call everytime send_request() function with proper p
|
|
31
29
|
|
32
30
|
Espago.send_request path, request_type, [parameters]
|
33
31
|
|
34
|
-
Here it is an example of using this way to create new client:
|
32
|
+
Here it is an example of using this way to create new client (read how to created token_id at https://github.com/espago/espago-1.2.js-demo) :
|
35
33
|
|
36
|
-
Espago.send_request :clients, :post, {description: "Jan Kowalski", email: "kowalski@example.com", card:
|
34
|
+
Espago.send_request :clients, :post, {description: "Jan Kowalski", email: "kowalski@example.com", card: 'token_id'}
|
37
35
|
|
38
36
|
The second possible way to sending requests by Espago gem is to call the proper path on Espago object, using specific HTTP method and setting chosen parameteres.
|
39
37
|
|
@@ -41,7 +39,7 @@ The second possible way to sending requests by Espago gem is to call the proper
|
|
41
39
|
|
42
40
|
Below, it is an example of using this possibility to create new client:
|
43
41
|
|
44
|
-
Espago.clients :post, {description: "Jan Kowalski", email: "kowalski@example.com", card:
|
42
|
+
Espago.clients :post, {description: "Jan Kowalski", email: "kowalski@example.com", card: 'token_id'}
|
45
43
|
|
46
44
|
## Getting response
|
47
45
|
|
@@ -49,7 +47,7 @@ Every returned object includes informations about header and body of response.
|
|
49
47
|
|
50
48
|
For example for request:
|
51
49
|
|
52
|
-
client = Espago.clients :post, {description: "Jan Kowalski", email: "kowalski@example.com", card:
|
50
|
+
client = Espago.clients :post, {description: "Jan Kowalski", email: "kowalski@example.com", card: 'token_id'}
|
53
51
|
|
54
52
|
Espago returns an special response object:
|
55
53
|
|
@@ -117,24 +115,24 @@ Now if you want get customer's e-mail(or anoher field in 1st level of response)
|
|
117
115
|
<th>Parameter</th><th>Description</th><th>Documentation link</th>
|
118
116
|
</tr>
|
119
117
|
<tr>
|
120
|
-
<th>tokens</th><td>special id for credit card</td><td>https://developers.espago.com/en/
|
118
|
+
<th>tokens</th><td>special id for credit card</td><td>https://developers.espago.com/en/v3#244-card-tokens</td>
|
121
119
|
</tr>
|
122
120
|
<tr>
|
123
|
-
<th>clients</th><td>clients data</td><td>https://developers.espago.com/en/
|
121
|
+
<th>clients</th><td>clients data</td><td>https://developers.espago.com/en/v3#255-customers</td>
|
124
122
|
</tr>
|
125
123
|
<tr>
|
126
|
-
<th>charges</th><td>credit payments</td><td>https://developers.espago.com/en/
|
124
|
+
<th>charges</th><td>credit payments</td><td>https://developers.espago.com/en/v3#209-card-payments</td>
|
127
125
|
</tr>
|
128
126
|
<tr>
|
129
|
-
<th>plans</th><td>plans for recurring payments</td><td>https://developers.espago.com/en/
|
127
|
+
<th>plans</th><td>plans for recurring payments</td><td>https://developers.espago.com/en/v3#222-plans</td>
|
130
128
|
</tr>
|
131
129
|
<tr>
|
132
|
-
<th>subscriptions</th><td>recurring payments for client according to the created plan</td><td>https://developers.espago.com/en/
|
130
|
+
<th>subscriptions</th><td>recurring payments for client according to the created plan</td><td>https://developers.espago.com/en/v3#228-subscriptions</td>
|
133
131
|
</tr>
|
134
132
|
<tr>
|
135
|
-
<th>invoices</th><td>single recurring payment</td><td>https://developers.espago.com/en/
|
133
|
+
<th>invoices</th><td>single recurring payment</td><td>https://developers.espago.com/en/v3#234-invoices</td>
|
136
134
|
</tr>
|
137
135
|
<tr>
|
138
|
-
<th>line_items</th><td>element of every invoice</td><td>https://developers.espago.com/en/
|
136
|
+
<th>line_items</th><td>element of every invoice</td><td>https://developers.espago.com/en/v3#241-getting-informations-about-line-items-of-invoice</td>
|
139
137
|
</tr>
|
140
138
|
</table>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
= hidden_field_tag 'api_version', data[:api_version]
|
3
3
|
= hidden_field_tag 'app_id', data[:app_id]
|
4
4
|
= hidden_field_tag 'kind', data[:kind]
|
5
|
-
|
5
|
+
|
6
6
|
= hidden_field_tag 'session_id', data[:session_id]
|
7
7
|
= hidden_field_tag 'amount', data[:amount]
|
8
8
|
= hidden_field_tag 'currency', data[:currency]
|
@@ -12,8 +12,9 @@
|
|
12
12
|
= hidden_field_tag 'email', data[:email]
|
13
13
|
= hidden_field_tag 'positive_url', data[:positive_url]
|
14
14
|
= hidden_field_tag 'negative_url', data[:negative_url]
|
15
|
-
|
15
|
+
|
16
16
|
= hidden_field_tag 'ts', data[:ts]
|
17
|
+
= hidden_field_tag 'service_client_id', data[:service_client_id]
|
17
18
|
= hidden_field_tag 'checksum', data[:checksum]
|
18
19
|
- data[:shopping_cart_items].each_with_index do |shopping_cart_item,index|
|
19
20
|
= hidden_field_tag "shopping_cart_items[#{index}][description]", shopping_cart_item[:description]
|
data/espago.gemspec
CHANGED
@@ -1,27 +1,30 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require 'espago/version'
|
5
4
|
|
6
5
|
Gem::Specification.new do |gem|
|
7
|
-
gem.name =
|
6
|
+
gem.name = 'espago'
|
8
7
|
gem.version = Espago::VERSION
|
9
|
-
|
8
|
+
|
9
|
+
gem.authors = ["Piotrek", "Szymon Fiedler","Waclaw Luczak", "faramund"]
|
10
10
|
gem.email = ["developers@espago.com"]
|
11
11
|
gem.description = %q{Espago api wrapper}
|
12
12
|
gem.summary = %q{Espago api wrapper}
|
13
13
|
gem.homepage = ""
|
14
14
|
|
15
|
-
gem.files = `git ls-files`.split(
|
16
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
15
|
+
gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
-
gem.require_paths = [
|
18
|
+
gem.require_paths = ['lib']
|
19
19
|
|
20
|
-
gem.add_dependency "faraday"
|
20
|
+
gem.add_dependency "faraday", '>= 2.0.0'
|
21
|
+
gem.add_dependency "json", '>= 2.3.1'
|
21
22
|
gem.add_dependency "facets"
|
22
23
|
gem.add_dependency "rails"
|
23
24
|
|
24
|
-
gem.add_development_dependency "rspec"
|
25
|
+
gem.add_development_dependency "rspec", '>= 3.11.0'
|
26
|
+
gem.add_development_dependency 'rspec-its'
|
27
|
+
gem.add_development_dependency "byebug"
|
25
28
|
gem.add_development_dependency "pry"
|
26
29
|
gem.add_development_dependency "guard-rspec"
|
27
30
|
gem.add_development_dependency "simplecov"
|
@@ -30,7 +33,5 @@ Gem::Specification.new do |gem|
|
|
30
33
|
gem.add_development_dependency 'rb-fsevent', '~> 0.9.1'
|
31
34
|
gem.add_development_dependency 'webmock'
|
32
35
|
gem.add_development_dependency 'vcr'
|
33
|
-
gem.add_development_dependency 'codeclimate-test-reporter'
|
34
|
-
|
35
|
-
|
36
|
+
# gem.add_development_dependency 'codeclimate-test-reporter'
|
36
37
|
end
|