#nerder - Product Charges
1 messages · Page 1 of 1 (latest)
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
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?
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?
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.
It sounds like Invoices are what you want for your use case: https://stripe.com/docs/invoicing
Happy to help!
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,
});
}
The Invoice will stay open for a little while until it proceeds through the Invoice lifecycle.
oh ok, there is no way to instantly charge it?
If you want to attempt payment on an Invoice immediately you can use the pay API endpoint: https://stripe.com/docs/api/invoices/pay
Alternatively you can attempt to confirm the Payment Intent associated with the Invoice.
It depends on which approach works best for your integration.
oh ok