#sai045_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1263048457099411467
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- sai045_best-practices, 30 minutes ago, 14 messages
- sai045_best-practices, 2 days ago, 9 messages
- sai045_best-practices, 4 days ago, 19 messages
- sai045_best-practices, 5 days ago, 5 messages
const { price } = await calculatePrice(credits);
const product = await stripe.products.create({
name: 'Go-X API Access',
});
const paymentPrice = await stripe.prices.create({
product: product.id,
unit_amount: price * 100,
currency: 'USD',
});
const session = await stripe.checkout.sessions.create({
payment_method_types: ['card'],
mode: 'payment',
success_url: config.PAYMENT_SUCCESS_URL,
cancel_url: config.PAYMENT_FAILURE_URL,
customer: customer.id,
billing_address_collection: 'required',
shipping_address_collection: {
allowed_countries,
},
metadata: {
planId: plan.id,
ipAddress: req.ip ?? '',
credits,
},
payment_intent_data: {
metadata: {
planId: plan.id,
ipAddress: req.ip ?? '',
credits,
},
},
line_items: [
{
price: paymentPrice.id,
quantity: 1,
},
],
allow_promotion_codes: true,
});
This is my code for creating payment session, I am not getting an invoice, I am only getting payment_intent.succeeded
Are you in test mode?
Yes
Stripe doesn't send emails in Test mode. You will get it when you switch to Live mode.
No, I do not want emails, I want the invoice.paid event, that is all
You won't get it since no Invoice object is created.
Why do you need that specific event?
I want an invoice for the payment made
You want an Invoice object, or an invoice.paid event?
Invoice object inturn making the invoice.paid event
Okay. Stripe Checkout doesn't create Invoice objects. So you will need to follow a different guide: https://docs.stripe.com/invoicing/integration
Okay,