modulr-api 0.0.14 → 0.0.16
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 +2 -2
- data/README.md +14 -1
- data/lib/modulr/auth/signature.rb +3 -3
- data/lib/modulr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e538f41d8e5d2d64dc75db3ec234e67367b592262530d926c622280d2557f08e
|
4
|
+
data.tar.gz: 91a2fdd93f8ae2afc8cc94aad9a9884af13dc294666257fc16f105cfec7b7372
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35612c3c6b7d42c447b14808f91c23955cb755ccd02759f0fc445568612374c8efabc74fd79b8f2bde46d353b1b2467e07db1de8f823ab6dfe623cde21782700
|
7
|
+
data.tar.gz: 7194973cdbd13a67fcca831c92547df26f9ee0791c35cd64b1ac6d524dc74843dea2684a961de2d0d15d9966baa6dd1e8a526e6e0d7bb50d08490c1aa6ec7ab2
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -56,6 +56,13 @@ client.payments.list(from: DateTime.now - 1, to: DateTime.now)
|
|
56
56
|
client.payments.create(account_id: "A2188C26", currency: "EUR", amount: 0.01, destination: { type: "IBAN", iban: "ES8601280011390100072676", name: "Aitor García Rey" }, reference: "The reference")
|
57
57
|
```
|
58
58
|
|
59
|
+
### Transactions
|
60
|
+
|
61
|
+
```rb
|
62
|
+
# List transactions
|
63
|
+
client.transactions.list(account_id: "A2188C26", credit: true)
|
64
|
+
```
|
65
|
+
|
59
66
|
### Notifications
|
60
67
|
|
61
68
|
### Supported event types per channel
|
@@ -89,9 +96,15 @@ Supported via email:
|
|
89
96
|
|
90
97
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
91
98
|
|
92
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
99
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
100
|
+
|
101
|
+
To release a new version, on main branch update the version number in `version.rb`, then:
|
93
102
|
|
94
103
|
```git
|
104
|
+
bundle exec rake install
|
105
|
+
git add .
|
106
|
+
git commit -m 'Update version file and gemfile'
|
107
|
+
git push
|
95
108
|
git tag vx.x.x main
|
96
109
|
git push origin vx.x.x
|
97
110
|
```
|
@@ -17,7 +17,7 @@ module Modulr
|
|
17
17
|
@timestamp = timestamp
|
18
18
|
@authorization = [
|
19
19
|
"Signature keyId=\"#{apikey}\"",
|
20
|
-
'algorithm="hmac-
|
20
|
+
'algorithm="hmac-sha512"',
|
21
21
|
'headers="date x-mod-nonce"',
|
22
22
|
"signature=\"#{signature}\"",
|
23
23
|
].join(",")
|
@@ -26,11 +26,11 @@ module Modulr
|
|
26
26
|
def self.calculate(apikey:, apisecret:, nonce: SecureRandom.base64(30), timestamp: DateTime.now.httpdate)
|
27
27
|
signature_string = "date: #{timestamp}\nx-mod-nonce: #{nonce}"
|
28
28
|
digest = OpenSSL::HMAC.digest(
|
29
|
-
"
|
29
|
+
"SHA512",
|
30
30
|
apisecret.dup.force_encoding("UTF-8"),
|
31
31
|
signature_string.dup.force_encoding("UTF-8")
|
32
32
|
)
|
33
|
-
b64 = Base64.
|
33
|
+
b64 = Base64.strict_encode64(digest)
|
34
34
|
url_safe_code = ERB::Util.url_encode(b64.strip)
|
35
35
|
|
36
36
|
new(apikey: apikey, nonce: nonce, signature: url_safe_code, timestamp: timestamp)
|
data/lib/modulr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modulr-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aitor García Rey
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|