modulr-api 0.0.20 → 0.0.22
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 +1 -1
- data/README.md +23 -4
- data/lib/modulr/resources/payments/destination.rb +7 -1
- data/lib/modulr/resources/payments/details/incoming/general.rb +8 -1
- 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: 17a999653b30cd623bb46c2869956d5762446d7df8c96db25595b29671e5bad5
|
4
|
+
data.tar.gz: 9f38f78ba8132e15f5a12cf09764250d1a648dab067fc9063656e3570e8a4b33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d66576dc1757c67beef2f58c26f574b130b5671d555e8e666b0ce8b4c6d02a2723210caaf8ae196ce8c4f2845c47a2b3e050d359ae435c7f28e0d7987aee01cc
|
7
|
+
data.tar.gz: 659a084781dc4057003ba4f7880dd62eb911963782036f60fe6145f9e84dd51133d61c8740a45c13b27cb66c7db491dfdd0fab271b03c934492b41d5350450b1
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -146,6 +146,25 @@ Supported via email:
|
|
146
146
|
- BALANCE
|
147
147
|
- CUSTVSTAT
|
148
148
|
|
149
|
+
```rb
|
150
|
+
# List setup notifications for a customer
|
151
|
+
client.notifications.list(customer_id: "C2188C26")
|
152
|
+
|
153
|
+
# Create a notification
|
154
|
+
client.notifications.create(
|
155
|
+
customer_id: "C2188C26",
|
156
|
+
type: "PAYOUT",
|
157
|
+
channel: "WEBHOOK",
|
158
|
+
destinations: [
|
159
|
+
"https://yourwebsite.com/webhooks/endpoint"
|
160
|
+
],
|
161
|
+
config: {
|
162
|
+
retry: true,
|
163
|
+
secret: "00000000000000000000000000000000",
|
164
|
+
hmacAlgorithm: "hmac-sha512"
|
165
|
+
})
|
166
|
+
```
|
167
|
+
|
149
168
|
## Release
|
150
169
|
|
151
170
|
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.
|
@@ -155,12 +174,12 @@ To install this gem onto your local machine, run `bundle exec rake install`.
|
|
155
174
|
To release a new version, on main branch update the version number in `version.rb`, then:
|
156
175
|
|
157
176
|
```git
|
158
|
-
bundle
|
177
|
+
bundle install
|
159
178
|
git add .
|
160
|
-
git commit -m '
|
179
|
+
git commit -m 'feat(release): Bump to vX.X.X'
|
161
180
|
git push
|
162
|
-
git tag
|
163
|
-
git push origin
|
181
|
+
git tag vX.X.X main
|
182
|
+
git push origin vX.X.X
|
164
183
|
```
|
165
184
|
|
166
185
|
The tagging will trigger the GitHub action defined in `release.yml`, pushing the gem to [rubygems.org](https://rubygems.org).
|
@@ -4,9 +4,15 @@ module Modulr
|
|
4
4
|
module Resources
|
5
5
|
module Payments
|
6
6
|
class Destination < Base
|
7
|
+
attr_reader :identifier
|
8
|
+
|
7
9
|
map :type
|
8
|
-
map :iban
|
9
10
|
map :name
|
11
|
+
|
12
|
+
def initialize(raw_response, attributes = {})
|
13
|
+
super(raw_response, attributes)
|
14
|
+
@identifier = Accounts::Identifier.new(nil, attributes)
|
15
|
+
end
|
10
16
|
end
|
11
17
|
end
|
12
18
|
end
|
@@ -6,7 +6,7 @@ module Modulr
|
|
6
6
|
module Details
|
7
7
|
module Incoming
|
8
8
|
class General < Base
|
9
|
-
attr_reader :payer, :payee
|
9
|
+
attr_reader :payer, :payee, :destination
|
10
10
|
|
11
11
|
map :created, :created_at
|
12
12
|
map :posted, :posted_at
|
@@ -31,6 +31,13 @@ module Modulr
|
|
31
31
|
super(raw_response, attributes)
|
32
32
|
@payer = Counterparty.new(nil, attributes[:payer])
|
33
33
|
@payee = Counterparty.new(nil, attributes[:payee])
|
34
|
+
@destination = parse_destination(attributes)
|
35
|
+
end
|
36
|
+
|
37
|
+
private def parse_destination(attributes)
|
38
|
+
destination_params = attributes[:payee][:identifier].merge!(name: attributes[:payee][:name])
|
39
|
+
|
40
|
+
Destination.new(nil, destination_params)
|
34
41
|
end
|
35
42
|
end
|
36
43
|
end
|
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.22
|
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-04-
|
11
|
+
date: 2023-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|