#flux-pricingtable-free
1 messages · Page 1 of 1 (latest)
flux-pricingtable-free
It's not possible today as far as I know, let me double check
yeah that is not available today sorry, I flagged as a feature request internally
Will it be created?
I flagged it to the product team, I can't tell you if/when we'll add support for it
Alright, also how do I make it so when someone pays it doesnt keep creating a new customer in Stripe if they change their name?
how are you currently collecting payment details? Are you using Checkout or Payment Element?
ah, sorry, missed that
there's currently no way to prevent new customers from being created. If you want to continue to use Pricing Tables, the best you can go about it is to pass in the customer email, https://stripe.com/docs/no-code/pricing-table#customer-email. And then you can filter for the Customer by the email : https://stripe.com/docs/api/customers/list#list_customers-email, or for the Checkout Session via the Email : https://stripe.com/docs/api/checkout/sessions/list#list_checkout_sessions-customer_details
if you want to be able to prevent duplication of customers, then you need to use Checkout Sessions and pass a Customer ID into the Checkout Session creation : https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer. In short, you need to implement your own "pricing table"
Like this?
const getCustomers = await stripe.customers.list({ email: `${req.user.email}` });
if (getCustomers.data.email === `${req.user.email}`) {
console.log(getCustomers)
return res.redirect('/app')
} else {
const customer = await stripe.customers.create({
email: `${req.user.email}`,
name: `${req.user.username}#${req.user.discriminator}`,
});
return res.redirect('/accounts/get-started')
}```
can you explain what you're trying to achieve here?
if customer is already in stripe, show their dashboard, else prompt them the pricing table
stripe.customers.list is going to return an array, i don't think getCustomers.data.email will work
anyway, you should run it and see if it works for you
I found a solution, but how do I redirect users back to the website when they pay from the pricing table
?
There is no back button, or anything.
you mean from the hosted Checkout page?
Yes.
i think this section is what you're looking for : https://stripe.com/docs/no-code/pricing-table#post-purchase-experience
Either I am seeing things, or would it be subscription.items.data.price.id?
I provided the request above.
i don't understand the question? like what are you trying to do, what happened, what did you expect to happen instead?
I'm trying to get the Price ID thats in the request above, but it keeps returning Cannot read properties of undefined (reading 'id')
items.data is an array
to debug such issues, access each item step by step - for example : can you access subscription.items? can you access subscription.items.data? etc
it would probably be subscriptions.items.data[0].price.id
I've got it working, thanks.