espago 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +15 -8
  3. data/Gemfile +2 -0
  4. data/Gemfile.lock +259 -130
  5. data/README.md +13 -15
  6. data/app/views/espago_secure_web_page/_form.html.haml +3 -2
  7. data/espago.gemspec +13 -12
  8. data/lib/espago/api_connection/charges_complete_post.rb +1 -1
  9. data/lib/espago/api_connection/refunds_post.rb +9 -0
  10. data/lib/espago/api_connection/secure_web_page_register_post.rb +9 -0
  11. data/lib/espago/api_connection/tokens_post.rb +1 -1
  12. data/lib/espago/api_connection/visacheckout_post.rb +9 -0
  13. data/lib/espago/api_connection.rb +4 -2
  14. data/lib/espago/client.rb +5 -6
  15. data/lib/espago/secure_web_page.rb +13 -10
  16. data/lib/espago/version.rb +1 -1
  17. data/spec/espago/api_connection_spec.rb +1 -1
  18. data/spec/espago/back_request_spec.rb +11 -11
  19. data/spec/espago/client_spec.rb +8 -8
  20. data/spec/espago/error_spec.rb +4 -3
  21. data/spec/espago/response_spec.rb +10 -10
  22. data/spec/espago/router_spec.rb +5 -6
  23. data/spec/features/apis_spec.rb +2 -2
  24. data/spec/features/charges_spec.rb +19 -19
  25. data/spec/features/charges_spec_with_params_spec.rb +22 -22
  26. data/spec/features/clients_spec.rb +28 -28
  27. data/spec/features/dcc_decision_spec.rb +7 -7
  28. data/spec/features/invoice_items_spec.rb +9 -9
  29. data/spec/features/invoices_spec.rb +6 -6
  30. data/spec/features/line_items_spec.rb +5 -5
  31. data/spec/features/plans_spec.rb +14 -14
  32. data/spec/features/secure_web_page_register_spec.rb +23 -0
  33. data/spec/features/subscriptions_spec.rb +13 -13
  34. data/spec/features/tokens_spec.rb +15 -16
  35. data/spec/fixtures/cassettes/api_2.yml +1 -1
  36. data/spec/fixtures/cassettes/api_3.yml +1 -1
  37. data/spec/fixtures/cassettes/charges_complete.yml +1 -1
  38. data/spec/fixtures/cassettes/charges_complete_deprecation.yml +1 -1
  39. data/spec/fixtures/cassettes/charges_destroy.yml +1 -1
  40. data/spec/fixtures/cassettes/charges_get.yml +1 -1
  41. data/spec/fixtures/cassettes/charges_get_pay_mTOngouLTJWZ0w.yml +3 -1
  42. data/spec/fixtures/cassettes/charges_post.yml +3 -1
  43. data/spec/fixtures/cassettes/charges_refund.yml +3 -1
  44. data/spec/fixtures/cassettes/clients_authorize.yml +3 -1
  45. data/spec/fixtures/cassettes/clients_delete.yml +3 -1
  46. data/spec/fixtures/cassettes/clients_get.yml +3 -1
  47. data/spec/fixtures/cassettes/clients_get_cli_w0Se2smYwyQ0Uw.yml +3 -1
  48. data/spec/fixtures/cassettes/clients_invoices.yml +3 -1
  49. data/spec/fixtures/cassettes/clients_post.yml +3 -1
  50. data/spec/fixtures/cassettes/clients_put.yml +3 -1
  51. data/spec/fixtures/cassettes/clients_subscriptions.yml +3 -1
  52. data/spec/fixtures/cassettes/dcc_decision_post.yml +3 -1
  53. data/spec/fixtures/cassettes/error_400.yml +3 -1
  54. data/spec/fixtures/cassettes/error_401.yml +3 -1
  55. data/spec/fixtures/cassettes/error_500.yml +3 -1
  56. data/spec/fixtures/cassettes/invoice_items_delete_ii_WDzszvhTshe78Xd.yml +3 -1
  57. data/spec/fixtures/cassettes/invoice_items_get_ii_5LS-YR7S1QaJBl3.yml +3 -1
  58. data/spec/fixtures/cassettes/invoice_items_post_ii_5LS-YR7S1QaJBl3.yml +3 -1
  59. data/spec/fixtures/cassettes/invoices_get.yml +3 -1
  60. data/spec/fixtures/cassettes/invoices_get_in_tUCMhwlg2nkvAaL.yml +3 -1
  61. data/spec/fixtures/cassettes/line_items_get.yml +1 -1
  62. data/spec/fixtures/cassettes/plans_delete.yml +1 -1
  63. data/spec/fixtures/cassettes/plans_get.yml +1 -1
  64. data/spec/fixtures/cassettes/plans_get_pl_12345.yml +1 -1
  65. data/spec/fixtures/cassettes/plans_post.yml +3 -1
  66. data/spec/fixtures/cassettes/plans_put.yml +3 -1
  67. data/spec/fixtures/cassettes/secure_web_page_register_post.yml +56 -0
  68. data/spec/fixtures/cassettes/subscriptions_delete_sub_8yYuCBKdywr7e2.yml +3 -1
  69. data/spec/fixtures/cassettes/subscriptions_get.yml +1 -1
  70. data/spec/fixtures/cassettes/subscriptions_get_sub_8yYuCBKdywr7e2.yml +1 -1
  71. data/spec/fixtures/cassettes/subscriptions_post.yml +3 -1
  72. data/spec/fixtures/cassettes/tokens_get.yml +3 -1
  73. data/spec/fixtures/cassettes/tokens_post.yml +3 -1
  74. data/spec/spec_helper.rb +4 -7
  75. metadata +58 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 9c90725a6354df09346f5e47d7a47d89fc7af563
4
- data.tar.gz: 65649ff9aac8ce18cd04d1623a11fa8c55a40e12
2
+ SHA256:
3
+ metadata.gz: 6cecfc3e61851881b307347b5db67843c55f2666af1c08a2ed874bdeb56afd58
4
+ data.tar.gz: 6e75c9b9a03fa8d32e6923154a30ba6af8fe651da1311b67c22b7772405f0e1b
5
5
  SHA512:
6
- metadata.gz: 518ef7b212cb3e789d4cd24bc992e8515bc01516d0ea5db5c1c97d3f75c43bdb89142220586aff3f92878a9d6508c51205071bcd8cff88e6d1fd1636d07cfaf0
7
- data.tar.gz: 9da66c2cba20692a5821dd094c0cf30337767b9f3c7fdd17ee818a0e2a8864f3328ff6e7695e5a3ab45b81ac368f0d47c6ba52c0ed0a0def396dabd8cfb71d05
6
+ metadata.gz: '0971aacc3c040da88abc8b6c8d4d1cb201ae6cd68ee85916725d0b3bff22e5d7d6c62ab1ec09ebae3e99a5c6b7b61c6787c28493e40b47cd2888049c09caae60'
7
+ data.tar.gz: d68e32f6a39be3a5e8044f4234d6b2f905e47262b35dc61869e78629b1f359472f357861f3cc693117eea1cd079974687a30a1082282b12102f4cdc90d6f626d
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
- - "2.1.10"
4
- - "2.2.5"
5
- - "2.3.1"
6
-
7
- addons:
8
- code_climate:
9
- repo_token:
10
- secure: 6c7689ce08533f243c6949aabf49abada63dc24f5e1bf5c4a6dfdb20080b95fa
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
@@ -2,3 +2,5 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in espago.gemspec
4
4
  gemspec
5
+
6
+ gem "ruby-lsp", "~> 0.1.0", :group => :development
data/Gemfile.lock CHANGED
@@ -1,154 +1,283 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- espago (0.1.8)
4
+ espago (0.1.9)
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
- actionmailer (3.2.22)
13
- actionpack (= 3.2.22)
14
- mail (~> 2.5.4)
15
- actionpack (3.2.22)
16
- activemodel (= 3.2.22)
17
- activesupport (= 3.2.22)
18
- builder (~> 3.0.0)
19
- erubis (~> 2.7.0)
20
- journey (~> 1.0.4)
21
- rack (~> 1.4.5)
22
- rack-cache (~> 1.2)
23
- rack-test (~> 0.6.1)
24
- sprockets (~> 2.2.1)
25
- activemodel (3.2.22)
26
- activesupport (= 3.2.22)
27
- builder (~> 3.0.0)
28
- activerecord (3.2.22)
29
- activemodel (= 3.2.22)
30
- activesupport (= 3.2.22)
31
- arel (~> 3.0.2)
32
- tzinfo (~> 0.3.29)
33
- activeresource (3.2.22)
34
- activemodel (= 3.2.22)
35
- activesupport (= 3.2.22)
36
- activesupport (3.2.22)
37
- i18n (~> 0.6, >= 0.6.4)
38
- multi_json (~> 1.0)
39
- addressable (2.3.6)
40
- arel (3.0.3)
41
- builder (3.0.4)
42
- codeclimate-test-reporter (0.4.1)
43
- simplecov (>= 0.7.1, < 1.0.0)
44
- coderay (1.0.8)
45
- crack (0.4.2)
46
- safe_yaml (~> 1.0.0)
47
- diff-lcs (1.1.3)
48
- erubis (2.7.0)
49
- facets (2.9.3)
50
- faraday (0.8.7)
51
- multipart-post (~> 1.1)
52
- fuubar (1.1.0)
53
- rspec (~> 2.0)
54
- rspec-instafail (~> 0.2.0)
55
- ruby-progressbar (~> 1.0.0)
56
- guard (1.6.1)
57
- listen (>= 0.6.0)
58
- lumberjack (>= 1.0.2)
59
- pry (>= 0.9.10)
60
- thor (>= 0.14.6)
61
- guard-rspec (2.3.3)
62
- guard (>= 1.1)
63
- rspec (~> 2.11)
64
- hike (1.2.3)
65
- i18n (0.7.0)
66
- journey (1.0.4)
67
- json (1.8.3)
68
- listen (0.7.2)
69
- lumberjack (1.0.2)
70
- mail (2.5.4)
71
- mime-types (~> 1.16)
72
- treetop (~> 1.4.8)
73
- method_source (0.8.1)
74
- mime-types (1.25.1)
75
- multi_json (1.5.0)
76
- multipart-post (1.2.0)
77
- polyglot (0.3.5)
78
- pry (0.9.10)
79
- coderay (~> 1.0.5)
80
- method_source (~> 0.8)
81
- slop (~> 3.3.1)
82
- rack (1.4.7)
83
- rack-cache (1.2)
84
- rack (>= 0.4)
85
- rack-ssl (1.3.4)
86
- rack
87
- rack-test (0.6.3)
88
- rack (>= 1.0)
89
- rails (3.2.22)
90
- actionmailer (= 3.2.22)
91
- actionpack (= 3.2.22)
92
- activerecord (= 3.2.22)
93
- activeresource (= 3.2.22)
94
- activesupport (= 3.2.22)
95
- bundler (~> 1.0)
96
- railties (= 3.2.22)
97
- railties (3.2.22)
98
- actionpack (= 3.2.22)
99
- activesupport (= 3.2.22)
100
- rack-ssl (~> 1.3.2)
101
- rake (>= 0.8.7)
102
- rdoc (~> 3.4)
103
- thor (>= 0.14.6, < 2.0)
104
- rake (10.0.2)
105
- rb-fsevent (0.9.3)
106
- rdoc (3.12.2)
107
- json (~> 1.4)
108
- rspec (2.12.0)
109
- rspec-core (~> 2.12.0)
110
- rspec-expectations (~> 2.12.0)
111
- rspec-mocks (~> 2.12.0)
112
- rspec-core (2.12.2)
113
- rspec-expectations (2.12.1)
114
- diff-lcs (~> 1.1.3)
115
- rspec-instafail (0.2.4)
116
- rspec-mocks (2.12.1)
117
- ruby-progressbar (1.0.2)
118
- safe_yaml (1.0.4)
119
- simplecov (0.7.1)
120
- multi_json (~> 1.0)
121
- simplecov-html (~> 0.7.1)
122
- simplecov-html (0.7.1)
123
- slop (3.3.3)
124
- sprockets (2.2.3)
125
- hike (~> 1.2)
126
- multi_json (~> 1.0)
127
- rack (~> 1.0)
128
- tilt (~> 1.1, != 1.3.0)
129
- thor (0.16.0)
130
- tilt (1.4.1)
131
- treetop (1.4.15)
132
- polyglot
133
- polyglot (>= 0.3.1)
134
- tzinfo (0.3.44)
135
- vcr (2.9.3)
136
- webmock (1.20.4)
137
- addressable (>= 2.3.6)
13
+ actioncable (7.0.3)
14
+ actionpack (= 7.0.3)
15
+ activesupport (= 7.0.3)
16
+ nio4r (~> 2.0)
17
+ websocket-driver (>= 0.6.1)
18
+ actionmailbox (7.0.3)
19
+ actionpack (= 7.0.3)
20
+ activejob (= 7.0.3)
21
+ activerecord (= 7.0.3)
22
+ activestorage (= 7.0.3)
23
+ activesupport (= 7.0.3)
24
+ mail (>= 2.7.1)
25
+ net-imap
26
+ net-pop
27
+ net-smtp
28
+ actionmailer (7.0.3)
29
+ actionpack (= 7.0.3)
30
+ actionview (= 7.0.3)
31
+ activejob (= 7.0.3)
32
+ activesupport (= 7.0.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.3)
39
+ actionview (= 7.0.3)
40
+ activesupport (= 7.0.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.3)
46
+ actionpack (= 7.0.3)
47
+ activerecord (= 7.0.3)
48
+ activestorage (= 7.0.3)
49
+ activesupport (= 7.0.3)
50
+ globalid (>= 0.6.0)
51
+ nokogiri (>= 1.8.5)
52
+ actionview (7.0.3)
53
+ activesupport (= 7.0.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.3)
59
+ activesupport (= 7.0.3)
60
+ globalid (>= 0.3.6)
61
+ activemodel (7.0.3)
62
+ activesupport (= 7.0.3)
63
+ activerecord (7.0.3)
64
+ activemodel (= 7.0.3)
65
+ activesupport (= 7.0.3)
66
+ activestorage (7.0.3)
67
+ actionpack (= 7.0.3)
68
+ activejob (= 7.0.3)
69
+ activerecord (= 7.0.3)
70
+ activesupport (= 7.0.3)
71
+ marcel (~> 1.0)
72
+ mini_mime (>= 1.1.0)
73
+ activesupport (7.0.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.1.10)
85
+ crack (0.4.5)
86
+ rexml
87
+ crass (1.0.6)
88
+ diff-lcs (1.5.0)
89
+ digest (3.1.0)
90
+ docile (1.4.0)
91
+ erubi (1.10.0)
92
+ facets (3.1.0)
93
+ faraday (2.3.0)
94
+ faraday-net_http (~> 2.0)
95
+ ruby2_keywords (>= 0.0.4)
96
+ faraday-net_http (2.0.3)
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.0.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.10.0)
120
+ concurrent-ruby (~> 1.0)
121
+ json (2.6.2)
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.18.0)
127
+ crass (~> 1.0.2)
128
+ nokogiri (>= 1.5.9)
129
+ lumberjack (1.2.8)
130
+ mail (2.7.1)
131
+ mini_mime (>= 0.1.1)
132
+ marcel (1.0.2)
133
+ method_source (1.0.0)
134
+ mini_mime (1.1.2)
135
+ mini_portile2 (2.8.0)
136
+ minitest (5.16.1)
137
+ nenv (0.3.0)
138
+ net-imap (0.2.3)
139
+ digest
140
+ net-protocol
141
+ strscan
142
+ net-pop (0.1.1)
143
+ digest
144
+ net-protocol
145
+ timeout
146
+ net-protocol (0.1.3)
147
+ timeout
148
+ net-smtp (0.3.1)
149
+ digest
150
+ net-protocol
151
+ timeout
152
+ nio4r (2.5.8)
153
+ nokogiri (1.13.6)
154
+ mini_portile2 (~> 2.8.0)
155
+ racc (~> 1.4)
156
+ notiffany (0.1.3)
157
+ nenv (~> 0.1)
158
+ shellany (~> 0.0)
159
+ parallel (1.22.1)
160
+ parser (3.1.2.0)
161
+ ast (~> 2.4.1)
162
+ prettier_print (0.1.0)
163
+ pry (0.14.1)
164
+ coderay (~> 1.1)
165
+ method_source (~> 1.0)
166
+ public_suffix (4.0.7)
167
+ racc (1.6.0)
168
+ rack (2.2.3.1)
169
+ rack-test (1.1.0)
170
+ rack (>= 1.0, < 3)
171
+ rails (7.0.3)
172
+ actioncable (= 7.0.3)
173
+ actionmailbox (= 7.0.3)
174
+ actionmailer (= 7.0.3)
175
+ actionpack (= 7.0.3)
176
+ actiontext (= 7.0.3)
177
+ actionview (= 7.0.3)
178
+ activejob (= 7.0.3)
179
+ activemodel (= 7.0.3)
180
+ activerecord (= 7.0.3)
181
+ activestorage (= 7.0.3)
182
+ activesupport (= 7.0.3)
183
+ bundler (>= 1.15.0)
184
+ railties (= 7.0.3)
185
+ rails-dom-testing (2.0.3)
186
+ activesupport (>= 4.2.0)
187
+ nokogiri (>= 1.6)
188
+ rails-html-sanitizer (1.4.3)
189
+ loofah (~> 2.3)
190
+ railties (7.0.3)
191
+ actionpack (= 7.0.3)
192
+ activesupport (= 7.0.3)
193
+ method_source
194
+ rake (>= 12.2)
195
+ thor (~> 1.0)
196
+ zeitwerk (~> 2.5)
197
+ rainbow (3.1.1)
198
+ rake (13.0.6)
199
+ rb-fsevent (0.9.8)
200
+ rb-inotify (0.10.1)
201
+ ffi (~> 1.0)
202
+ regexp_parser (2.5.0)
203
+ rexml (3.2.5)
204
+ rspec (3.11.0)
205
+ rspec-core (~> 3.11.0)
206
+ rspec-expectations (~> 3.11.0)
207
+ rspec-mocks (~> 3.11.0)
208
+ rspec-core (3.11.0)
209
+ rspec-support (~> 3.11.0)
210
+ rspec-expectations (3.11.0)
211
+ diff-lcs (>= 1.2.0, < 2.0)
212
+ rspec-support (~> 3.11.0)
213
+ rspec-its (1.3.0)
214
+ rspec-core (>= 3.0.0)
215
+ rspec-expectations (>= 3.0.0)
216
+ rspec-mocks (3.11.1)
217
+ diff-lcs (>= 1.2.0, < 2.0)
218
+ rspec-support (~> 3.11.0)
219
+ rspec-support (3.11.0)
220
+ rubocop (1.30.1)
221
+ parallel (~> 1.10)
222
+ parser (>= 3.1.0.0)
223
+ rainbow (>= 2.2.2, < 4.0)
224
+ regexp_parser (>= 1.8, < 3.0)
225
+ rexml (>= 3.2.5, < 4.0)
226
+ rubocop-ast (>= 1.18.0, < 2.0)
227
+ ruby-progressbar (~> 1.7)
228
+ unicode-display_width (>= 1.4.0, < 3.0)
229
+ rubocop-ast (1.18.0)
230
+ parser (>= 3.1.1.0)
231
+ ruby-lsp (0.1.0)
232
+ language_server-protocol
233
+ rubocop (>= 1.0)
234
+ sorbet-runtime
235
+ syntax_tree (>= 2.4)
236
+ ruby-progressbar (1.11.0)
237
+ ruby2_keywords (0.0.5)
238
+ shellany (0.0.1)
239
+ simplecov (0.21.2)
240
+ docile (~> 1.1)
241
+ simplecov-html (~> 0.11)
242
+ simplecov_json_formatter (~> 0.1)
243
+ simplecov-html (0.12.3)
244
+ simplecov_json_formatter (0.1.4)
245
+ sorbet-runtime (0.5.10109)
246
+ strscan (3.0.3)
247
+ syntax_tree (2.8.0)
248
+ prettier_print
249
+ thor (1.2.1)
250
+ timeout (0.3.0)
251
+ tzinfo (2.0.4)
252
+ concurrent-ruby (~> 1.0)
253
+ unicode-display_width (2.1.0)
254
+ vcr (6.1.0)
255
+ webmock (3.14.0)
256
+ addressable (>= 2.8.0)
138
257
  crack (>= 0.3.2)
258
+ hashdiff (>= 0.4.0, < 2.0.0)
259
+ websocket-driver (0.7.5)
260
+ websocket-extensions (>= 0.1.0)
261
+ websocket-extensions (0.1.5)
262
+ zeitwerk (2.6.0)
139
263
 
140
264
  PLATFORMS
141
265
  ruby
142
266
 
143
267
  DEPENDENCIES
144
- codeclimate-test-reporter
268
+ byebug
145
269
  espago!
146
270
  fuubar
147
271
  guard-rspec
148
272
  pry
149
273
  rake
150
274
  rb-fsevent (~> 0.9.1)
151
- rspec
275
+ rspec (>= 3.11.0)
276
+ rspec-its
277
+ ruby-lsp (~> 0.1.0)
152
278
  simplecov
153
279
  vcr
154
280
  webmock
281
+
282
+ BUNDLED WITH
283
+ 1.17.3
data/README.md CHANGED
@@ -3,8 +3,6 @@ Espago gem
3
3
 
4
4
  [![Build Status](https://travis-ci.org/espago/espago.png?branch=master)](https://travis-ci.org/espago/espago)
5
5
  [![Gem Version](https://badge.fury.io/rb/espago.svg)](http://badge.fury.io/rb/espago)
6
- [![Code Climate](https://codeclimate.com/github/espago/espago/badges/gpa.svg)](https://codeclimate.com/github/espago/espago)
7
- [![Test Coverage](https://codeclimate.com/github/espago/espago/badges/coverage.svg)](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/doc/en>
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 = 2
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: {first_name: "Jan", last_name: "Kowalski", number: "4242424242424242", year: "2019", month: "03"}}
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: {first_name: "Jan", last_name: "Kowalski", number: "4242424242424242", year: "2019", month: "03"}}
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: {first_name: "Jan", last_name: "Kowalski", number: "4242424242424242", year: "2019", month: "03"}}
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/v2#44-card-tokens</td>
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/v2#55-customers</td>
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/v2#9-card-payments</td>
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/v2#22-plans</td>
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/v2#28-subscriptions</td>
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/v2#34-invoices</td>
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/v2#41-getting-informations-about-line-items-of-invoice</td>
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
- # -*- encoding: utf-8 -*-
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 = "espago"
6
+ gem.name = 'espago'
8
7
  gem.version = Espago::VERSION
9
- gem.authors = ["Piotrek", "Szymon Fiedler","Waclaw Luczak"]
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 = ["lib"]
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
@@ -2,7 +2,7 @@ module Espago
2
2
  class ApiConnection
3
3
  class ChargesCompletePost < ApiPost
4
4
  def request(params = {})
5
- super("charges/#{params[:charge_id]}/complete")
5
+ super("charges/#{params[:charge_id]}/complete", params.except(:charge_id))
6
6
  end
7
7
  end
8
8
  end
@@ -0,0 +1,9 @@
1
+ module Espago
2
+ class ApiConnection
3
+ class RefundsPost < ApiPost
4
+ def request(params = {})
5
+ super("refunds", params)
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Espago
2
+ class ApiConnection
3
+ class SecureWebPageRegisterPost < ApiPost
4
+ def request(params = {})
5
+ super("secure_web_page_register", params)
6
+ end
7
+ end
8
+ end
9
+ end