#sai045_best-practices

1 messages ¡ Page 1 of 1 (latest)

hard apexBOT
#

👋 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/1263821967463551027

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

twin groveBOT
#

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.

ebon scroll
#

This is the status of our tax setup

#

I only need to test this in the test mode, how can I do that?

karmic kindle
#

How/where are you trying to calculate tax? Which APIs/products are you using?

ebon scroll
#

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,
    invoice_creation: {
        enabled: true,
        invoice_data: {
            metadata: {
                planId: plan.id,
                ipAddress: req.ip ?? '',
                credits,
            },
        }
    },
    automatic_tax: {
        enabled: true,
    },
    customer_update: {
        shipping: 'auto'
    }
});
#

THis is my code to create the stripe session

#

I set the address as india

karmic kindle
ebon scroll
#

Okay, then what are we supposed to do for the countries that are not supported by Stripe?

karmic kindle
ebon scroll
#

So, basically this where I can use the taxRates, ahh thanks