#nerder - Product Charges

1 messages · Page 1 of 1 (latest)

ocean kernel
#

Hello! I'm not sure I understand your question, can you provide more details?

alpine glade
#

Yes, basically as of now are selling subscriptions to our clients

#

so we create the product and then customer can buy it

#

but now we would like to sell product "una tantum"

#

like a real world example is this

#

we sell gym memberships (30EUR/month)

#

but now we would like to sell bundle of classes

#

like 10 classes 100EUR

#

one off

ocean kernel
#

You have several options. You can create a single Payment Intent for the total amount you want to charge, you can use Stripe Checkout, or you can create a one-off Invoice.

#

Do you know which one of those you might want to investigate first?

alpine glade
#

For sure not checkout as we want to handle the integration ourselves

#

the payment intent is related to a specific price?

#

We were taking a look at the one-off invoice at the moment, what are the differences between the 2?

ocean kernel
#

No, Payment Intents are low-level payment objects that cannot be used with Products or Prices.

#

If you want to use Products and Prices you need to use either Checkout or a one-off Invoice.

alpine glade
#

amazing 🙂

#

thank you so much then

ocean kernel
#

Happy to help!

alpine glade
#

Hey @ocean kernel

#

but why the invoice stays open?

#

even when we set to "charge_automatically"?

#
  async create(stripeAccountId: string, customerId: string, priceId: string): Promise<void> {
    await this.stripe.invoiceItems.create(
      {
        customer: customerId,
        price: priceId,
      },
      {
        stripeAccount: stripeAccountId,
      },
    );

    const invoice = await this.stripe.invoices.create(
      {
        customer: customerId,
        application_fee_amount: 10,
        auto_advance: true,
      },
      {
        stripeAccount: stripeAccountId,
      },
    );

    await this.stripe.invoices.finalizeInvoice(invoice.id, {
      stripeAccount: stripeAccountId,
    });
  }
ocean kernel
#

The Invoice will stay open for a little while until it proceeds through the Invoice lifecycle.

alpine glade
#

oh ok, there is no way to instantly charge it?

ocean kernel
#

Alternatively you can attempt to confirm the Payment Intent associated with the Invoice.

#

It depends on which approach works best for your integration.

alpine glade
#

oh ok