justifi 0.6.1 → 0.6.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bcd2d68a4fce4e0a644aa81c8c65e9e0a11bb31991583379b86b00d5db3f79e2
4
- data.tar.gz: 5c7edcdb32022a4f56bbd3a688b496d376838dbce1b4528ccb6201e0e2eaddf1
3
+ metadata.gz: 21b36905fdfba07fef327aa757cf18c609803087b90e1531e3c5c9ab6e913c5c
4
+ data.tar.gz: b1b16091a67b83ff86e35c10434776413f94ae0b2df820b247da0b1dc14c4632
5
5
  SHA512:
6
- metadata.gz: 150f2bb84c5fba3693dbf7d4c6889963809c00314e468845c3c6dbab3a9b2eec6b2b574fde0ab85821c62a9b519b116eddeafc65280dd0cf188e9941ff052bf5
7
- data.tar.gz: e3612d77657510b4bcadaf8fbe6a316b642a9292f3048a5c7a4925b3d3852f9da8d3a14a58e0f04b1399f50b21ee5dd2d63b9dfd3c4bd62fb4c78b913e99ea7b
6
+ metadata.gz: 528bad80f705b60cf46fdf1d17dcc56e214a555700e6a49551f872f0cdad6bba5f1986f948e32152063cca3391b2081643dc2077e9183494a3df2949bb9b1621
7
+ data.tar.gz: e06b6cc9697a4078b016b50ca2da205467b9672e0011f355410d32e2dd38fb7253345d4621231c61eeb808c5a75b6709bc3813a08221b2604f06b8f46e9d0790
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- justifi (0.6.1)
4
+ justifi (0.6.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -89,4 +89,4 @@ DEPENDENCIES
89
89
  webmock (>= 3.8.0)
90
90
 
91
91
  BUNDLED WITH
92
- 2.2.15
92
+ 2.4.6
data/README.md CHANGED
@@ -183,7 +183,9 @@ payment = Justifi::Payment.get(payment_id: 'py_xyz')
183
183
  refund = Justifi::Refund.get(refund_id: 're_xyz')
184
184
  ```
185
185
 
186
- ## Seller Account
186
+ ## Seller Account (deprecated)
187
+
188
+ _Note: the term seller account has been deprecated and will be removed in future versions. Please use sub account instead_
187
189
 
188
190
  You can make requests using the `Seller-Account` header in order to process resources as a seller-account.
189
191
 
@@ -195,6 +197,18 @@ Justifi::PaymentIntent.create(params: payment_intent_params, seller_account_id:
195
197
  Any API resource using the `seller_account_id` variable will include the `Seller-Account` header and be
196
198
  processed as the seller account.
197
199
 
200
+ ## Sub Account
201
+
202
+ You can make requests using the `Sub-Account` header in order to process resources as a sub-account.
203
+
204
+ ```ruby
205
+ sub_account_id = "acc_xyzs"
206
+ Justifi::PaymentIntent.create(params: payment_intent_params, sub_account_id: sub_account_id)
207
+ ```
208
+
209
+ Any API resource using the `sub_account_id` variable will include the `Sub-Account` header and be
210
+ processed as the sub account.
211
+
198
212
  ## Webhook Signature Verification
199
213
 
200
214
  Webhooks are secured by signature verification. An encrypted header is sent as a POST to your API endpoint (JUSTIFI-SIGNATURE),
@@ -229,4 +243,4 @@ the gem to github packages.
229
243
  ## Code of Conduct
230
244
 
231
245
  Everyone interacting in the JustApi project's codebases, issue trackers, chat
232
- rooms and mailing lists is expected to follow the [code of conduct][].
246
+ rooms and mailing lists is expected to follow the [code of conduct](CODE_OF_CONDUCT.md).
@@ -3,8 +3,10 @@
3
3
  module Justifi
4
4
  module BalanceTransaction
5
5
  class << self
6
- def list(params: {}, headers: {}, seller_account_id: nil)
7
- headers[:seller_account] = seller_account_id if seller_account_id
6
+ def list(params: {}, headers: {}, seller_account_id: nil, sub_account_id: nil)
7
+ Justifi.seller_account_deprecation_warning if seller_account_id
8
+ headers[:sub_account] = sub_account_id || seller_account_id if sub_account_id || seller_account_id
9
+
8
10
  JustifiOperations.execute_get_request("/v1/balance_transactions", params, headers)
9
11
  end
10
12
 
@@ -3,8 +3,10 @@
3
3
  module Justifi
4
4
  module Dispute
5
5
  class << self
6
- def list(params: {}, headers: {}, seller_account_id: nil)
7
- headers[:seller_account] = seller_account_id if seller_account_id
6
+ def list(params: {}, headers: {}, seller_account_id: nil, sub_account_id: nil)
7
+ Justifi.seller_account_deprecation_warning if seller_account_id
8
+ headers[:sub_account] = sub_account_id || seller_account_id if sub_account_id || seller_account_id
9
+
8
10
  JustifiOperations.execute_get_request("/v1/disputes", params, headers)
9
11
  end
10
12
 
@@ -3,8 +3,10 @@
3
3
  module Justifi
4
4
  module Payment
5
5
  class << self
6
- def create(params: {}, headers: {}, idempotency_key: nil, seller_account_id: nil)
7
- headers[:seller_account] = seller_account_id if seller_account_id
6
+ def create(params: {}, headers: {}, idempotency_key: nil, seller_account_id: nil, sub_account_id: nil)
7
+ Justifi.seller_account_deprecation_warning if seller_account_id
8
+ headers[:sub_account] = sub_account_id || seller_account_id if sub_account_id || seller_account_id
9
+
8
10
  JustifiOperations.idempotently_request("/v1/payments",
9
11
  method: :post,
10
12
  params: params,
@@ -19,8 +21,10 @@ module Justifi
19
21
  headers: {})
20
22
  end
21
23
 
22
- def list(params: {}, headers: {}, seller_account_id: nil)
23
- headers[:seller_account] = seller_account_id if seller_account_id
24
+ def list(params: {}, headers: {}, seller_account_id: nil, sub_account_id: nil)
25
+ Justifi.seller_account_deprecation_warning if seller_account_id
26
+ headers[:sub_account] = sub_account_id || seller_account_id if sub_account_id || seller_account_id
27
+
24
28
  JustifiOperations.execute_get_request("/v1/payments", params, headers)
25
29
  end
26
30
 
@@ -3,13 +3,17 @@
3
3
  module Justifi
4
4
  module PaymentIntent
5
5
  class << self
6
- def list(params: {}, headers: {}, seller_account_id: nil)
7
- headers[:seller_account] = seller_account_id if seller_account_id
6
+ def list(params: {}, headers: {}, seller_account_id: nil, sub_account_id: nil)
7
+ Justifi.seller_account_deprecation_warning if seller_account_id
8
+ headers[:sub_account] = sub_account_id || seller_account_id if sub_account_id || seller_account_id
9
+
8
10
  JustifiOperations.execute_get_request("/v1/payment_intents", params, headers)
9
11
  end
10
12
 
11
- def list_payments(id:, params: {}, headers: {}, seller_account_id: nil)
12
- headers[:seller_account] = seller_account_id if seller_account_id
13
+ def list_payments(id:, params: {}, headers: {}, seller_account_id: nil, sub_account_id: nil)
14
+ Justifi.seller_account_deprecation_warning if seller_account_id
15
+ headers[:sub_account] = sub_account_id || seller_account_id if sub_account_id || seller_account_id
16
+
13
17
  JustifiOperations.execute_get_request("/v1/payment_intents/#{id}/payments", params, headers)
14
18
  end
15
19
 
@@ -27,8 +31,10 @@ module Justifi
27
31
  idempotency_key: idempotency_key)
28
32
  end
29
33
 
30
- def create(params: {}, headers: {}, idempotency_key: nil, seller_account_id: nil)
31
- headers[:seller_account] = seller_account_id if seller_account_id
34
+ def create(params: {}, headers: {}, idempotency_key: nil, seller_account_id: nil, sub_account_id: nil)
35
+ Justifi.seller_account_deprecation_warning if seller_account_id
36
+ headers[:sub_account] = sub_account_id || seller_account_id if sub_account_id || seller_account_id
37
+
32
38
  JustifiOperations.idempotently_request("/v1/payment_intents",
33
39
  method: :post,
34
40
  params: params,
@@ -3,8 +3,10 @@
3
3
  module Justifi
4
4
  module PaymentMethod
5
5
  class << self
6
- def create(params: {}, headers: {}, idempotency_key: nil, seller_account_id: nil)
7
- headers[:seller_account] = seller_account_id if seller_account_id
6
+ def create(params: {}, headers: {}, idempotency_key: nil, seller_account_id: nil, sub_account_id: nil)
7
+ Justifi.seller_account_deprecation_warning if seller_account_id
8
+ headers[:sub_account] = sub_account_id || seller_account_id if sub_account_id || seller_account_id
9
+
8
10
  JustifiOperations.idempotently_request("/v1/payment_methods",
9
11
  method: :post,
10
12
  params: params,
@@ -12,8 +14,10 @@ module Justifi
12
14
  idempotency_key: idempotency_key)
13
15
  end
14
16
 
15
- def list(params: {}, headers: {}, seller_account_id: nil)
16
- headers[:seller_account] = seller_account_id if seller_account_id
17
+ def list(params: {}, headers: {}, seller_account_id: nil, sub_account_id: nil)
18
+ Justifi.seller_account_deprecation_warning if seller_account_id
19
+ headers[:sub_account] = sub_account_id || seller_account_id if sub_account_id || seller_account_id
20
+
17
21
  JustifiOperations.list("/v1/payment_methods", params, headers)
18
22
  end
19
23
 
@@ -3,8 +3,10 @@
3
3
  module Justifi
4
4
  module Payout
5
5
  class << self
6
- def list(params: {}, headers: {}, seller_account_id: nil)
7
- headers[:seller_account] = seller_account_id if seller_account_id
6
+ def list(params: {}, headers: {}, seller_account_id: nil, sub_account_id: nil)
7
+ Justifi.seller_account_deprecation_warning if seller_account_id
8
+ headers[:sub_account] = sub_account_id || seller_account_id if sub_account_id || seller_account_id
9
+
8
10
  JustifiOperations.execute_get_request("/v1/payouts", params, headers)
9
11
  end
10
12
 
@@ -3,8 +3,10 @@
3
3
  module Justifi
4
4
  module Refund
5
5
  class << self
6
- def list(params: {}, headers: {}, seller_account_id: nil)
7
- headers[:seller_account] = seller_account_id if seller_account_id
6
+ def list(params: {}, headers: {}, seller_account_id: nil, sub_account_id: nil)
7
+ Justifi.seller_account_deprecation_warning if seller_account_id
8
+ headers[:sub_account] = sub_account_id || seller_account_id if sub_account_id || seller_account_id
9
+
8
10
  JustifiOperations.execute_get_request("/v1/refunds", params, headers)
9
11
  end
10
12
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Justifi
4
- VERSION = "0.6.1"
4
+ VERSION = "0.6.2"
5
5
  end
data/lib/justifi.rb CHANGED
@@ -68,6 +68,10 @@ module Justifi
68
68
  def get_idempotency_key
69
69
  SecureRandom.uuid
70
70
  end
71
+
72
+ def seller_account_deprecation_warning
73
+ warn "[DEPRECATED] seller account has been deprecated, please use sub account"
74
+ end
71
75
  end
72
76
 
73
77
  class BadCredentialsError < StandardError; end
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.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - JustiFi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-06 00:00:00.000000000 Z
11
+ date: 2023-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug