justifi 0.7.0 → 0.8.3
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 +4 -4
- data/.github/workflows/build_and_release.yml +1 -1
- data/lib/justifi/checkout.rb +39 -0
- data/lib/justifi/oauth.rb +6 -1
- data/lib/justifi/version.rb +1 -1
- data/lib/justifi.rb +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d7e3adbae85e1cbf91ddf89e842728ac743866becd785f66cfa49e9a9fece81
|
4
|
+
data.tar.gz: c76d056a8503461fa50a7113fee88b6241d1004c39df89d923013f776eaf510a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d3ad3f09cf9d25593ddd86a93db3044593a2273faf5335dd15d0b80da37bc623e111a769116e06bfa037b25fc5646740788b4db77e667c70700d5f201397d5e
|
7
|
+
data.tar.gz: 7b595936601ff3ad37ef3b7d5e84daf79461b7acb6d276665b9e71f0bcd87d428915d5ccf03c45a47d5225ac2e1a2ce5977e3bb7f75b0c7fb32b378e5c6bb3bc
|
@@ -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.
|
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,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
|
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
|
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
|
data/lib/justifi/version.rb
CHANGED
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"
|
@@ -17,6 +18,7 @@ require "justifi/oauth"
|
|
17
18
|
require "justifi/sub_account"
|
18
19
|
require "justifi/payment"
|
19
20
|
require "justifi/refund"
|
21
|
+
require "justifi/checkout"
|
20
22
|
require "justifi/payout"
|
21
23
|
require "justifi/checkout_session"
|
22
24
|
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.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JustiFi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -162,6 +162,7 @@ files:
|
|
162
162
|
- lib/justifi.rb
|
163
163
|
- lib/justifi/api_operations.rb
|
164
164
|
- lib/justifi/balance_transaction.rb
|
165
|
+
- lib/justifi/checkout.rb
|
165
166
|
- lib/justifi/checkout_session.rb
|
166
167
|
- lib/justifi/configuration.rb
|
167
168
|
- lib/justifi/dispute.rb
|