#megamanzero707_pricingtable-customer-email

1 messages · Page 1 of 1 (latest)

severe ginkgoBOT
#

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

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

autumn bane
#

Hi 👋

What is your goal with passing the client reference ID? Can you describe exactly what isn't working as you expect it?

rapid bolt
#

from what i read in the documentation, by passing the client-reference-id, it can keep track of the subscription that the user has. So say we have two subscriptions: A and B. The user choose sub A. Now that the user is subscribed, if the user wanted to upgrade to B, the table would recognize that the user currently has sub A and can now only get sub B, due to passing the reference-id.

#

in terms of the passing the email-address, I simply want to auto fill for the checkout experience when going from table to checkout

autumn bane
#

Okay let's clear up the first point

The client-reference-id is NOT for tracking subscriptions in Stripe. It is to make it easier for you to reconcile the subscriptions created in your own internal data system. This is the language we use in our doc

When the property is set, the pricing table passes it to the Checkout Session’s client_reference_id attribute to help you reconcile the Checkout Session with your internal system.
https://docs.stripe.com/no-code/pricing-table#track-subscriptions

#

As for the email, you are saying you do not see the email field filled in when your customer is taken to the Checkout page?

rapid bolt
#

correct

autumn bane
#

I am testing in my own integration and I do see the specified customer email. Can you try hard-coding a dummy email value in the HTML code and see if that gets pre-filled?

rapid bolt
#

ok so its working now haha, i used email-address, instead of the customer-email so that's my fault hahaha.

autumn bane
#

No worries! I'm glad it's working now

rapid bolt
#

but now regarding the first issue about tracking subscriptions. is there a way to do that with the embedded table? Right now, that I am handling is getting the subscription details of the user, and depending the subscription type, i would have to user a separate table.

#

it looks like this:
const [table, setTable] = useState(null);

useEffect(() => {
    const getSub = async () => {
        const resp = await StripeAPI.checkPayment();

        if (resp?.has_active_subscription && resp?.subscription?.product?.name === STRIPE_5_PROP) {
            setTable(STRIPE_UPGRADE_TABLE_ID)
        } else {
            setTable(STRIPE_PRICING_TABLE_ID)
        }
    }

    getSub();
}, [])


return (
    <div className={styles.main_wrapper}>
        {table && (
            <stripe-pricing-table
                pricing-table-id={table}
                publishable-key={STRIPE_PUBLISHABLE_KEY}
                customer-email={'megamanzero707@gmail.com'}
            >
            </stripe-pricing-table>
        )}
    </div>
)
autumn bane
#

The pricing table has no upfront knowledge of what customer is viewing it and cannot provide any information about what subscription they may already have

rapid bolt
#

ah got it, so in that case, I would need to use two separate tables?

autumn bane
#

We have a separate product that allows customers to manage existing subscriptions though, called the Customer Portal

#

You can handle upgrades and save new payment methods with it

rapid bolt
#

ok got it this is insightful!

#

Thanks snufkin for helping!

autumn bane
#

Sure thing! Happy to shed what 💡 I can 🙂