From a7f6d2d676c37dbb1ed90ca673cf545ad249e414 Mon Sep 17 00:00:00 2001 From: Aleksandar Petkov Date: Fri, 10 Apr 2026 14:57:32 +0300 Subject: [PATCH] fix(stripe): Remove redundant refund guard Subscription payment intets have no metadata, thus those payments always fail. Remove the guard as it should've already been passed for cases when we want to refund the payment --- apps/api/src/stripe/stripe.service.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/apps/api/src/stripe/stripe.service.ts b/apps/api/src/stripe/stripe.service.ts index 240c6089..38edcd67 100644 --- a/apps/api/src/stripe/stripe.service.ts +++ b/apps/api/src/stripe/stripe.service.ts @@ -308,7 +308,6 @@ export class StripeService { }, { idempotencyKey: `${idempotencyKey}--subscription` }, ) - //include metadata in payment-intent // In API version 2025-03-31+, invoices have a 'payments' array instead of direct payment_intent field const invoice = subscription.latest_invoice as InvoiceWithPayments @@ -475,10 +474,6 @@ export class StripeService { throw new BadRequestException('Payment Intent is missing from stripe') } - if (!intent.metadata.campaignId) { - throw new BadRequestException('Campaign id is missing from payment intent metadata') - } - return await this.api.createRefund({ payment_intent: paymentIntentId, reason: 'requested_by_customer',