justifi 0.6.2 → 0.6.4

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: 21b36905fdfba07fef327aa757cf18c609803087b90e1531e3c5c9ab6e913c5c
4
- data.tar.gz: b1b16091a67b83ff86e35c10434776413f94ae0b2df820b247da0b1dc14c4632
3
+ metadata.gz: c8b1dd482c0d269f7621fcd0dd4da6e7c88a265a3f2f571c66a66920589479dd
4
+ data.tar.gz: 3c9b45ea113b96f747e026f456559d07ed4f030c451d038b8abaebb543edbcd3
5
5
  SHA512:
6
- metadata.gz: 528bad80f705b60cf46fdf1d17dcc56e214a555700e6a49551f872f0cdad6bba5f1986f948e32152063cca3391b2081643dc2077e9183494a3df2949bb9b1621
7
- data.tar.gz: e06b6cc9697a4078b016b50ca2da205467b9672e0011f355410d32e2dd38fb7253345d4621231c61eeb808c5a75b6709bc3813a08221b2604f06b8f46e9d0790
6
+ metadata.gz: df796eb3a054d46a31a0693094a79e6137723c70b52e31168b1e2c336b2fc85436b3f7b1a5239b81d72a0f364d54136bc46ef2bc4ceb59a446c78c113c046ded
7
+ data.tar.gz: 0da0f8059fda0400145767e31eb5c053a1fca4badf13d2894d938c194490a3a632f0eeea32eaebb58b6a599093d479a50e320493f242e861ac03a43edeffd327
data/.gitignore CHANGED
@@ -13,3 +13,5 @@ examples/
13
13
  .env
14
14
  .byebug_history
15
15
  .DS_STORE
16
+
17
+ Gemfile.lock
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 ![Coverage](https://justifi-gem-assets.s3.us-east-2.amazonaws.com/coverage_badge_total.svg)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Justifi
4
- VERSION = "0.6.2"
4
+ VERSION = "0.6.4"
5
5
  end
data/lib/justifi.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "forwardable"
3
4
  require "justifi/api_operations"
4
5
 
5
6
  require "justifi/util"
@@ -12,6 +13,7 @@ require "justifi/justifi_error"
12
13
  require "justifi/version"
13
14
  require "justifi/configuration"
14
15
  require "justifi/oauth"
16
+ require "justifi/sub_account"
15
17
  require "justifi/payment"
16
18
  require "justifi/refund"
17
19
  require "justifi/payout"
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.2
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-13 00:00:00.000000000 Z
11
+ date: 2023-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -153,7 +153,7 @@ files:
153
153
  - ".rubocop.yml"
154
154
  - CODE_OF_CONDUCT.md
155
155
  - Gemfile
156
- - Gemfile.lock
156
+ - LICENSE
157
157
  - README.md
158
158
  - Rakefile
159
159
  - bin/console
@@ -176,6 +176,7 @@ files:
176
176
  - lib/justifi/payment_method.rb
177
177
  - lib/justifi/payout.rb
178
178
  - lib/justifi/refund.rb
179
+ - lib/justifi/sub_account.rb
179
180
  - lib/justifi/util.rb
180
181
  - lib/justifi/version.rb
181
182
  - lib/justifi/webhook.rb
data/Gemfile.lock DELETED
@@ -1,92 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- justifi (0.6.2)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- addressable (2.8.0)
10
- public_suffix (>= 2.0.2, < 5.0)
11
- ast (2.4.2)
12
- byebug (11.1.3)
13
- crack (0.4.5)
14
- rexml
15
- diff-lcs (1.5.0)
16
- docile (1.4.0)
17
- dotenv (2.7.6)
18
- hashdiff (1.0.1)
19
- parallel (1.22.1)
20
- parser (3.1.2.0)
21
- ast (~> 2.4.1)
22
- public_suffix (4.0.7)
23
- rainbow (3.1.1)
24
- rake (13.0.6)
25
- regexp_parser (2.4.0)
26
- repo-small-badge (0.2.7)
27
- victor (~> 0.2.8)
28
- rexml (3.2.5)
29
- rspec (3.11.0)
30
- rspec-core (~> 3.11.0)
31
- rspec-expectations (~> 3.11.0)
32
- rspec-mocks (~> 3.11.0)
33
- rspec-core (3.11.0)
34
- rspec-support (~> 3.11.0)
35
- rspec-expectations (3.11.0)
36
- diff-lcs (>= 1.2.0, < 2.0)
37
- rspec-support (~> 3.11.0)
38
- rspec-mocks (3.11.1)
39
- diff-lcs (>= 1.2.0, < 2.0)
40
- rspec-support (~> 3.11.0)
41
- rspec-support (3.11.0)
42
- rubocop (1.29.1)
43
- parallel (~> 1.10)
44
- parser (>= 3.1.0.0)
45
- rainbow (>= 2.2.2, < 4.0)
46
- regexp_parser (>= 1.8, < 3.0)
47
- rexml (>= 3.2.5, < 4.0)
48
- rubocop-ast (>= 1.17.0, < 2.0)
49
- ruby-progressbar (~> 1.7)
50
- unicode-display_width (>= 1.4.0, < 3.0)
51
- rubocop-ast (1.18.0)
52
- parser (>= 3.1.1.0)
53
- rubocop-performance (1.13.3)
54
- rubocop (>= 1.7.0, < 2.0)
55
- rubocop-ast (>= 0.4.0)
56
- ruby-progressbar (1.11.0)
57
- simplecov (0.21.2)
58
- docile (~> 1.1)
59
- simplecov-html (~> 0.11)
60
- simplecov_json_formatter (~> 0.1)
61
- simplecov-html (0.12.3)
62
- simplecov-small-badge (0.2.4)
63
- repo-small-badge (~> 0.2.7)
64
- simplecov (~> 0.17)
65
- simplecov_json_formatter (0.1.4)
66
- standard (1.12.1)
67
- rubocop (= 1.29.1)
68
- rubocop-performance (= 1.13.3)
69
- unicode-display_width (2.1.0)
70
- victor (0.2.8)
71
- webmock (3.14.0)
72
- addressable (>= 2.8.0)
73
- crack (>= 0.3.2)
74
- hashdiff (>= 0.4.0, < 2.0.0)
75
-
76
- PLATFORMS
77
- ruby
78
-
79
- DEPENDENCIES
80
- byebug
81
- dotenv
82
- justifi!
83
- rake (~> 13.0)
84
- rspec (~> 3.0)
85
- rubocop
86
- simplecov
87
- simplecov-small-badge
88
- standard
89
- webmock (>= 3.8.0)
90
-
91
- BUNDLED WITH
92
- 2.4.6