79418014

Date: 2025-02-06 13:14:16
Score: 1.5
Natty:
Report link

Payment Intents API doesn't support automatically sending paid invoices.

Resource: https://docs.stripe.com/payments/advanced/receipts#automatically-send-paid-invoices

This means you can't automatically send a paid invoice if you writing code like below

const paymentIntent = await stripe.paymentIntents.create({
    amount: 1099,
    currency: 'gbp',
    payment_method_types: ['card'],
    description: 'Thanks for your purchase!',
    receipt_email: '[email protected]',
  });

You should use embedded components

Resource: https://docs.stripe.com/payments/checkout/receipts?payment-ui=embedded-components#paid-invoices-hosted

const session = await stripe.checkout.sessions.create({
    mode: 'payment',
    invoice_creation: {
      enabled: true,
    },
    line_items: [
      {
        price: '{{ONE_TIME_PRICE_ID}}',
        quantity: 1,
      },
    ],
    ui_mode: 'custom',
    return_url: 'https://example.com',
  });
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Salih Kesepara