#sai045_best-practices

1 messages ¡ Page 1 of 1 (latest)

outer mesaBOT
#

👋 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.

rose briarBOT
#

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.

somber quartz
#

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

solid forum
#

Are you in test mode?

somber quartz
#

Yes

solid forum
#

Stripe doesn't send emails in Test mode. You will get it when you switch to Live mode.

somber quartz
#

No, I do not want emails, I want the invoice.paid event, that is all

solid forum
#

You won't get it since no Invoice object is created.

#

Why do you need that specific event?

somber quartz
#

I want an invoice for the payment made

solid forum
#

You want an Invoice object, or an invoice.paid event?

somber quartz
#

Invoice object inturn making the invoice.paid event

solid forum
somber quartz
#

Okay,

outer mesaBOT