espago 0.1.9 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6cecfc3e61851881b307347b5db67843c55f2666af1c08a2ed874bdeb56afd58
4
- data.tar.gz: 6e75c9b9a03fa8d32e6923154a30ba6af8fe651da1311b67c22b7772405f0e1b
3
+ metadata.gz: 0012140a46224bc19f297397903ab56c2b3c4035273cb1d340594a4d88e2d90c
4
+ data.tar.gz: 55722bbdc0597352cf598cb4e4b0765e00bc59b33b75648c05921d9f0701c278
5
5
  SHA512:
6
- metadata.gz: '0971aacc3c040da88abc8b6c8d4d1cb201ae6cd68ee85916725d0b3bff22e5d7d6c62ab1ec09ebae3e99a5c6b7b61c6787c28493e40b47cd2888049c09caae60'
7
- data.tar.gz: d68e32f6a39be3a5e8044f4234d6b2f905e47262b35dc61869e78629b1f359472f357861f3cc693117eea1cd079974687a30a1082282b12102f4cdc90d6f626d
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.9)
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.3)
14
- actionpack (= 7.0.3)
15
- activesupport (= 7.0.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.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)
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.3)
29
- actionpack (= 7.0.3)
30
- actionview (= 7.0.3)
31
- activejob (= 7.0.3)
32
- activesupport (= 7.0.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.3)
39
- actionview (= 7.0.3)
40
- activesupport (= 7.0.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.3)
46
- actionpack (= 7.0.3)
47
- activerecord (= 7.0.3)
48
- activestorage (= 7.0.3)
49
- activesupport (= 7.0.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.3)
53
- activesupport (= 7.0.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.3)
59
- activesupport (= 7.0.3)
58
+ activejob (7.0.8)
59
+ activesupport (= 7.0.8)
60
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)
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.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.1.10)
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.4)
88
89
  diff-lcs (1.5.0)
89
- digest (3.1.0)
90
90
  docile (1.4.0)
91
- erubi (1.10.0)
91
+ erubi (1.12.0)
92
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)
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.0.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,42 +116,40 @@ GEM
116
116
  guard-compat (~> 1.1)
117
117
  rspec (>= 2.99.0, < 4.0)
118
118
  hashdiff (1.0.1)
119
- i18n (1.10.0)
119
+ i18n (1.14.4)
120
120
  concurrent-ruby (~> 1.0)
121
- json (2.6.2)
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.18.0)
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
- mail (2.7.1)
130
+ mail (2.8.1)
131
131
  mini_mime (>= 0.1.1)
132
+ net-imap
133
+ net-pop
134
+ net-smtp
132
135
  marcel (1.0.2)
133
136
  method_source (1.0.0)
134
- mini_mime (1.1.2)
135
- mini_portile2 (2.8.0)
136
- minitest (5.16.1)
137
+ mini_mime (1.1.5)
138
+ minitest (5.22.3)
137
139
  nenv (0.3.0)
138
- net-imap (0.2.3)
139
- digest
140
+ net-http (0.4.1)
141
+ uri
142
+ net-imap (0.4.5)
143
+ date
140
144
  net-protocol
141
- strscan
142
- net-pop (0.1.1)
143
- digest
145
+ net-pop (0.1.2)
144
146
  net-protocol
147
+ net-protocol (0.2.2)
145
148
  timeout
146
- net-protocol (0.1.3)
147
- timeout
148
- net-smtp (0.3.1)
149
- digest
149
+ net-smtp (0.4.0)
150
150
  net-protocol
151
- timeout
152
- nio4r (2.5.8)
153
- nokogiri (1.13.6)
154
- mini_portile2 (~> 2.8.0)
151
+ nio4r (2.7.0)
152
+ nokogiri (1.16.6-arm64-darwin)
155
153
  racc (~> 1.4)
156
154
  notiffany (0.1.3)
157
155
  nenv (~> 0.1)
@@ -164,32 +162,34 @@ GEM
164
162
  coderay (~> 1.1)
165
163
  method_source (~> 1.0)
166
164
  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)
165
+ racc (1.8.0)
166
+ rack (2.2.9)
167
+ rack-test (2.1.0)
168
+ rack (>= 1.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)
183
181
  bundler (>= 1.15.0)
184
- railties (= 7.0.3)
185
- rails-dom-testing (2.0.3)
186
- activesupport (>= 4.2.0)
182
+ railties (= 7.0.8)
183
+ rails-dom-testing (2.2.0)
184
+ activesupport (>= 5.0.0)
185
+ minitest
187
186
  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)
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)
193
193
  method_source
194
194
  rake (>= 12.2)
195
195
  thor (~> 1.0)
@@ -234,7 +234,6 @@ GEM
234
234
  sorbet-runtime
235
235
  syntax_tree (>= 2.4)
236
236
  ruby-progressbar (1.11.0)
237
- ruby2_keywords (0.0.5)
238
237
  shellany (0.0.1)
239
238
  simplecov (0.21.2)
240
239
  docile (~> 1.1)
@@ -243,23 +242,23 @@ GEM
243
242
  simplecov-html (0.12.3)
244
243
  simplecov_json_formatter (0.1.4)
245
244
  sorbet-runtime (0.5.10109)
246
- strscan (3.0.3)
247
245
  syntax_tree (2.8.0)
248
246
  prettier_print
249
247
  thor (1.2.1)
250
- timeout (0.3.0)
251
- tzinfo (2.0.4)
248
+ timeout (0.4.1)
249
+ tzinfo (2.0.6)
252
250
  concurrent-ruby (~> 1.0)
253
251
  unicode-display_width (2.1.0)
252
+ uri (0.13.0)
254
253
  vcr (6.1.0)
255
254
  webmock (3.14.0)
256
255
  addressable (>= 2.8.0)
257
256
  crack (>= 0.3.2)
258
257
  hashdiff (>= 0.4.0, < 2.0.0)
259
- websocket-driver (0.7.5)
258
+ websocket-driver (0.7.6)
260
259
  websocket-extensions (>= 0.1.0)
261
260
  websocket-extensions (0.1.5)
262
- zeitwerk (2.6.0)
261
+ zeitwerk (2.6.13)
263
262
 
264
263
  PLATFORMS
265
264
  ruby
@@ -280,4 +279,4 @@ DEPENDENCIES
280
279
  webmock
281
280
 
282
281
  BUNDLED WITH
283
- 1.17.3
282
+ 2.3.3
@@ -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.9"
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.9
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: 2022-06-23 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.3.3
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