justifi 0.6.3 → 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: 2bbffd3460ad146d4a1b0956a94af4f8434c19686069707b13e7bec8de7cf9e9
4
- data.tar.gz: f8dadb2dd0430c56df9eade673420240b6cc59b6ec14467f7ce77a30c7b661cc
3
+ metadata.gz: c8b1dd482c0d269f7621fcd0dd4da6e7c88a265a3f2f571c66a66920589479dd
4
+ data.tar.gz: 3c9b45ea113b96f747e026f456559d07ed4f030c451d038b8abaebb543edbcd3
5
5
  SHA512:
6
- metadata.gz: bf993128d1ddd819b14ec4ad37c268441ebc0663dc7a174ec4956561a3ba8b7b09397d4dc958ca604faa027cb02fa3294467b6ce64f4d58fdcc99bcf2b50572c
7
- data.tar.gz: 1bd42000dac09cc4c10c32b10437bfa7c50ff615ffda2f492692cdfb6077fb36bfc74c11a6ad1727064449680a0d665bb303d216783d3fc23848e5efbd0fbf42
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 ![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.3"
4
+ VERSION = "0.6.4"
5
5
  end
data/lib/justifi.rb CHANGED
@@ -13,6 +13,7 @@ require "justifi/justifi_error"
13
13
  require "justifi/version"
14
14
  require "justifi/configuration"
15
15
  require "justifi/oauth"
16
+ require "justifi/sub_account"
16
17
  require "justifi/payment"
17
18
  require "justifi/refund"
18
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.3
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,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