π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[server] Skip stale Stripe hold emails (#11029)
neeraj-pilot166e6441f0c9
diff --git a/server/pkg/controller/stripe.go b/server/pkg/controller/stripe.goindex 7782bb5159..92e4356da1 100644--- a/server/pkg/controller/stripe.go+++ b/server/pkg/controller/stripe.go@@ -402,6 +402,11 @@ func (c *StripeController) handlePaymentIntentFailed(event stripe.Event, countryreturn ente.StripeEventLog{}, stacktrace.Propagate(err, "")}+ if isPaidStripeInvoice(invoice) {+ log.Info("Ignoring stale payment intent failed event for paid invoice:", invoiceID)+ return ente.StripeEventLog{UserID: userID, StripeSubscription: *stripeSubscription, Event: event}, nil+ }+productID := stripeSubscription.Items.Data[0].Price.ID// If the current subscription is not the same as the one in the webhook,// then ignore@@ -802,6 +807,10 @@ func usesAllowIncompleteSubscriptionUpdate(paymentMethodType stripe.PaymentMethoreturn paymentMethodType == stripe.PaymentMethodTypeSepaDebit || paymentMethodType == stripe.PaymentMethodType("upi")}+func isPaidStripeInvoice(invoice *stripe.Invoice) bool {+ return invoice.Paid || invoice.Status == stripe.InvoiceStatusPaid+}+func getPaymentIntentErrorPaymentMethodType(paymentIntent stripe.PaymentIntent) stripe.PaymentMethodType {if paymentIntent.LastPaymentError == nil {return ""