justifi 0.5.1 → 0.6.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: db211cc27d14f3a8c481e942c147da0d3991d00dfdf4f0c01a2b81918a36592b
4
- data.tar.gz: e91acbe0e30fc8ca4f8d0982c6aa15a2f332b3af836458f4074361503081b2c4
3
+ metadata.gz: 9c7d0546fda05111b274ffae6ab6664eba234afa6d1735e7ef66aac92a830909
4
+ data.tar.gz: b4c2bef8c2e98e9bcdb11625e853a17d4bc6bb3ceee5a9dea16f1bf72ec59e72
5
5
  SHA512:
6
- metadata.gz: f2f14ebba685f687c554d39ed43b9a6291ef540c4d4bca463825dd726fb7829bee152f38186c26d176082775232c42e516e3fb3cec7f6dd12e755b5c3af5382f
7
- data.tar.gz: 3afc707b5e171126379f0b011e9cf285976212db354d00e6a8e0e376a57ff1c0fc0a055f8371abec48897329dc595b107f5a66fb581432a767b397cbce1011fb
6
+ metadata.gz: ef8a0f09cc1ff3fc84aebe5420db483d2ad284a2a5f9b44317f0c4d8274bf64cde68ea292e14af72ffecb9fd8262d497301e257ebaaa18c6f242f72961c4026b
7
+ data.tar.gz: 1b56befb2cf046d6ef094f22b910d684214b3d368bbb3472cfdcefead6fa3a396a6123116e8cec86cfa3815d872b6c5c51b23c5c199a67bcae11491a1cda27a3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- justifi (0.5.1)
4
+ justifi (0.6.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -22,7 +22,7 @@ GEM
22
22
  public_suffix (4.0.7)
23
23
  rainbow (3.1.1)
24
24
  rake (13.0.6)
25
- regexp_parser (2.3.1)
25
+ regexp_parser (2.4.0)
26
26
  repo-small-badge (0.2.7)
27
27
  victor (~> 0.2.8)
28
28
  rexml (3.2.5)
@@ -39,16 +39,16 @@ GEM
39
39
  diff-lcs (>= 1.2.0, < 2.0)
40
40
  rspec-support (~> 3.11.0)
41
41
  rspec-support (3.11.0)
42
- rubocop (1.28.2)
42
+ rubocop (1.29.1)
43
43
  parallel (~> 1.10)
44
44
  parser (>= 3.1.0.0)
45
45
  rainbow (>= 2.2.2, < 4.0)
46
46
  regexp_parser (>= 1.8, < 3.0)
47
- rexml
47
+ rexml (>= 3.2.5, < 4.0)
48
48
  rubocop-ast (>= 1.17.0, < 2.0)
49
49
  ruby-progressbar (~> 1.7)
50
50
  unicode-display_width (>= 1.4.0, < 3.0)
51
- rubocop-ast (1.17.0)
51
+ rubocop-ast (1.18.0)
52
52
  parser (>= 3.1.1.0)
53
53
  rubocop-performance (1.13.3)
54
54
  rubocop (>= 1.7.0, < 2.0)
@@ -63,8 +63,8 @@ GEM
63
63
  repo-small-badge (~> 0.2.7)
64
64
  simplecov (~> 0.17)
65
65
  simplecov_json_formatter (0.1.4)
66
- standard (1.11.0)
67
- rubocop (= 1.28.2)
66
+ standard (1.12.1)
67
+ rubocop (= 1.29.1)
68
68
  rubocop-performance (= 1.13.3)
69
69
  unicode-display_width (2.1.0)
70
70
  victor (0.2.8)
data/README.md CHANGED
@@ -8,9 +8,7 @@ It includes a pre-defined set of modules and classes that are essentially wrappe
8
8
  Add these lines to your application's Gemfile:
9
9
 
10
10
  ```ruby
11
- source "https://rubygems.pkg.github.com/justifi-tech" do
12
- gem "justifi"
13
- end
11
+ gem "justifi"
14
12
  ```
15
13
  And then execute:
16
14
 
@@ -197,6 +195,20 @@ Justifi::PaymentIntent.create(params: payment_intent_params, seller_account_id:
197
195
  Any API resource using the `seller_account_id` variable will include the `Seller-Account` header and be
198
196
  processed as the seller account.
199
197
 
198
+ ## Webhook Signature Verification
199
+
200
+ Webhooks are secured by signature verification. An encrypted header is sent as a POST to your API endpoint (JUSTIFI-SIGNATURE),
201
+ which will need to be decrypted and verified with the signature secret provided.
202
+ You can use the JustiFi Ruby gem to validate the signature.
203
+
204
+ ```ruby
205
+ received_event = { id: "py_..." } # JustiFi webhook event
206
+ signature = "2463896d3cb..." # justifi-signature header
207
+ timestamp = "1651076887..." # justifi-timestamp header
208
+ secret_key = "sigk_2..." # secret key used for this webhook
209
+ Justifi::Webhook.verify_signature(received_event: received_event, timestamp: timestamp, secret_key: secret_key, signature: signature) # valid or not
210
+ ```
211
+
200
212
  ## Contributing
201
213
 
202
214
  ### Release a new version of the gem
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Justifi
4
+ module BalanceTransaction
5
+ class << self
6
+ def list(params: {}, headers: {}, seller_account_id: nil)
7
+ headers[:seller_account] = seller_account_id if seller_account_id
8
+ JustifiOperations.execute_get_request("/v1/balance_transactions", params, headers)
9
+ end
10
+
11
+ def get(id:, headers: {})
12
+ JustifiOperations.execute_get_request("/v1/balance_transactions/#{id}",
13
+ {},
14
+ headers)
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Justifi
4
- VERSION = "0.5.1"
4
+ VERSION = "0.6.0"
5
5
  end
data/lib/justifi.rb CHANGED
@@ -15,6 +15,7 @@ require "justifi/oauth"
15
15
  require "justifi/payment"
16
16
  require "justifi/refund"
17
17
  require "justifi/payout"
18
+ require "justifi/balance_transaction"
18
19
  require "justifi/dispute"
19
20
  require "justifi/payment_method"
20
21
  require "justifi/payment_intent"
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.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JustiFi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-28 00:00:00.000000000 Z
11
+ date: 2022-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -161,6 +161,7 @@ files:
161
161
  - justifi.gemspec
162
162
  - lib/justifi.rb
163
163
  - lib/justifi/api_operations.rb
164
+ - lib/justifi/balance_transaction.rb
164
165
  - lib/justifi/configuration.rb
165
166
  - lib/justifi/dispute.rb
166
167
  - lib/justifi/in_memory_cache.rb