From 7e8903b3e078e104f97b9e4f73812f85776df16b Mon Sep 17 00:00:00 2001 From: Rishabh Mishra Date: Fri, 20 Dec 2024 16:32:07 +0530 Subject: [PATCH] fix: check payment status async checkout (#841) * feat: add async_payment_succeeded to billing event listener * fix: check for PaymentStatus in checkout sync --- billing/checkout/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/billing/checkout/service.go b/billing/checkout/service.go index 0295f0714..420890704 100644 --- a/billing/checkout/service.go +++ b/billing/checkout/service.go @@ -501,7 +501,7 @@ func (s *Service) SyncWithProvider(ctx context.Context, customerID string) error break } - if ch.State == StateExpired.String() || ch.State == StateComplete.String() { + if ch.State == StateExpired.String() || (ch.State == StateComplete.String() && ch.PaymentStatus != "unpaid") { continue } if ch.ExpireAt.Before(time.Now()) {