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
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://app_id_test:app_password_test@sandbox.espago.com/api/invoices/in_tUCMhwlg2nkvAaL/line_items
5
+ uri: https://sandbox.espago.com/api/invoices/in_tUCMhwlg2nkvAaL/line_items
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: delete
5
- uri: https://app_id_test:app_password_test@sandbox.espago.com/api/plans/pl_XczKHr_42CRiKXZ
5
+ uri: https://sandbox.espago.com/api/plans/pl_XczKHr_42CRiKXZ
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://app_id_test:app_password_test@sandbox.espago.com/api/plans
5
+ uri: https://sandbox.espago.com/api/plans
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://app_id_test:app_password_test@sandbox.espago.com/api/plans/pl_12345
5
+ uri: https://sandbox.espago.com/api/plans/pl_12345
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,13 +2,15 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://app_id_test:app_password_test@sandbox.espago.com/api/plans
5
+ uri: https://sandbox.espago.com/api/plans
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: period_unit=day&period=14&amount=49.99&currency=pln&description=Test+Plan
9
9
  headers:
10
10
  Accept:
11
11
  - application/vnd.espago.v2+json
12
+ Authorization:
13
+ - Basic YXBwX2lkX3Rlc3Q6YXBwX3Bhc3N3b3JkX3Rlc3Q=
12
14
  Content-Type:
13
15
  - application/x-www-form-urlencoded
14
16
  Accept-Encoding:
@@ -2,13 +2,15 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: put
5
- uri: https://app_id_test:app_password_test@sandbox.espago.com/api/plans/pl_XczKHr_42CRiKXZ
5
+ uri: https://sandbox.espago.com/api/plans/pl_XczKHr_42CRiKXZ
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: plan_id=pl_XczKHr_42CRiKXZ&period_unit=month&period=1&amount=149.99&currency=pln&description=Test+Plan
9
9
  headers:
10
10
  Accept:
11
11
  - application/vnd.espago.v2+json
12
+ Authorization:
13
+ - Basic YXBwX2lkX3Rlc3Q6YXBwX3Bhc3N3b3JkX3Rlc3Q=
12
14
  Content-Type:
13
15
  - application/x-www-form-urlencoded
14
16
  Accept-Encoding:
@@ -0,0 +1,56 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://sandbox.espago.com/api/secure_web_page_register
6
+ body:
7
+ encoding: UTF-8
8
+ string: amount=49.99&currency=PLN&description=Test12345&client_description=Jan+Kowalski&kind=sale
9
+ headers:
10
+ Accept:
11
+ - application/vnd.espago.v3+json
12
+ Authorization:
13
+ - Basic YXBwX2lkX3Rlc3Q6YXBwX3Bhc3N3b3JkX3Rlc3Q=
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: 'Created '
24
+ headers:
25
+ X-Frame-Options:
26
+ - SAMEORIGIN
27
+ X-Xss-Protection:
28
+ - 1; mode=block
29
+ X-Content-Type-Options:
30
+ - nosniff
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ X-Meta-Request-Version:
34
+ - 0.2.9
35
+ Etag:
36
+ - W/"c32d4faa6245c966283caad9e1088455"
37
+ Cache-Control:
38
+ - max-age=0, private, must-revalidate
39
+ X-Request-Id:
40
+ - a9b96384-cf27-49a6-b685-6f2f77689f5d
41
+ Server:
42
+ - WEBrick/1.3.1 (Ruby/2.4.6/2019-04-01)
43
+ Date:
44
+ - Mon, 15 Apr 2019 16:03:09 GMT
45
+ Content-Length:
46
+ - '227'
47
+ Connection:
48
+ - Keep-Alive
49
+ Set-Cookie:
50
+ - _session_id=93a8bdfcb34dc876573281a240c04d43; path=/; HttpOnly
51
+ body:
52
+ encoding: UTF-8
53
+ string: '{"id":"pay_770swCpLvm5dzrqk","description":"Test12345","amount":"49.99","currency":"PLN","state":"new","created_at":1555344189,"transaction_id":"tr_770J9n7gw","redirect_url":"http://127.0.0.1:3000/secure_web_page/tr_770J9n7gw"}'
54
+ http_version:
55
+ recorded_at: Mon, 15 Apr 2019 16:03:09 GMT
56
+ recorded_with: VCR 2.9.3
@@ -2,13 +2,15 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: delete
5
- uri: https://app_id_test:app_password_test@sandbox.espago.com/api/subscriptions/sub_8yYuCBKdywr7e2
5
+ uri: https://sandbox.espago.com/api/subscriptions/sub_8yYuCBKdywr7e2
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
10
  Accept:
11
11
  - application/vnd.espago.v2+json
12
+ Authorization:
13
+ - Basic YXBwX2lkX3Rlc3Q6YXBwX3Bhc3N3b3JkX3Rlc3Q=
12
14
  Accept-Encoding:
13
15
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
16
  User-Agent:
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://app_id_test:app_password_test@sandbox.espago.com/api/subscriptions
5
+ uri: https://sandbox.espago.com/api/subscriptions
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://app_id_test:app_password_test@sandbox.espago.com/api/subscriptions/sub_8yYuCBKdywr7e2
5
+ uri: https://sandbox.espago.com/api/subscriptions/sub_8yYuCBKdywr7e2
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,13 +2,15 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://app_id_test:app_password_test@sandbox.espago.com/api/subscriptions
5
+ uri: https://sandbox.espago.com/api/subscriptions
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: plan=pl_12345&client=cli_90Pi6Jf0ndl_PP
9
9
  headers:
10
10
  Accept:
11
11
  - application/vnd.espago.v2+json
12
+ Authorization:
13
+ - Basic YXBwX2lkX3Rlc3Q6YXBwX3Bhc3N3b3JkX3Rlc3Q=
12
14
  Content-Type:
13
15
  - application/x-www-form-urlencoded
14
16
  Accept-Encoding:
@@ -2,13 +2,15 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://app_id_test:app_password_test@sandbox.espago.com/api/tokens/cc_166YDMhrVcemFb3
5
+ uri: https://sandbox.espago.com/api/tokens/cc_166YDMhrVcemFb3
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
10
  Accept:
11
11
  - application/vnd.espago.v2+json
12
+ Authorization:
13
+ - Basic YXBwX2lkX3Rlc3Q6YXBwX3Bhc3N3b3JkX3Rlc3Q=
12
14
  Accept-Encoding:
13
15
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
16
  User-Agent:
@@ -2,13 +2,15 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://app_public_key_test:@sandbox.espago.com/api/tokens
5
+ uri: https://sandbox.espago.com/api/tokens
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: card%5Bfirst_name%5D=Jan&card%5Blast_name%5D=Kowalski&card%5Bnumber%5D=4242424242424242&card%5Bverification_value%5D=123&card%5Byear%5D=2015&card%5Bmonth%5D=2
9
9
  headers:
10
10
  Accept:
11
11
  - application/vnd.espago.v2+json
12
+ Authorization:
13
+ - Basic YXBwX3B1YmxpY19rZXlfdGVzdDo=
12
14
  Content-Type:
13
15
  - application/x-www-form-urlencoded
14
16
  Accept-Encoding:
data/spec/spec_helper.rb CHANGED
@@ -7,36 +7,33 @@
7
7
  require 'simplecov'
8
8
  SimpleCov.start
9
9
 
10
-
11
- require "codeclimate-test-reporter"
12
- CodeClimate::TestReporter.start
13
-
14
10
  require 'webmock/rspec'
11
+ require 'rspec/its'
15
12
  require 'vcr'
16
13
  require './lib/espago'
14
+ require 'byebug'
17
15
 
18
16
  VCR.configure do |c|
19
17
  c.default_cassette_options = {:record => :once, :serialize_with => :yaml}
20
18
  c.cassette_library_dir = 'spec/fixtures/cassettes'
21
19
  c.hook_into :webmock
22
- c.ignore_hosts 'codeclimate.com'
23
20
  end
24
21
  #WebMock.allow_net_connect!
25
22
  #VCR.turn_off!(:ignore_cassettes => false)
26
23
  #VCR.turn_on!
27
24
 
28
25
  RSpec.configure do |config|
29
- config.treat_symbols_as_metadata_keys_with_true_values = true
30
26
  config.run_all_when_everything_filtered = true
31
27
  config.filter_run :focus
32
28
 
29
+ # config.raise_errors_for_deprecations!
33
30
 
34
31
  config.before(:each) do
35
32
  Espago.app_id = 'app_id_test'
36
33
  Espago.app_password = 'app_password_test'
37
34
  Espago.public_key = 'app_public_key_test'
38
35
  Espago.production = false
39
- Espago.api_version = '2'
36
+ Espago.api_version = '3'
40
37
  end
41
38
 
42
39
 
metadata CHANGED
@@ -1,16 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: espago
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotrek
8
8
  - Szymon Fiedler
9
9
  - Waclaw Luczak
10
- autorequire:
10
+ - faramund
11
+ autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2016-08-17 00:00:00.000000000 Z
14
+ date: 2023-03-22 00:00:00.000000000 Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: faraday
@@ -18,14 +19,28 @@ dependencies:
18
19
  requirements:
19
20
  - - ">="
20
21
  - !ruby/object:Gem::Version
21
- version: '0'
22
+ version: 2.0.0
22
23
  type: :runtime
23
24
  prerelease: false
24
25
  version_requirements: !ruby/object:Gem::Requirement
25
26
  requirements:
26
27
  - - ">="
27
28
  - !ruby/object:Gem::Version
28
- version: '0'
29
+ version: 2.0.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: json
32
+ requirement: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 2.3.1
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 2.3.1
29
44
  - !ruby/object:Gem::Dependency
30
45
  name: facets
31
46
  requirement: !ruby/object:Gem::Requirement
@@ -56,6 +71,34 @@ dependencies:
56
71
  version: '0'
57
72
  - !ruby/object:Gem::Dependency
58
73
  name: rspec
74
+ requirement: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: 3.11.0
79
+ type: :development
80
+ prerelease: false
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: 3.11.0
86
+ - !ruby/object:Gem::Dependency
87
+ name: rspec-its
88
+ requirement: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ type: :development
94
+ prerelease: false
95
+ version_requirements: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ - !ruby/object:Gem::Dependency
101
+ name: byebug
59
102
  requirement: !ruby/object:Gem::Requirement
60
103
  requirements:
61
104
  - - ">="
@@ -180,20 +223,6 @@ dependencies:
180
223
  - - ">="
181
224
  - !ruby/object:Gem::Version
182
225
  version: '0'
183
- - !ruby/object:Gem::Dependency
184
- name: codeclimate-test-reporter
185
- requirement: !ruby/object:Gem::Requirement
186
- requirements:
187
- - - ">="
188
- - !ruby/object:Gem::Version
189
- version: '0'
190
- type: :development
191
- prerelease: false
192
- version_requirements: !ruby/object:Gem::Requirement
193
- requirements:
194
- - - ">="
195
- - !ruby/object:Gem::Version
196
- version: '0'
197
226
  description: Espago api wrapper
198
227
  email:
199
228
  - developers@espago.com
@@ -247,11 +276,14 @@ files:
247
276
  - lib/espago/api_connection/plans_get.rb
248
277
  - lib/espago/api_connection/plans_post.rb
249
278
  - lib/espago/api_connection/plans_put.rb
279
+ - lib/espago/api_connection/refunds_post.rb
280
+ - lib/espago/api_connection/secure_web_page_register_post.rb
250
281
  - lib/espago/api_connection/subscriptions_delete.rb
251
282
  - lib/espago/api_connection/subscriptions_get.rb
252
283
  - lib/espago/api_connection/subscriptions_post.rb
253
284
  - lib/espago/api_connection/tokens_get.rb
254
285
  - lib/espago/api_connection/tokens_post.rb
286
+ - lib/espago/api_connection/visacheckout_post.rb
255
287
  - lib/espago/back_request.rb
256
288
  - lib/espago/client.rb
257
289
  - lib/espago/engine.rb
@@ -283,6 +315,7 @@ files:
283
315
  - spec/features/invoices_spec.rb
284
316
  - spec/features/line_items_spec.rb
285
317
  - spec/features/plans_spec.rb
318
+ - spec/features/secure_web_page_register_spec.rb
286
319
  - spec/features/subscriptions_spec.rb
287
320
  - spec/features/tokens_spec.rb
288
321
  - spec/fixtures/cassettes/api_2.yml
@@ -317,6 +350,7 @@ files:
317
350
  - spec/fixtures/cassettes/plans_get_pl_12345.yml
318
351
  - spec/fixtures/cassettes/plans_post.yml
319
352
  - spec/fixtures/cassettes/plans_put.yml
353
+ - spec/fixtures/cassettes/secure_web_page_register_post.yml
320
354
  - spec/fixtures/cassettes/subscriptions_delete_sub_8yYuCBKdywr7e2.yml
321
355
  - spec/fixtures/cassettes/subscriptions_get.yml
322
356
  - spec/fixtures/cassettes/subscriptions_get_sub_8yYuCBKdywr7e2.yml
@@ -328,7 +362,7 @@ files:
328
362
  homepage: ''
329
363
  licenses: []
330
364
  metadata: {}
331
- post_install_message:
365
+ post_install_message:
332
366
  rdoc_options: []
333
367
  require_paths:
334
368
  - lib
@@ -343,9 +377,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
343
377
  - !ruby/object:Gem::Version
344
378
  version: '0'
345
379
  requirements: []
346
- rubyforge_project:
347
- rubygems_version: 2.4.6
348
- signing_key:
380
+ rubygems_version: 3.4.1
381
+ signing_key:
349
382
  specification_version: 4
350
383
  summary: Espago api wrapper
351
384
  test_files:
@@ -365,6 +398,7 @@ test_files:
365
398
  - spec/features/invoices_spec.rb
366
399
  - spec/features/line_items_spec.rb
367
400
  - spec/features/plans_spec.rb
401
+ - spec/features/secure_web_page_register_spec.rb
368
402
  - spec/features/subscriptions_spec.rb
369
403
  - spec/features/tokens_spec.rb
370
404
  - spec/fixtures/cassettes/api_2.yml
@@ -399,6 +433,7 @@ test_files:
399
433
  - spec/fixtures/cassettes/plans_get_pl_12345.yml
400
434
  - spec/fixtures/cassettes/plans_post.yml
401
435
  - spec/fixtures/cassettes/plans_put.yml
436
+ - spec/fixtures/cassettes/secure_web_page_register_post.yml
402
437
  - spec/fixtures/cassettes/subscriptions_delete_sub_8yYuCBKdywr7e2.yml
403
438
  - spec/fixtures/cassettes/subscriptions_get.yml
404
439
  - spec/fixtures/cassettes/subscriptions_get_sub_8yYuCBKdywr7e2.yml