lib/pay/stripe/webhooks/payment_action_required.rb in pay-8.2.2 vs lib/pay/stripe/webhooks/payment_action_required.rb in pay-8.3.0

- old
+ new

@@ -6,11 +6,12 @@ # Event is of type "invoice" see: # https://stripe.com/docs/api/invoices/object object = event.data.object + # Don't send email on incomplete Stripe subscriptions since they're just getting created and the JavaScript will handle SCA pay_subscription = Pay::Subscription.find_by_processor_and_id(:stripe, object.subscription) - return if pay_subscription.nil? + return if pay_subscription.nil? || pay_subscription.status == "incomplete" if Pay.send_email?(:payment_action_required, pay_subscription) Pay.mailer.with( pay_customer: pay_subscription.customer, payment_intent_id: event.data.object.payment_intent,