pay 4.0.1 → 4.0.2
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.
Potentially problematic release.
This version of pay might be problematic. Click here for more details.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd5f149f88ae66352491ff4da889e6e252d491fa37467a1a7a05d635ef855f61
|
4
|
+
data.tar.gz: 970ca6f6183aba7795368d5b2b78c3ddb932498bd54af20567c467d126246e10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7fd623efada808362cef4f67d1a66919a2a74103c69cf16c859d854dc5e4ef8aed9e58cccd6addc1b2328b663824d7fa0830144ec44bceff3c2fde32a6f7131
|
7
|
+
data.tar.gz: 27cad2d3b9a1fb239c5dc68282f728fadf07451b2a9c9aa29d77274077d52b608865a39f90de5d3416f69c418f75493a545f4f41f00b58bccf722a52dcfabf3e
|
@@ -1,14 +1,7 @@
|
|
1
1
|
module Pay
|
2
2
|
module Stripe
|
3
3
|
module Webhooks
|
4
|
-
class CheckoutSessionAsyncPaymentSucceeded
|
5
|
-
def call(event)
|
6
|
-
# TODO: Also handle payment intents
|
7
|
-
|
8
|
-
if event.data.object.subscription
|
9
|
-
Pay::Stripe::Subscription.sync(event.data.object.subscription, stripe_account: event.try(:account))
|
10
|
-
end
|
11
|
-
end
|
4
|
+
class CheckoutSessionAsyncPaymentSucceeded < CheckoutSessionCompleted
|
12
5
|
end
|
13
6
|
end
|
14
7
|
end
|
@@ -5,10 +5,29 @@ module Pay
|
|
5
5
|
def call(event)
|
6
6
|
# TODO: Also handle payment intents
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
locate_owner(event.data.object)
|
9
|
+
|
10
|
+
if (payment_intent_id = event.data.object.payment_intent)
|
11
|
+
payment_intent = ::Stripe::PaymentIntent.retrieve(payment_intent_id, {stripe_account: event.try(:account)}.compact)
|
12
|
+
payment_intent.charges.each do |charge|
|
13
|
+
Pay::Stripe::Charge.sync(charge.id, stripe_account: event.try(:account))
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
if (subscription_id = event.data.object.subscription)
|
18
|
+
Pay::Stripe::Subscription.sync(subscription_id, stripe_account: event.try(:account))
|
10
19
|
end
|
11
20
|
end
|
21
|
+
|
22
|
+
def locate_owner(object)
|
23
|
+
return if object.client_reference_id.nil?
|
24
|
+
|
25
|
+
# If there is a client reference ID, make sure we have a Pay::Customer record
|
26
|
+
owner = GlobalID::Locator.locate_signed(object.client_reference_id)
|
27
|
+
owner&.add_payment_processor(:stripe, processor_id: object.customer)
|
28
|
+
rescue
|
29
|
+
Rails.logger.debug "[Pay] Unable to locate record with SGID: #{object.client_reference_id}"
|
30
|
+
end
|
12
31
|
end
|
13
32
|
end
|
14
33
|
end
|
data/lib/pay/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Charnes
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-07-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|