espago 0.1.8 → 0.1.10

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 +254 -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: 58622fe56f6d0fcdcf4a95e4471b59333ea9ae33361322f8ee96b14df49013f5
4
+ data.tar.gz: dced9ad9a5fadd4495929a35a534fe50fe7510385a074ad43ce9707cce66c1c6
5
5
  SHA512:
6
- metadata.gz: 518ef7b212cb3e789d4cd24bc992e8515bc01516d0ea5db5c1c97d3f75c43bdb89142220586aff3f92878a9d6508c51205071bcd8cff88e6d1fd1636d07cfaf0
7
- data.tar.gz: 9da66c2cba20692a5821dd094c0cf30337767b9f3c7fdd17ee818a0e2a8864f3328ff6e7695e5a3ab45b81ac368f0d47c6ba52c0ed0a0def396dabd8cfb71d05
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
- - "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,278 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- espago (0.1.8)
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
- 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.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
- codeclimate-test-reporter
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
  [![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
@@ -3,7 +3,7 @@ module Espago
3
3
  class TokensPost < ApiPost
4
4
  def initialize(connection)
5
5
  @connection = connection
6
- @connection.basic_auth(Espago.public_key, '')
6
+ @connection.request(:authorization, :basic, Espago.public_key, '')
7
7
  end
8
8
 
9
9
  def request(params = {})