#tilted_code
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/1413496100333158410
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
👋 happy to help
hi
creating a chceckout session on the backend :
const checkoutSession = await stripeService.createCheckoutSession({
mode: 'subscription',
customer: stripeCustomer.id,
line_items: [
{
price: plan.stripe_price_id,
quantity: 1,
},
],
success_url: successUrl || ${process.env.FRONTEND_URL}/run-model/flux-dev,
cancel_url: cancelUrl || ${process.env.FRONTEND_URL}/settings,
client_reference_id: order.CWUID.split('.').pop() || order.CWUID,
metadata: {
account_id: account.id.toString(),
account_cwuid: account.CWUID,
plan_id: planId.toString(),
order_id: order.id.toString(),
billing_type: plan.billing_type,
is_plan_change: existingSubscription ? 'true' : 'false',
checkout_session_id: '',
},
allow_promotion_codes: true,
subscription_data: {
metadata: {
account_id: account.id.toString(),
plan_id: planId.toString(),
account_cwuid: account.CWUID,
order_id: order.id.toString(),
billing_type: plan.billing_type,
is_plan_change: existingSubscription ? 'true' : 'false',
},
},
billing_address_collection: 'required',
automatic_tax: {
enabled: true,
},
tax_id_collection: {
enabled: true,
},
customer_update: {
address: 'auto',
name: 'auto',
},
expires_at: Math.floor(Date.now() / 1000) + 3600,
})
please read the passage I sent you in the link above
I don't see anything with regards to the restrictions on the page you shared, fyi I see this page : https://docs.stripe.com/payments/currencies/localize-prices/adaptive-pricing#restrictions
Adaptive Pricing doesn’t apply for Checkout Sessions that:
Contain explicitly defined manual currency prices.
Are in subscription mode.
Use capture_method as manual.
Use custom amounts.
so what would the solution be for this?
would I need to define a price for every target currency on the product side?
yes
ok, and this needs to be done through the dashboard,
I saw something a while back that we can add custom prices at the checkout session creation. can you point towards that