justifi 0.6.1 → 0.6.3

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: bcd2d68a4fce4e0a644aa81c8c65e9e0a11bb31991583379b86b00d5db3f79e2
4
- data.tar.gz: 5c7edcdb32022a4f56bbd3a688b496d376838dbce1b4528ccb6201e0e2eaddf1
3
+ metadata.gz: 2bbffd3460ad146d4a1b0956a94af4f8434c19686069707b13e7bec8de7cf9e9
4
+ data.tar.gz: f8dadb2dd0430c56df9eade673420240b6cc59b6ec14467f7ce77a30c7b661cc
5
5
  SHA512:
6
- metadata.gz: 150f2bb84c5fba3693dbf7d4c6889963809c00314e468845c3c6dbab3a9b2eec6b2b574fde0ab85821c62a9b519b116eddeafc65280dd0cf188e9941ff052bf5
7
- data.tar.gz: e3612d77657510b4bcadaf8fbe6a316b642a9292f3048a5c7a4925b3d3852f9da8d3a14a58e0f04b1399f50b21ee5dd2d63b9dfd3c4bd62fb4c78b913e99ea7b
6
+ metadata.gz: bf993128d1ddd819b14ec4ad37c268441ebc0663dc7a174ec4956561a3ba8b7b09397d4dc958ca604faa027cb02fa3294467b6ce64f4d58fdcc99bcf2b50572c
7
+ data.tar.gz: 1bd42000dac09cc4c10c32b10437bfa7c50ff615ffda2f492692cdfb6077fb36bfc74c11a6ad1727064449680a0d665bb303d216783d3fc23848e5efbd0fbf42
data/.gitignore CHANGED
@@ -13,3 +13,5 @@ examples/
13
13
  .env
14
14
  .byebug_history
15
15
  .DS_STORE
16
+
17
+ Gemfile.lock
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.3"
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"
@@ -68,6 +69,10 @@ module Justifi
68
69
  def get_idempotency_key
69
70
  SecureRandom.uuid
70
71
  end
72
+
73
+ def seller_account_deprecation_warning
74
+ warn "[DEPRECATED] seller account has been deprecated, please use sub account"
75
+ end
71
76
  end
72
77
 
73
78
  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.3
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
@@ -153,7 +153,6 @@ files:
153
153
  - ".rubocop.yml"
154
154
  - CODE_OF_CONDUCT.md
155
155
  - Gemfile
156
- - Gemfile.lock
157
156
  - README.md
158
157
  - Rakefile
159
158
  - bin/console
data/Gemfile.lock DELETED
@@ -1,92 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- justifi (0.6.1)
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.2.15