ethikdo 1.1.0 → 1.1.1
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 +4 -4
- data/Gemfile.lock +13 -8
- data/lib/ethikdo/base_model.rb +2 -2
- data/lib/ethikdo/provision.rb +1 -1
- data/lib/ethikdo/transaction.rb +6 -6
- data/lib/ethikdo/version.rb +1 -1
- data/spec/provision_spec.rb +11 -7
- data/spec/transaction_spec.rb +8 -5
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c1a6102a4153dd8b98d42b53ef0a18560924b729e62981e345d139eaa224d036
|
|
4
|
+
data.tar.gz: 52276b286b5c55d961ddeb161caa42fa9bd63d4a3b8643f08fab3d82ac9a44c2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6a622ca75067620e9ef4190895b9277af4d4f793237466ac10f5bdaaf707cfc8479a83635cc956d64e8de047e35cc47632931ca53e638187874637a06ac4039a
|
|
7
|
+
data.tar.gz: d56cc70605ea5959f032f78a34c35bdefb16acf183b5635c1e69ea7b0cd1a756c0d9bce5dd09ea2cb39ae06c5f1c3425e051dd3135597f78a9b0229d664c28a7
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
ethikdo (
|
|
4
|
+
ethikdo (1.1.0)
|
|
5
5
|
httparty
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -27,19 +27,22 @@ GEM
|
|
|
27
27
|
tzinfo (~> 2.0)
|
|
28
28
|
addressable (2.8.1)
|
|
29
29
|
public_suffix (>= 2.0.2, < 6.0)
|
|
30
|
+
bigdecimal (3.3.1)
|
|
30
31
|
builder (3.2.4)
|
|
31
32
|
concurrent-ruby (1.1.10)
|
|
32
33
|
crack (0.4.5)
|
|
33
34
|
rexml
|
|
34
35
|
crass (1.0.6)
|
|
36
|
+
csv (3.3.5)
|
|
35
37
|
diff-lcs (1.5.0)
|
|
36
38
|
erubi (1.11.0)
|
|
37
39
|
generator_spec (0.9.4)
|
|
38
40
|
activesupport (>= 3.0.0)
|
|
39
41
|
railties (>= 3.0.0)
|
|
40
42
|
hashdiff (1.0.1)
|
|
41
|
-
httparty (0.
|
|
42
|
-
|
|
43
|
+
httparty (0.23.2)
|
|
44
|
+
csv
|
|
45
|
+
mini_mime (>= 1.0.0)
|
|
43
46
|
multi_xml (>= 0.5.2)
|
|
44
47
|
i18n (1.12.0)
|
|
45
48
|
concurrent-ruby (~> 1.0)
|
|
@@ -47,12 +50,13 @@ GEM
|
|
|
47
50
|
crass (~> 1.0.2)
|
|
48
51
|
nokogiri (>= 1.5.9)
|
|
49
52
|
method_source (1.0.0)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
mime-types-data (3.2022.0105)
|
|
53
|
+
mini_mime (1.1.5)
|
|
54
|
+
mini_portile2 (2.8.9)
|
|
53
55
|
minitest (5.16.3)
|
|
54
|
-
multi_xml (0.
|
|
55
|
-
|
|
56
|
+
multi_xml (0.7.2)
|
|
57
|
+
bigdecimal (~> 3.1)
|
|
58
|
+
nokogiri (1.13.9)
|
|
59
|
+
mini_portile2 (~> 2.8.0)
|
|
56
60
|
racc (~> 1.4)
|
|
57
61
|
public_suffix (5.0.0)
|
|
58
62
|
racc (1.6.0)
|
|
@@ -97,6 +101,7 @@ GEM
|
|
|
97
101
|
|
|
98
102
|
PLATFORMS
|
|
99
103
|
arm64-darwin-20
|
|
104
|
+
arm64-darwin-24
|
|
100
105
|
|
|
101
106
|
DEPENDENCIES
|
|
102
107
|
ethikdo!
|
data/lib/ethikdo/base_model.rb
CHANGED
data/lib/ethikdo/provision.rb
CHANGED
|
@@ -17,7 +17,7 @@ module Ethikdo
|
|
|
17
17
|
attr_accessor :results
|
|
18
18
|
|
|
19
19
|
def self.create(card_number:, card_crypto:)
|
|
20
|
-
response = execute("post", '/provisions/', body: { card_number: card_number, card_crypto: card_crypto })
|
|
20
|
+
response = execute("post", '/provisions/', body: { card_number: card_number.to_s, card_crypto: card_crypto.to_s }.to_json)
|
|
21
21
|
self.new(response.parsed_response)
|
|
22
22
|
end
|
|
23
23
|
|
data/lib/ethikdo/transaction.rb
CHANGED
|
@@ -19,12 +19,12 @@ module Ethikdo
|
|
|
19
19
|
|
|
20
20
|
def self.create(capture_token:, amount_requested:, amount_purchased: 0, transaction_id:, customer_email: nil)
|
|
21
21
|
response = execute('post', '/sales/', body: {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
capture_token: capture_token,
|
|
23
|
+
amount_requested: amount_requested.to_s,
|
|
24
|
+
amount_purchased: amount_purchased.to_s,
|
|
25
|
+
transaction_id: transaction_id.to_s,
|
|
26
|
+
customer_email: customer_email
|
|
27
|
+
}.to_json)
|
|
28
28
|
self.new(response.parsed_response)
|
|
29
29
|
end
|
|
30
30
|
|
data/lib/ethikdo/version.rb
CHANGED
data/spec/provision_spec.rb
CHANGED
|
@@ -34,13 +34,17 @@ describe Ethikdo::Provision do
|
|
|
34
34
|
expect(WebMock).to have_requested(
|
|
35
35
|
:post,
|
|
36
36
|
'https://www.ethikdo.co/api/v1/provisions/'
|
|
37
|
-
).with(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
'
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
).with(
|
|
38
|
+
headers: {
|
|
39
|
+
'Accept' => 'application/json',
|
|
40
|
+
'Authorization' => '1234',
|
|
41
|
+
'Content-Type' => 'application/json',
|
|
42
|
+
},
|
|
43
|
+
body: {
|
|
44
|
+
card_number: '1234123412341234',
|
|
45
|
+
card_crypto: '123'
|
|
46
|
+
}.to_json
|
|
47
|
+
)
|
|
44
48
|
end
|
|
45
49
|
|
|
46
50
|
it 'returns the correct response' do
|
data/spec/transaction_spec.rb
CHANGED
|
@@ -34,16 +34,19 @@ describe Ethikdo::Transaction do
|
|
|
34
34
|
expect(WebMock).to have_requested(
|
|
35
35
|
:post,
|
|
36
36
|
'https://www.ethikdo.co/api/v1/sales/'
|
|
37
|
-
).with(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
).with(
|
|
38
|
+
headers: {
|
|
39
|
+
'Accept' => 'application/json',
|
|
40
|
+
'Authorization' => '1234',
|
|
41
|
+
},
|
|
42
|
+
body: {
|
|
41
43
|
'capture_token' => 'foo',
|
|
42
44
|
'amount_requested' => '10000',
|
|
43
45
|
'amount_purchased' => '10000',
|
|
44
46
|
'transaction_id' => '1',
|
|
45
47
|
'customer_email' => 'foo@bar.com'
|
|
46
|
-
|
|
48
|
+
}.to_json
|
|
49
|
+
)
|
|
47
50
|
end
|
|
48
51
|
|
|
49
52
|
it 'returns the correct response' do
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ethikdo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Benoit Baumann
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2025-11-19 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rspec
|
|
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
148
148
|
- !ruby/object:Gem::Version
|
|
149
149
|
version: '0'
|
|
150
150
|
requirements: []
|
|
151
|
-
rubygems_version: 3.
|
|
151
|
+
rubygems_version: 3.5.22
|
|
152
152
|
signing_key:
|
|
153
153
|
specification_version: 4
|
|
154
154
|
summary: A ruby wrapper for Ethikdo REST API
|