justifi 0.6.3 → 0.6.4
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/LICENSE +21 -0
- data/README.md +32 -4
- data/lib/justifi/sub_account.rb +21 -0
- data/lib/justifi/version.rb +1 -1
- data/lib/justifi.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8b1dd482c0d269f7621fcd0dd4da6e7c88a265a3f2f571c66a66920589479dd
|
4
|
+
data.tar.gz: 3c9b45ea113b96f747e026f456559d07ed4f030c451d038b8abaebb543edbcd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df796eb3a054d46a31a0693094a79e6137723c70b52e31168b1e2c336b2fc85436b3f7b1a5239b81d72a0f364d54136bc46ef2bc4ceb59a446c78c113c046ded
|
7
|
+
data.tar.gz: 0da0f8059fda0400145767e31eb5c053a1fca4badf13d2894d938c194490a3a632f0eeea32eaebb58b6a599093d479a50e320493f242e861ac03a43edeffd327
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2023 JustiFi Technologies, Inc.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# JustiFi Ruby 
|
2
2
|
|
3
|
-
The JustiFi gem provides a simple way to access JustiFi API for apps written in Ruby language.
|
3
|
+
The JustiFi gem provides a simple way to access JustiFi API for apps written in Ruby language.
|
4
4
|
It includes a pre-defined set of modules and classes that are essentially wrapped versions of our API resources.
|
5
5
|
|
6
6
|
## Installation
|
@@ -187,15 +187,14 @@ refund = Justifi::Refund.get(refund_id: 're_xyz')
|
|
187
187
|
|
188
188
|
_Note: the term seller account has been deprecated and will be removed in future versions. Please use sub account instead_
|
189
189
|
|
190
|
-
You can make requests using the `Seller-Account` header in order to process resources as a seller-account.
|
190
|
+
You can make requests using the `Seller-Account` header (deprecated, use `Sub-Account` header) in order to process resources as a seller-account.
|
191
191
|
|
192
192
|
```ruby
|
193
193
|
seller_account_id = "acc_xyzs"
|
194
194
|
Justifi::PaymentIntent.create(params: payment_intent_params, seller_account_id: seller_account_id)
|
195
195
|
```
|
196
196
|
|
197
|
-
Any API resource using the `seller_account_id` variable will include the `Seller-Account` header and be
|
198
|
-
processed as the seller account.
|
197
|
+
Any API resource using the `seller_account_id` (deprecated, use `sub_account_id`) variable will include the `Seller-Account` header and be processed as the seller account.
|
199
198
|
|
200
199
|
## Sub Account
|
201
200
|
|
@@ -209,6 +208,35 @@ Justifi::PaymentIntent.create(params: payment_intent_params, sub_account_id: sub
|
|
209
208
|
Any API resource using the `sub_account_id` variable will include the `Sub-Account` header and be
|
210
209
|
processed as the sub account.
|
211
210
|
|
211
|
+
### Create a Sub Account
|
212
|
+
|
213
|
+
```ruby
|
214
|
+
Justifi::SubAccount.create(params: { name: "Created from Ruby SDK" })
|
215
|
+
```
|
216
|
+
|
217
|
+
### List Sub Accounts
|
218
|
+
|
219
|
+
```ruby
|
220
|
+
sub_accounts = Justifi::SubAccount.list
|
221
|
+
|
222
|
+
# pagination
|
223
|
+
sub_accounts = Justifi::SubAccount.list(params: {limit: 5})
|
224
|
+
sub_accounts = sub_accounts.next_page if sub_accounts.has_next
|
225
|
+
sub_accounts = sub_accounts.previous_page if sub_accounts.has_previous
|
226
|
+
```
|
227
|
+
|
228
|
+
To list archived sub accounts, use the optional status parameter set to archived
|
229
|
+
|
230
|
+
```ruby
|
231
|
+
archived_accounts = Justifi::SubAccount.list(params: {status: "archived"})
|
232
|
+
```
|
233
|
+
|
234
|
+
### Get Sub Accounts
|
235
|
+
|
236
|
+
```ruby
|
237
|
+
sub_account = Justifi::SubAccount.get(sub_account_id: "acc_xyzs")
|
238
|
+
```
|
239
|
+
|
212
240
|
## Webhook Signature Verification
|
213
241
|
|
214
242
|
Webhooks are secured by signature verification. An encrypted header is sent as a POST to your API endpoint (JUSTIFI-SIGNATURE),
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Justifi
|
4
|
+
module SubAccount
|
5
|
+
class << self
|
6
|
+
def create(params:, headers: {})
|
7
|
+
JustifiOperations.execute_post_request("/v1/sub_accounts", params, headers)
|
8
|
+
end
|
9
|
+
|
10
|
+
def list(params: {}, headers: {})
|
11
|
+
JustifiOperations.list("/v1/sub_accounts", params, headers)
|
12
|
+
end
|
13
|
+
|
14
|
+
def get(sub_account_id:, headers: {})
|
15
|
+
JustifiOperations.execute_get_request("/v1/sub_accounts/#{sub_account_id}",
|
16
|
+
{},
|
17
|
+
headers)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/justifi/version.rb
CHANGED
data/lib/justifi.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: justifi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JustiFi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -153,6 +153,7 @@ files:
|
|
153
153
|
- ".rubocop.yml"
|
154
154
|
- CODE_OF_CONDUCT.md
|
155
155
|
- Gemfile
|
156
|
+
- LICENSE
|
156
157
|
- README.md
|
157
158
|
- Rakefile
|
158
159
|
- bin/console
|
@@ -175,6 +176,7 @@ files:
|
|
175
176
|
- lib/justifi/payment_method.rb
|
176
177
|
- lib/justifi/payout.rb
|
177
178
|
- lib/justifi/refund.rb
|
179
|
+
- lib/justifi/sub_account.rb
|
178
180
|
- lib/justifi/util.rb
|
179
181
|
- lib/justifi/version.rb
|
180
182
|
- lib/justifi/webhook.rb
|