fix(gro-609): fix two bugs found by CTO review
1. Refund stats now sum actual refund amounts from refunds table instead of incorrectly summing tip_cents from invoices table. 2. Stripe payment_intents.retrieve now expands payment_method so card.last4 is correctly available instead of null. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -169,7 +169,7 @@ export async function getPaymentIntentDetails(
|
||||
const stripe = getStripeClient();
|
||||
if (!stripe) return null;
|
||||
|
||||
const pi = await stripe.paymentIntents.retrieve(paymentIntentId);
|
||||
const pi = await stripe.paymentIntents.retrieve(paymentIntentId, { expand: ["payment_method"] });
|
||||
const cardLast4 = pi.payment_method
|
||||
? (pi.payment_method as Stripe.PaymentMethod).card?.last4 ?? null
|
||||
: null;
|
||||
|
||||
Reference in New Issue
Block a user