Following a guide for my server (Firebase) they charge the user with :
const payment = await stripe.paymentIntents.create(
{
amount,
currency,
customer,
payment_method,
off_session: false,
confirm: true,
confirmation_method: 'manual',
},
{ idempotencyKey }
);
Now in all Stripe examples, they use something like:
const subscription = await stripe.subscriptions.create({
customer: '{{CUSTOMER_ID}}',
items: [{
price: '{{RECURRING_PRICE_ID}}',
}],
add_invoice_items: [{
price: '{{PRICE_ID}}',
}],
});
I am trying to understand :
- What this
paymentIntentdoes ? and how it relate to a subscription ? ( for me it just charge the user and its not clear if this is one time charge or a subscription ) - Where is the Product that I created in the dashboard fits here ? I have a subscription product on the Dashboard , i would like to subscribe to that product ID, and not set a new price.
Reading the docs doesn't help since it is full of so much information and options without a clean flow.