justifi 0.6.4 → 0.6.6

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: c8b1dd482c0d269f7621fcd0dd4da6e7c88a265a3f2f571c66a66920589479dd
4
- data.tar.gz: 3c9b45ea113b96f747e026f456559d07ed4f030c451d038b8abaebb543edbcd3
3
+ metadata.gz: 336f40c377552950348f439beca86b56603279f8957ac57a5d149a7d85517edc
4
+ data.tar.gz: 30ae032dc49f5e59fe4f8929dc6408db7f60f04b8edd54ccf2bcbe9b040e4c49
5
5
  SHA512:
6
- metadata.gz: df796eb3a054d46a31a0693094a79e6137723c70b52e31168b1e2c336b2fc85436b3f7b1a5239b81d72a0f364d54136bc46ef2bc4ceb59a446c78c113c046ded
7
- data.tar.gz: 0da0f8059fda0400145767e31eb5c053a1fca4badf13d2894d938c194490a3a632f0eeea32eaebb58b6a599093d479a50e320493f242e861ac03a43edeffd327
6
+ metadata.gz: b0f05db84aef2bae4395cbe6ebd4a7bccfa5dc886157cfb7367a7abfb993c2e51adec6466f1d8da35aba9d47de79d49726174c43869e249d190c254300544eb4
7
+ data.tar.gz: 41afe74e5e8c8365368c70e0d51c52db8efa569443d583cf1b5ac3389cd72291ac153678b17e7093596f7968c95499fe5fb33cd86e23ded4cf0d7fb71a2a3d5e
data/README.md CHANGED
@@ -237,6 +237,23 @@ archived_accounts = Justifi::SubAccount.list(params: {status: "archived"})
237
237
  sub_account = Justifi::SubAccount.get(sub_account_id: "acc_xyzs")
238
238
  ```
239
239
 
240
+ ## Create a Checkout Session
241
+
242
+ If you are using our hosted checkout solution, follow this to generate a session:
243
+
244
+ ```ruby
245
+
246
+ # create a payment intent (check params [here](https://developer.justifi.ai/#operation/CreateCheckoutSession))
247
+ py = Justifi::PaymentIntent.create(sub_account_id: "acc_xyz", params: {})
248
+
249
+ # create a session (check params [here](https://developer.justifi.ai/#operation/CreateCheckoutSession))
250
+ session = Justifi::CheckoutSession.create(params: {})
251
+
252
+ # use the session id to access your hosted checkout page at:
253
+ hosted_checkout_url = "https://hosted-checkout.justifi.ai/#{session.data.checkout_session_id}"
254
+ ```
255
+
256
+
240
257
  ## Webhook Signature Verification
241
258
 
242
259
  Webhooks are secured by signature verification. An encrypted header is sent as a POST to your API endpoint (JUSTIFI-SIGNATURE),
@@ -7,7 +7,7 @@ module Justifi
7
7
  Justifi.seller_account_deprecation_warning if seller_account_id
8
8
  headers[:sub_account] = sub_account_id || seller_account_id if sub_account_id || seller_account_id
9
9
 
10
- JustifiOperations.execute_get_request("/v1/balance_transactions", params, headers)
10
+ JustifiOperations.list("/v1/balance_transactions", params, headers)
11
11
  end
12
12
 
13
13
  def get(id:, headers: {})
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Justifi
4
+ module CheckoutSession
5
+ class << self
6
+ def create(params:, headers: {})
7
+ JustifiOperations.execute_post_request("/v1/checkout_sessions", params, headers)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Justifi
4
- VERSION = "0.6.4"
4
+ VERSION = "0.6.6"
5
5
  end
data/lib/justifi.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "forwardable"
4
+ require "securerandom"
4
5
  require "justifi/api_operations"
5
6
 
6
7
  require "justifi/util"
@@ -17,6 +18,7 @@ require "justifi/sub_account"
17
18
  require "justifi/payment"
18
19
  require "justifi/refund"
19
20
  require "justifi/payout"
21
+ require "justifi/checkout_session"
20
22
  require "justifi/balance_transaction"
21
23
  require "justifi/dispute"
22
24
  require "justifi/payment_method"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: justifi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - JustiFi
@@ -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_session.rb
165
166
  - lib/justifi/configuration.rb
166
167
  - lib/justifi/dispute.rb
167
168
  - lib/justifi/in_memory_cache.rb