pay 10.0.3 → 10.1.0
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/app/models/pay/braintree/charge.rb +2 -0
- data/app/models/pay/braintree/customer.rb +2 -0
- data/app/models/pay/braintree/payment_method.rb +2 -0
- data/app/models/pay/braintree/subscription.rb +2 -0
- data/app/models/pay/charge.rb +2 -0
- data/app/models/pay/customer.rb +2 -0
- data/app/models/pay/fake_processor/charge.rb +2 -0
- data/app/models/pay/fake_processor/customer.rb +2 -0
- data/app/models/pay/fake_processor/merchant.rb +2 -0
- data/app/models/pay/fake_processor/payment_method.rb +2 -0
- data/app/models/pay/fake_processor/subscription.rb +2 -0
- data/app/models/pay/lemon_squeezy/charge.rb +2 -0
- data/app/models/pay/lemon_squeezy/customer.rb +2 -0
- data/app/models/pay/lemon_squeezy/payment_method.rb +2 -0
- data/app/models/pay/lemon_squeezy/subscription.rb +2 -0
- data/app/models/pay/merchant.rb +2 -0
- data/app/models/pay/paddle_billing/charge.rb +2 -0
- data/app/models/pay/paddle_billing/customer.rb +2 -0
- data/app/models/pay/paddle_billing/payment_method.rb +2 -0
- data/app/models/pay/paddle_billing/subscription.rb +2 -0
- data/app/models/pay/paddle_classic/charge.rb +2 -0
- data/app/models/pay/paddle_classic/customer.rb +2 -0
- data/app/models/pay/paddle_classic/payment_method.rb +2 -0
- data/app/models/pay/paddle_classic/subscription.rb +2 -0
- data/app/models/pay/payment_method.rb +2 -0
- data/app/models/pay/stripe/charge.rb +3 -1
- data/app/models/pay/stripe/customer.rb +2 -0
- data/app/models/pay/stripe/merchant.rb +2 -0
- data/app/models/pay/stripe/payment_method.rb +2 -0
- data/app/models/pay/stripe/subscription.rb +6 -3
- data/app/models/pay/subscription.rb +2 -0
- data/app/models/pay/webhook.rb +2 -0
- data/lib/pay/stripe/webhooks/payment_action_required.rb +4 -3
- data/lib/pay/stripe/webhooks/payment_failed.rb +4 -3
- data/lib/pay/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 514244ea1a6e8f9b56ff307b1d5f37719772fb4418b057d398c74fb148b7b961
|
4
|
+
data.tar.gz: 52e53b7b4667dd1dba56cf74a82b55f421e22cc4d6d2a8c7701abdbf397bf09f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e5449126348166ff4fe1b3831bf77d7ffe5939101618cb662b7f49129d031385dda7bc1fa92b3ac23d9e1929153b893fbe31cee5390851a3a54e5d8dbb106e5
|
7
|
+
data.tar.gz: 23e01395c177b9fad7df51a4147bccbf54e80966c1bb30711930ca4e6ae64f55692f9bc3c1513c154c39d81f6ae12e9438931b511655bab3a944b0db8005d321
|
data/app/models/pay/charge.rb
CHANGED
data/app/models/pay/customer.rb
CHANGED
data/app/models/pay/merchant.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Pay
|
2
2
|
module Stripe
|
3
3
|
class Charge < Pay::Charge
|
4
|
-
EXPAND = ["balance_transaction", "refunds"]
|
4
|
+
EXPAND = ["balance_transaction", "payment_intent", "refunds.data.balance_transaction"]
|
5
5
|
|
6
6
|
delegate :amount_captured, :payment_intent, to: :stripe_object
|
7
7
|
|
@@ -147,3 +147,5 @@ module Pay
|
|
147
147
|
end
|
148
148
|
end
|
149
149
|
end
|
150
|
+
|
151
|
+
ActiveSupport.run_load_hooks :pay_stripe_charge, Pay::Stripe::Charge
|
@@ -120,12 +120,13 @@ module Pay
|
|
120
120
|
def self.expand_options
|
121
121
|
{
|
122
122
|
expand: [
|
123
|
-
"discounts",
|
124
123
|
"default_payment_method",
|
125
|
-
"
|
124
|
+
"discounts",
|
126
125
|
"latest_invoice.confirmation_secret",
|
127
126
|
"latest_invoice.payments",
|
128
|
-
"latest_invoice.total_discount_amounts.discount"
|
127
|
+
"latest_invoice.total_discount_amounts.discount",
|
128
|
+
"pending_setup_intent",
|
129
|
+
"schedule"
|
129
130
|
]
|
130
131
|
}
|
131
132
|
end
|
@@ -359,3 +360,5 @@ module Pay
|
|
359
360
|
end
|
360
361
|
end
|
361
362
|
end
|
363
|
+
|
364
|
+
ActiveSupport.run_load_hooks :pay_stripe_subscription, Pay::Stripe::Subscription
|
data/app/models/pay/webhook.rb
CHANGED
@@ -6,16 +6,17 @@ module Pay
|
|
6
6
|
# Event is of type "invoice" see:
|
7
7
|
# https://stripe.com/docs/api/invoices/object
|
8
8
|
|
9
|
-
|
9
|
+
invoice = event.data.object
|
10
|
+
subscription_id = invoice.parent.try(:subscription_details).try(:subscription)
|
10
11
|
|
11
12
|
# Don't send email on incomplete Stripe subscriptions since they're just getting created and the JavaScript will handle SCA
|
12
|
-
pay_subscription = Pay::Subscription.find_by_processor_and_id(:stripe,
|
13
|
+
pay_subscription = Pay::Subscription.find_by_processor_and_id(:stripe, subscription_id)
|
13
14
|
return if pay_subscription.nil? || pay_subscription.status == "incomplete"
|
14
15
|
|
15
16
|
if Pay.send_email?(:payment_action_required, pay_subscription)
|
16
17
|
Pay.mailer.with(
|
17
18
|
pay_customer: pay_subscription.customer,
|
18
|
-
payment_intent_id:
|
19
|
+
payment_intent_id: invoice.payment_intent,
|
19
20
|
pay_subscription: pay_subscription
|
20
21
|
).payment_action_required.deliver_later
|
21
22
|
end
|
@@ -6,16 +6,17 @@ module Pay
|
|
6
6
|
# Event is of type "invoice" see:
|
7
7
|
# https://stripe.com/docs/api/invoices/object
|
8
8
|
|
9
|
-
|
9
|
+
invoice = event.data.object
|
10
|
+
subscription_id = invoice.parent.try(:subscription_details).try(:subscription)
|
10
11
|
|
11
12
|
# Don't send email on incomplete Stripe subscriptions since they're just getting created and the JavaScript will handle SCA
|
12
|
-
pay_subscription = Pay::Subscription.find_by_processor_and_id(:stripe,
|
13
|
+
pay_subscription = Pay::Subscription.find_by_processor_and_id(:stripe, subscription_id)
|
13
14
|
return if pay_subscription.nil? || pay_subscription.status == "incomplete"
|
14
15
|
|
15
16
|
if Pay.send_email?(:payment_failed, pay_subscription)
|
16
17
|
Pay.mailer.with(
|
17
18
|
pay_customer: pay_subscription.customer,
|
18
|
-
stripe_invoice:
|
19
|
+
stripe_invoice: invoice
|
19
20
|
).payment_failed.deliver_now
|
20
21
|
end
|
21
22
|
end
|
data/lib/pay/version.rb
CHANGED