#riptired
1 messages · Page 1 of 1 (latest)
hello! can you share the request id?
Here is some context on how I am initializing the session:
const session = await stripe.checkout.sessions.create({
payment_method_types: ['card'],
submit_type: 'pay',
customer: customer.id,
shipping_options: [
{
shipping_rate_data: {
display_name: 'Shipping',
fixed_amount: {
currency: CURRENCY,
amount: formatAmountForStripe(metadata.shippingCost as number),
},
},
},
],
automatic_tax: {
enabled: true,
},
line_items: [
{
price_data: {
currency: CURRENCY,
product_data: {
name: metadata.productTitle!,
description: metadata.productDescription!,
// images: [metadata.imageUrl!],
metadata: {
...metadata,
},
},
unit_amount: 2000,
},
quantity: QUANTITY,
},
],
mode: 'payment',
shipping_address_collection: {
allowed_countries: [ALLOWED_COUNTRY],
},
success_url: ${WEBSITE_URL}success,
cancel_url: ${WEBSITE_URL}cancel,
});
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Those are the logs
you're probably missing this : https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items-data-price-type
If I add it, it doesn't like that string
it says that the type does not exist on price_data
@limpid jacinth
onesec, my bad, i was looking at the wrong thing
i'm still looking but if you're in a rush to head off, you can write in via https://support.stripe.com/contact/email and we can get back to you there
its impossible for me to debug because I can't see any attributes that I need to set that have just "type"
I can wait
Interesting, let me try that
thanks
I am getting this issue now
{
"statusCode": 500,
"message": "Automatic tax calculation uses fields saved on the Customer. To collect a shipping address with automatic_tax enabled, set customer_update[shipping] to 'auto' to save the shipping address back to the Customer."
}
it seems fairly self explanatory, do you have any specific question about it?
Can the shipping address be prefilled in the checkout session if I pass it in from a created customer?
i can't remember off the top of my head, but you should be able to test it out
Hmm okay
where should customer_update[shipping] be set though?
I already create a customer object before starting the session
Okay
Is it possible for me to use a custom subdomain if I am using stripe purely in nextjs?
i'm not entirely sure how using a custom subdomain relates to Stripe in this case
well you can use custom domains for stripe checkout
yes, you can use custom domains for Stripe Checkout, but it doesn't have anything to do with nextjs as far as I can tell
you can go through this page on how to setup a custom domain : https://stripe.com/docs/payments/checkout/custom-domains
We are using next js API endpoints to create a checkout session
We are unable to redirect to the checkout session on the custom subdomain
But we have successfully posted a checkout session
We are unable to redirect to the checkout session on the custom subdomain - what's the error?
res.redirect(303, session.url as string);
we have this line on the next.js API endpoint, but the page does not redirect for us to the custom subdomain
have you tried returning the url to your frontend and redirecting from the frontend instead?
The docs said it has to be a server side redirect? But we will try this thanks