From 8027287c1ab977f3e35126377420855805aa85f9 Mon Sep 17 00:00:00 2001 From: Aleksandar Petkov Date: Sat, 1 Jun 2024 23:22:01 +0300 Subject: [PATCH] fix: Donation type being "" on stripe invoice.paid event (#638) --- apps/api/src/donations/helpers/payment-intent-helpers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/api/src/donations/helpers/payment-intent-helpers.ts b/apps/api/src/donations/helpers/payment-intent-helpers.ts index f95f3fb8..e29d808c 100644 --- a/apps/api/src/donations/helpers/payment-intent-helpers.ts +++ b/apps/api/src/donations/helpers/payment-intent-helpers.ts @@ -96,7 +96,7 @@ export function getInvoiceData(invoice: Stripe.Invoice): PaymentData { personId = line.metadata.personId } if (line.metadata.type) { - type = line.metadata.type ?? DonationType.donation + type = line.metadata.type } }) @@ -118,7 +118,7 @@ export function getInvoiceData(invoice: Stripe.Invoice): PaymentData { paymentMethodId: invoice.collection_method, stripeCustomerId: invoice.customer as string, personId, - type, + type: type || DonationType.donation, } }