justifi 0.6.7 → 0.9.0

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: bfa7c3bc72ed4e1072dd00fc23322177e6a3ba32cd98aab4b6d8401ebe634d1a
4
- data.tar.gz: 56b619b105bb1999df1fb49d1f6cb705702708aaf3a47c57e6e667d3f1a90ef0
3
+ metadata.gz: 82a9df0515849f544d804cf04d4bb75168da326e5666e60942ec876bd0b77869
4
+ data.tar.gz: c62ee0120e0414f4a482cd729a673e71fec47f388b55727c06a724afdf00f7d3
5
5
  SHA512:
6
- metadata.gz: ae6b4eefc1041d4068078ecaed3e2ec969ebe5aa75fbbf0f347ddd01e59577aafb074bc924ee05c7fd06eba452ecf92c47f9b84b4af749ff9d12a69cc7aca370
7
- data.tar.gz: a2fd12773717fbbdfab369ef787ad1d18fe01efc5811fad81b1f1ad477644d7df1df8fa960a7bb7633c5c2ff701a8c8cb665916956eeb9ecbdc557ab17d38ca7
6
+ metadata.gz: 0add9d65d10543923d07c89f1f99d72cbd9ae9c11da9d2a6960edc13ad4a76e1d3a10740a59e4dd635a51464c4c87f1a0360a7aa764e06fc91858f0d7eb90dc0
7
+ data.tar.gz: eceb3a2e2052ca4b689f85b38bfe884ff9a4bcc0f64c045f6b75788e7089aac4f3d14893a0ed8ff974c991de2db7abf2744f6d7fbe7598cb97fec729d75701e0
@@ -77,7 +77,7 @@ jobs:
77
77
  git config user.name "JustiFi Machina"
78
78
  git config user.email "justifi.machina@justifi.ai"
79
79
  git tag -a "${TAG}" -m "Version ${VERSION}" "${GITHUB_SHA}"
80
- git remote set-url origin "https://justifi-machina:${{ secrets.JUSTIFI_MACHINA_GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
80
+ git remote set-url origin "https://justifi-machina:${{ secrets.JM_GH_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
81
81
  git push origin refs/tags/${TAG}
82
82
 
83
83
  - name: Build gem
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Justifi
4
+ module Business
5
+ class << self
6
+ def create(params:, headers: {})
7
+ JustifiOperations.execute_post_request("/v1/entities/business", params, headers)
8
+ end
9
+
10
+ def list(params: {}, headers: {})
11
+ JustifiOperations.list("/v1/entities/business", params, headers)
12
+ end
13
+
14
+ def get(business_id:, headers: {})
15
+ JustifiOperations.execute_get_request("/v1/entities/business/#{business_id}",
16
+ {},
17
+ headers)
18
+ end
19
+
20
+ def update(business_id:, params:, headers: {})
21
+ JustifiOperations.execute_patch_request("/v1/entities/business/#{business_id}", params, headers)
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Justifi
4
+ module Checkout
5
+ class << self
6
+ def list(params: {}, headers: {}, sub_account_id: nil)
7
+ headers[:sub_account] = sub_account_id if sub_account_id
8
+
9
+ JustifiOperations.execute_get_request("/v1/checkouts", params, headers)
10
+ end
11
+
12
+ def get(checkout_id:, headers: {})
13
+ JustifiOperations.execute_get_request("/v1/checkouts/#{checkout_id}",
14
+ {},
15
+ headers)
16
+ end
17
+
18
+ def update(checkout_id:, params: {}, headers: {}, idempotency_key: nil)
19
+ JustifiOperations.execute_patch_request("/v1/checkouts/#{checkout_id}", params, headers)
20
+ end
21
+
22
+ def create(params: {}, headers: {}, sub_account_id: nil)
23
+ headers[:sub_account] = sub_account_id if sub_account_id
24
+
25
+ JustifiOperations.execute_post_request("/v1/checkouts", params, headers)
26
+ end
27
+
28
+ def complete(checkout_id:, params: {}, headers: {}, idempotency_key: nil, sub_account_id: nil)
29
+ headers[:sub_account] = sub_account_id if sub_account_id
30
+
31
+ JustifiOperations.idempotently_request("/v1/checkouts/#{checkout_id}/complete",
32
+ method: :post,
33
+ params: params,
34
+ headers: headers,
35
+ idempotency_key: idempotency_key)
36
+ end
37
+ end
38
+ end
39
+ end
@@ -20,7 +20,8 @@ module Justifi
20
20
  JustifiOperations.idempotently_request("/v1/disputes/#{dispute_id}",
21
21
  method: :patch,
22
22
  params: params,
23
- headers: {})
23
+ headers: {},
24
+ idempotency_key: idempotency_key)
24
25
  end
25
26
  end
26
27
  end
data/lib/justifi/oauth.rb CHANGED
@@ -7,7 +7,7 @@ module Justifi
7
7
 
8
8
  def self.execute_post_request(path, params, headers)
9
9
  params = Util.normalize_params(params.merge(Justifi.credentials))
10
- super(path, params, headers)
10
+ super
11
11
  end
12
12
  end
13
13
 
@@ -22,6 +22,11 @@ module Justifi
22
22
 
23
23
  Justifi.cache.set_and_return(:access_token, response.access_token)
24
24
  end
25
+
26
+ def get_web_component_token(resources:)
27
+ params = {resources: resources}
28
+ JustifiOperations.execute_post_request("/v1/web_component_tokens", params, {})
29
+ end
25
30
  end
26
31
  end
27
32
  end
@@ -10,15 +10,17 @@ module Justifi
10
10
  JustifiOperations.idempotently_request("/v1/payments",
11
11
  method: :post,
12
12
  params: params,
13
- headers: headers)
13
+ headers: headers,
14
+ idempotency_key: idempotency_key)
14
15
  end
15
16
 
16
- def create_refund(amount:, payment_id:, reason: nil, description: nil, metadata: nil)
17
+ def create_refund(amount:, payment_id:, reason: nil, description: nil, metadata: nil, idempotency_key: nil)
17
18
  refund_params = {amount: amount, description: description, reason: reason, metadata: metadata}
18
19
  JustifiOperations.idempotently_request("/v1/payments/#{payment_id}/refunds",
19
20
  method: :post,
20
21
  params: refund_params,
21
- headers: {})
22
+ headers: {},
23
+ idempotency_key: idempotency_key)
22
24
  end
23
25
 
24
26
  def list(params: {}, headers: {}, seller_account_id: nil, sub_account_id: nil)
@@ -38,7 +40,8 @@ module Justifi
38
40
  JustifiOperations.idempotently_request("/v1/payments/#{payment_id}",
39
41
  method: :patch,
40
42
  params: params,
41
- headers: {})
43
+ headers: {},
44
+ idempotency_key: idempotency_key)
42
45
  end
43
46
 
44
47
  def capture(payment_id:, amount: nil, headers: {}, idempotency_key: nil)
@@ -46,7 +49,8 @@ module Justifi
46
49
  JustifiOperations.idempotently_request("/v1/payments/#{payment_id}/capture",
47
50
  method: :post,
48
51
  params: params,
49
- headers: {})
52
+ headers: {},
53
+ idempotency_key: idempotency_key)
50
54
  end
51
55
 
52
56
  def balance_transactions(payment_id:, params: {}, headers: {})
@@ -27,11 +27,12 @@ module Justifi
27
27
  headers)
28
28
  end
29
29
 
30
- def update(token:, card_params:, headers: {})
30
+ def update(token:, card_params:, headers: {}, idempotency_key: nil)
31
31
  JustifiOperations.idempotently_request("/v1/payment_methods/#{token}",
32
32
  method: :patch,
33
33
  params: card_params,
34
- headers: {})
34
+ headers: {},
35
+ idempotency_key: idempotency_key)
35
36
  end
36
37
  end
37
38
  end
@@ -20,7 +20,8 @@ module Justifi
20
20
  JustifiOperations.idempotently_request("/v1/payouts/#{payout_id}",
21
21
  method: :patch,
22
22
  params: params,
23
- headers: {})
23
+ headers: {},
24
+ idempotency_key: idempotency_key)
24
25
  end
25
26
  end
26
27
  end
@@ -20,7 +20,8 @@ module Justifi
20
20
  JustifiOperations.idempotently_request("/v1/refunds/#{refund_id}",
21
21
  method: :patch,
22
22
  params: params,
23
- headers: {})
23
+ headers: {},
24
+ idempotency_key: idempotency_key)
24
25
  end
25
26
  end
26
27
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Justifi
4
- VERSION = "0.6.7"
4
+ VERSION = "0.9.0"
5
5
  end
data/lib/justifi.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "forwardable"
4
4
  require "securerandom"
5
+ require "ostruct"
5
6
  require "justifi/api_operations"
6
7
 
7
8
  require "justifi/util"
@@ -15,8 +16,10 @@ require "justifi/version"
15
16
  require "justifi/configuration"
16
17
  require "justifi/oauth"
17
18
  require "justifi/sub_account"
19
+ require "justifi/business"
18
20
  require "justifi/payment"
19
21
  require "justifi/refund"
22
+ require "justifi/checkout"
20
23
  require "justifi/payout"
21
24
  require "justifi/checkout_session"
22
25
  require "justifi/balance_transaction"
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.7
4
+ version: 0.9.0
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-24 00:00:00.000000000 Z
11
+ date: 2024-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -162,6 +162,8 @@ files:
162
162
  - lib/justifi.rb
163
163
  - lib/justifi/api_operations.rb
164
164
  - lib/justifi/balance_transaction.rb
165
+ - lib/justifi/business.rb
166
+ - lib/justifi/checkout.rb
165
167
  - lib/justifi/checkout_session.rb
166
168
  - lib/justifi/configuration.rb
167
169
  - lib/justifi/dispute.rb
@@ -203,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
205
  - !ruby/object:Gem::Version
204
206
  version: '0'
205
207
  requirements: []
206
- rubygems_version: 3.2.32
208
+ rubygems_version: 3.0.3.1
207
209
  signing_key:
208
210
  specification_version: 4
209
211
  summary: JustiFi API wrapper gem