justifi 0.6.5 → 0.6.7

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: 8d6259198eb5929982df0e0112bd23b2320319ac4cb17d48d12a24ff8f4bc12d
4
- data.tar.gz: 2d449ca55ee2c7943992d5d267ae3d839d0bb12910202906517cd8d7c207d9ba
3
+ metadata.gz: bfa7c3bc72ed4e1072dd00fc23322177e6a3ba32cd98aab4b6d8401ebe634d1a
4
+ data.tar.gz: 56b619b105bb1999df1fb49d1f6cb705702708aaf3a47c57e6e667d3f1a90ef0
5
5
  SHA512:
6
- metadata.gz: 1d30e7f4575d1bf94ad407cd3894f1e9999774a93898ad497c454d035aa4d3823806a10fe32cd0ccb22ed57adb6a8002f390577f6eaad3450443937e7236cc08
7
- data.tar.gz: 58276f78ad3223aacfb9d06727303123718d29d90b7d94d0d882a14227c2292d04aecafa9c56bce5bb93a1fb47a9fbf90a427905855ec60735d070c0838dc482
6
+ metadata.gz: ae6b4eefc1041d4068078ecaed3e2ec969ebe5aa75fbbf0f347ddd01e59577aafb074bc924ee05c7fd06eba452ecf92c47f9b84b4af749ff9d12a69cc7aca370
7
+ data.tar.gz: a2fd12773717fbbdfab369ef787ad1d18fe01efc5811fad81b1f1ad477644d7df1df8fa960a7bb7633c5c2ff701a8c8cb665916956eeb9ecbdc557ab17d38ca7
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),
@@ -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
@@ -25,7 +25,7 @@ module Justifi
25
25
  Justifi.seller_account_deprecation_warning if seller_account_id
26
26
  headers[:sub_account] = sub_account_id || seller_account_id if sub_account_id || seller_account_id
27
27
 
28
- JustifiOperations.execute_get_request("/v1/payments", params, headers)
28
+ Justifi::ListObject.list("/v1/payments", params, headers)
29
29
  end
30
30
 
31
31
  def get(payment_id:, headers: {})
@@ -48,6 +48,12 @@ module Justifi
48
48
  params: params,
49
49
  headers: {})
50
50
  end
51
+
52
+ def balance_transactions(payment_id:, params: {}, headers: {})
53
+ Justifi::ListObject.list("/v1/payments/#{payment_id}/payment_balance_transactions",
54
+ params,
55
+ headers)
56
+ end
51
57
  end
52
58
  end
53
59
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Justifi
4
- VERSION = "0.6.5"
4
+ VERSION = "0.6.7"
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.5
4
+ version: 0.6.7
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