espago 0.1.10 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58622fe56f6d0fcdcf4a95e4471b59333ea9ae33361322f8ee96b14df49013f5
4
- data.tar.gz: dced9ad9a5fadd4495929a35a534fe50fe7510385a074ad43ce9707cce66c1c6
3
+ metadata.gz: 0012140a46224bc19f297397903ab56c2b3c4035273cb1d340594a4d88e2d90c
4
+ data.tar.gz: 55722bbdc0597352cf598cb4e4b0765e00bc59b33b75648c05921d9f0701c278
5
5
  SHA512:
6
- metadata.gz: a03a86f370585caf4713df6b350ca38a695ca100240838617686d08e06a6113de589ba5101334fb7c0f6cb5e2c7236cfa9b50cde8052ef00e58d7f7ef8bf88f6
7
- data.tar.gz: bb7617c6db025d979a7cd672806e8e4b5447f85099e01b90a573985f5ae650ead9d8093a2c283a6cc4989d42324d82c50c0381b6a83f25d3272d636907184f43
6
+ metadata.gz: 59761e0f1b01a2add45d056b1eca0f30841f69d15464f1d60e03ad9b0766604868e42d7cd6bc9018bc9146e81adcaaad90bf5e726acb25ee861a20396ebb2182
7
+ data.tar.gz: 3aea64ff09c9e4b4d4b3ae9030010c0b06fe4b8a06eb10a6f5e5c64df1841090a8f4aa62a9cacf58aba25db43cbdd88833c204c5fdb904e4aee34415b324a162
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- espago (0.1.10)
4
+ espago (0.1.11)
5
5
  facets
6
6
  faraday (>= 2.0.0)
7
7
  json (>= 2.3.1)
@@ -10,67 +10,67 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- actioncable (7.0.4.3)
14
- actionpack (= 7.0.4.3)
15
- activesupport (= 7.0.4.3)
13
+ actioncable (7.0.8)
14
+ actionpack (= 7.0.8)
15
+ activesupport (= 7.0.8)
16
16
  nio4r (~> 2.0)
17
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)
18
+ actionmailbox (7.0.8)
19
+ actionpack (= 7.0.8)
20
+ activejob (= 7.0.8)
21
+ activerecord (= 7.0.8)
22
+ activestorage (= 7.0.8)
23
+ activesupport (= 7.0.8)
24
24
  mail (>= 2.7.1)
25
25
  net-imap
26
26
  net-pop
27
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)
28
+ actionmailer (7.0.8)
29
+ actionpack (= 7.0.8)
30
+ actionview (= 7.0.8)
31
+ activejob (= 7.0.8)
32
+ activesupport (= 7.0.8)
33
33
  mail (~> 2.5, >= 2.5.4)
34
34
  net-imap
35
35
  net-pop
36
36
  net-smtp
37
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)
38
+ actionpack (7.0.8)
39
+ actionview (= 7.0.8)
40
+ activesupport (= 7.0.8)
41
+ rack (~> 2.0, >= 2.2.4)
42
42
  rack-test (>= 0.6.3)
43
43
  rails-dom-testing (~> 2.0)
44
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)
45
+ actiontext (7.0.8)
46
+ actionpack (= 7.0.8)
47
+ activerecord (= 7.0.8)
48
+ activestorage (= 7.0.8)
49
+ activesupport (= 7.0.8)
50
50
  globalid (>= 0.6.0)
51
51
  nokogiri (>= 1.8.5)
52
- actionview (7.0.4.3)
53
- activesupport (= 7.0.4.3)
52
+ actionview (7.0.8)
53
+ activesupport (= 7.0.8)
54
54
  builder (~> 3.1)
55
55
  erubi (~> 1.4)
56
56
  rails-dom-testing (~> 2.0)
57
57
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
58
- activejob (7.0.4.3)
59
- activesupport (= 7.0.4.3)
58
+ activejob (7.0.8)
59
+ activesupport (= 7.0.8)
60
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)
61
+ activemodel (7.0.8)
62
+ activesupport (= 7.0.8)
63
+ activerecord (7.0.8)
64
+ activemodel (= 7.0.8)
65
+ activesupport (= 7.0.8)
66
+ activestorage (7.0.8)
67
+ actionpack (= 7.0.8)
68
+ activejob (= 7.0.8)
69
+ activerecord (= 7.0.8)
70
+ activesupport (= 7.0.8)
71
71
  marcel (~> 1.0)
72
72
  mini_mime (>= 1.1.0)
73
- activesupport (7.0.4.3)
73
+ activesupport (7.0.8)
74
74
  concurrent-ruby (~> 1.0, >= 1.0.2)
75
75
  i18n (>= 1.6, < 2)
76
76
  minitest (>= 5.1)
@@ -81,26 +81,26 @@ GEM
81
81
  builder (3.2.4)
82
82
  byebug (11.1.3)
83
83
  coderay (1.1.3)
84
- concurrent-ruby (1.2.2)
84
+ concurrent-ruby (1.2.3)
85
85
  crack (0.4.5)
86
86
  rexml
87
87
  crass (1.0.6)
88
- date (3.3.3)
88
+ date (3.3.4)
89
89
  diff-lcs (1.5.0)
90
90
  docile (1.4.0)
91
91
  erubi (1.12.0)
92
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)
93
+ faraday (2.9.0)
94
+ faraday-net_http (>= 2.0, < 3.2)
95
+ faraday-net_http (3.1.0)
96
+ net-http
97
97
  ffi (1.15.5)
98
98
  formatador (1.1.0)
99
99
  fuubar (2.5.1)
100
100
  rspec-core (~> 3.0)
101
101
  ruby-progressbar (~> 1.4)
102
- globalid (1.1.0)
103
- activesupport (>= 5.0)
102
+ globalid (1.2.1)
103
+ activesupport (>= 6.1)
104
104
  guard (2.18.0)
105
105
  formatador (>= 0.2.4)
106
106
  listen (>= 2.7, < 4.0)
@@ -116,16 +116,16 @@ GEM
116
116
  guard-compat (~> 1.1)
117
117
  rspec (>= 2.99.0, < 4.0)
118
118
  hashdiff (1.0.1)
119
- i18n (1.12.0)
119
+ i18n (1.14.4)
120
120
  concurrent-ruby (~> 1.0)
121
121
  json (2.6.3)
122
122
  language_server-protocol (3.16.0.3)
123
123
  listen (3.0.8)
124
124
  rb-fsevent (~> 0.9, >= 0.9.4)
125
125
  rb-inotify (~> 0.9, >= 0.9.7)
126
- loofah (2.19.1)
126
+ loofah (2.22.0)
127
127
  crass (~> 1.0.2)
128
- nokogiri (>= 1.5.9)
128
+ nokogiri (>= 1.12.0)
129
129
  lumberjack (1.2.8)
130
130
  mail (2.8.1)
131
131
  mini_mime (>= 0.1.1)
@@ -134,20 +134,22 @@ GEM
134
134
  net-smtp
135
135
  marcel (1.0.2)
136
136
  method_source (1.0.0)
137
- mini_mime (1.1.2)
138
- minitest (5.18.0)
137
+ mini_mime (1.1.5)
138
+ minitest (5.22.3)
139
139
  nenv (0.3.0)
140
- net-imap (0.3.4)
140
+ net-http (0.4.1)
141
+ uri
142
+ net-imap (0.4.5)
141
143
  date
142
144
  net-protocol
143
145
  net-pop (0.1.2)
144
146
  net-protocol
145
- net-protocol (0.2.1)
147
+ net-protocol (0.2.2)
146
148
  timeout
147
- net-smtp (0.3.3)
149
+ net-smtp (0.4.0)
148
150
  net-protocol
149
- nio4r (2.5.8)
150
- nokogiri (1.14.2-arm64-darwin)
151
+ nio4r (2.7.0)
152
+ nokogiri (1.16.6-arm64-darwin)
151
153
  racc (~> 1.4)
152
154
  notiffany (0.1.3)
153
155
  nenv (~> 0.1)
@@ -160,32 +162,34 @@ GEM
160
162
  coderay (~> 1.1)
161
163
  method_source (~> 1.0)
162
164
  public_suffix (4.0.7)
163
- racc (1.6.2)
164
- rack (2.2.6.4)
165
+ racc (1.8.0)
166
+ rack (2.2.9)
165
167
  rack-test (2.1.0)
166
168
  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)
169
+ rails (7.0.8)
170
+ actioncable (= 7.0.8)
171
+ actionmailbox (= 7.0.8)
172
+ actionmailer (= 7.0.8)
173
+ actionpack (= 7.0.8)
174
+ actiontext (= 7.0.8)
175
+ actionview (= 7.0.8)
176
+ activejob (= 7.0.8)
177
+ activemodel (= 7.0.8)
178
+ activerecord (= 7.0.8)
179
+ activestorage (= 7.0.8)
180
+ activesupport (= 7.0.8)
179
181
  bundler (>= 1.15.0)
180
- railties (= 7.0.4.3)
181
- rails-dom-testing (2.0.3)
182
- activesupport (>= 4.2.0)
182
+ railties (= 7.0.8)
183
+ rails-dom-testing (2.2.0)
184
+ activesupport (>= 5.0.0)
185
+ minitest
183
186
  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)
187
+ rails-html-sanitizer (1.6.0)
188
+ loofah (~> 2.21)
189
+ nokogiri (~> 1.14)
190
+ railties (7.0.8)
191
+ actionpack (= 7.0.8)
192
+ activesupport (= 7.0.8)
189
193
  method_source
190
194
  rake (>= 12.2)
191
195
  thor (~> 1.0)
@@ -230,7 +234,6 @@ GEM
230
234
  sorbet-runtime
231
235
  syntax_tree (>= 2.4)
232
236
  ruby-progressbar (1.11.0)
233
- ruby2_keywords (0.0.5)
234
237
  shellany (0.0.1)
235
238
  simplecov (0.21.2)
236
239
  docile (~> 1.1)
@@ -242,19 +245,20 @@ GEM
242
245
  syntax_tree (2.8.0)
243
246
  prettier_print
244
247
  thor (1.2.1)
245
- timeout (0.3.2)
248
+ timeout (0.4.1)
246
249
  tzinfo (2.0.6)
247
250
  concurrent-ruby (~> 1.0)
248
251
  unicode-display_width (2.1.0)
252
+ uri (0.13.0)
249
253
  vcr (6.1.0)
250
254
  webmock (3.14.0)
251
255
  addressable (>= 2.8.0)
252
256
  crack (>= 0.3.2)
253
257
  hashdiff (>= 0.4.0, < 2.0.0)
254
- websocket-driver (0.7.5)
258
+ websocket-driver (0.7.6)
255
259
  websocket-extensions (>= 0.1.0)
256
260
  websocket-extensions (0.1.5)
257
- zeitwerk (2.6.7)
261
+ zeitwerk (2.6.13)
258
262
 
259
263
  PLATFORMS
260
264
  ruby
@@ -0,0 +1,9 @@
1
+ module Espago
2
+ class ApiConnection
3
+ class ChargesInitPost < Api
4
+ def request(params = {})
5
+ @connection.post 'charges/init', params
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module Espago
2
- VERSION = '0.1.10'
2
+ VERSION = '0.1.11'
3
3
  end
@@ -48,6 +48,33 @@ describe 'Espago.charges' do
48
48
  end
49
49
  end
50
50
 
51
+ it "should get params from new charge init" do
52
+ VCR.use_cassette('charges init post') do
53
+ response = Espago.charges_init :post, {
54
+ amount:'49.99',
55
+ currency:'PLN',
56
+ description:'Test12345',
57
+ card: {
58
+ first_name: 'Jan',
59
+ last_name: 'Kowalski',
60
+ number: '4242424242424242',
61
+ verification_value: '123',
62
+ year:'2015',
63
+ month:'2'
64
+ },
65
+ }
66
+ expect(response.status).to eq(201)
67
+ expect(response.channel).to eq('elavon')
68
+ expect(response.state).to eq('new')
69
+ expect(response.id).to eq('pay_96aTW2otjImiHhCd')
70
+ expect(response.currency).to eq('PLN')
71
+ expect(response.description).to eq('Test12345')
72
+ expect(response.client).to eq('cli_96acHmkHkj36w3Xk')
73
+ expect(response.created_at).to eq Time.at(1728462384)
74
+ expect(response.payment_token).to eq('86ba284f-3ad6-4b50-94c0-be3377a6f6c5')
75
+ end
76
+ end
77
+
51
78
  it "should get 204 status after destroy charge" do
52
79
  VCR.use_cassette('charges destroy') do
53
80
  response = Espago.charges :delete,{charge_id:'pay_kQmS_3RTfm4eix'}
@@ -58,6 +58,36 @@ describe 'Espago.charges_with_params' do
58
58
  end
59
59
  end
60
60
 
61
+ it "should get params from new charge init" do
62
+ VCR.use_cassette('charges init post') do
63
+ response = Espago.charges_init :post, {
64
+ app_id: 'app_id_test',
65
+ app_password: 'app_password_test',
66
+ production: false,
67
+ amount:'49.99',
68
+ currency:'PLN',
69
+ description:'Test12345',
70
+ card: {
71
+ first_name: 'Jan',
72
+ last_name: 'Kowalski',
73
+ number: '4242424242424242',
74
+ verification_value: '123',
75
+ year:'2015',
76
+ month:'2'
77
+ },
78
+ }
79
+ expect(response.status).to eq(201)
80
+ expect(response.channel).to eq('elavon')
81
+ expect(response.state).to eq('new')
82
+ expect(response.id).to eq('pay_96aTW2otjImiHhCd')
83
+ expect(response.currency).to eq('PLN')
84
+ expect(response.description).to eq('Test12345')
85
+ expect(response.client).to eq('cli_96acHmkHkj36w3Xk')
86
+ expect(response.created_at).to eq Time.at(1728462384)
87
+ expect(response.payment_token).to eq('86ba284f-3ad6-4b50-94c0-be3377a6f6c5')
88
+ end
89
+ end
90
+
61
91
  it "should get 204 status after destroy charge" do
62
92
  VCR.use_cassette('charges destroy') do
63
93
  response = Espago.charges :delete,{charge_id:'pay_kQmS_3RTfm4eix', app_id: 'app_id_test', app_password: 'app_password_test', production: false}
@@ -0,0 +1,59 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://sandbox.espago.com/api/charges/init
6
+ body:
7
+ encoding: UTF-8
8
+ string: amount=49.99&card%5Bfirst_name%5D=Jan&card%5Blast_name%5D=Kowalski&card%5Bmonth%5D=2&card%5Bnumber%5D=4242424242424242&card%5Bverification_value%5D=123&card%5Byear%5D=2015&currency=PLN&description=Test12345
9
+ headers:
10
+ Accept:
11
+ - application/vnd.espago.v3+json
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 201
21
+ message: Created
22
+ headers:
23
+ Date:
24
+ - Wed, 09 Oct 2024 08:26:24 GMT
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Etag:
30
+ - W/"afa8705161a34d3c38548c8597267636"
31
+ Cache-Control:
32
+ - max-age=0, private, must-revalidate
33
+ Strict-Transport-Security:
34
+ - max-age=31536000; includeSubdomains; preload
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ X-Xss-Protection:
38
+ - 1; mode=block
39
+ X-Download-Options:
40
+ - noopen
41
+ X-Permitted-Cross-Domain-Policies:
42
+ - none
43
+ Referrer-Policy:
44
+ - strict-origin-when-cross-origin
45
+ Content-Security-Policy:
46
+ - default-src 'none'; base-uri 'none'; block-all-mixed-content; child-src 'self'
47
+ sandbox-static.espago.com; connect-src 'self' sandbox-static.espago.com; font-src
48
+ 'self' sandbox-static.espago.com; form-action 'self' sandbox-static.espago.com;
49
+ img-src 'self' sandbox-static.espago.com; manifest-src 'none'; media-src 'none';
50
+ object-src 'none'; script-src 'self' sandbox-static.espago.com; style-src
51
+ 'self' sandbox-static.espago.com; upgrade-insecure-requests; worker-src 'none';
52
+ report-uri https://csp-report.espago.com/csp_app0_sandbox/store
53
+ X-Frame-Options:
54
+ - SAMEORIGIN
55
+ body:
56
+ encoding: UTF-8
57
+ string: '{"id":"pay_96aTW2otjImiHhCd","description":"Test12345","channel":"elavon","amount":"49.99","currency":"PLN","state":"new","client":"cli_96acHmkHkj36w3Xk","transaction_id":"tr_96aaqaYyD","created_at":1728462384,"payment_token":"86ba284f-3ad6-4b50-94c0-be3377a6f6c5"}'
58
+ recorded_at: Wed, 09 Oct 2024 08:26:24 GMT
59
+ recorded_with: VCR 6.1.0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: espago
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotrek
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2023-03-22 00:00:00.000000000 Z
14
+ date: 2024-10-21 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: faraday
@@ -255,6 +255,7 @@ files:
255
255
  - lib/espago/api_connection/charges_complete_post.rb
256
256
  - lib/espago/api_connection/charges_delete.rb
257
257
  - lib/espago/api_connection/charges_get.rb
258
+ - lib/espago/api_connection/charges_init_post.rb
258
259
  - lib/espago/api_connection/charges_post.rb
259
260
  - lib/espago/api_connection/charges_refund_post.rb
260
261
  - lib/espago/api_connection/clients_authorize_post.rb
@@ -325,6 +326,7 @@ files:
325
326
  - spec/fixtures/cassettes/charges_destroy.yml
326
327
  - spec/fixtures/cassettes/charges_get.yml
327
328
  - spec/fixtures/cassettes/charges_get_pay_mTOngouLTJWZ0w.yml
329
+ - spec/fixtures/cassettes/charges_init_post.yml
328
330
  - spec/fixtures/cassettes/charges_post.yml
329
331
  - spec/fixtures/cassettes/charges_refund.yml
330
332
  - spec/fixtures/cassettes/clients_authorize.yml
@@ -377,7 +379,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
377
379
  - !ruby/object:Gem::Version
378
380
  version: '0'
379
381
  requirements: []
380
- rubygems_version: 3.4.1
382
+ rubygems_version: 3.4.2
381
383
  signing_key:
382
384
  specification_version: 4
383
385
  summary: Espago api wrapper
@@ -408,6 +410,7 @@ test_files:
408
410
  - spec/fixtures/cassettes/charges_destroy.yml
409
411
  - spec/fixtures/cassettes/charges_get.yml
410
412
  - spec/fixtures/cassettes/charges_get_pay_mTOngouLTJWZ0w.yml
413
+ - spec/fixtures/cassettes/charges_init_post.yml
411
414
  - spec/fixtures/cassettes/charges_post.yml
412
415
  - spec/fixtures/cassettes/charges_refund.yml
413
416
  - spec/fixtures/cassettes/clients_authorize.yml