#Dejan - Coach
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Can you give me an example of what you're passing in and what you're expecting as the outcome?
Hi! Thank you for your quick answer
Our application create a new customer when someone sign in for the first time.
So, everytime that customer pays something, Stripe doesn't create a new customer every time but link every payment to the same customer_id (with billing address, metadata and so on)
We succesfully linked a generic checkout to an existing customer but we cannot do the same with a pricing table
<Script src="https://js.stripe.com/v3/pricing-table.js"/>
<stripe-pricing-table
pricing-table-id="prctbl_1LmF5fHbABTxAxCgZsXBnodP"
publishable-key="pk_test_xxxxcensoredxxxx"
client-reference-id={user.app_metadata.stripe_id}
></stripe-pricing-table>
Gotcha. So if you pass the customer ID with the pricing table, then it's not carrying over to the checkout session?
Do you have an example of a checkout.session.created event which I can inspect to confirm that it is definitely missing
So pricing table creates a checkout session when you try and purchase a product
So when this code runs
<stripe-pricing-table
pricing-table-id="prctbl_1LmF5fHbABTxAxCgZsXBnodP"
publishable-key="pk_test_xxxxcensoredxxxx"
client-reference-id={user.app_metadata.stripe_id}
></stripe-pricing-table>
there should be a checkout session that gets created (checkout.session.createdevent should be generated)
Which should tell us what's exactly being set asclient-reference-idon that session
Can I find this object into the dashboard? For example in Log?
You should be able to find it under events
https://dashboard.stripe.com/events
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I tried right now
{
"object": {
"id": "seti_1LmISoHbABTxAxCgPjuMOHrG",
"object": "setup_intent",
"application": null,
"cancellation_reason": null,
"client_secret": "seti_1LmISoHbABTxAxCgPjuMOHrG_secretxxxxxxx",
"created": 1664203158,
"customer": null,
"description": null,
"flow_directions": null,
"last_setup_error": null,
"latest_attempt": null,
"livemode": false,
"mandate": null,
"metadata": {
},
"next_action": null,
"on_behalf_of": null,
"payment_method": "pm_1LmISo43klKuxW9fPijbFjUu",
"payment_method_options": {
"acss_debit": {
"currency": "cad",
"mandate_options": {
"interval_description": "First day of every month",
"payment_schedule": "interval",
"transaction_type": "personal"
},
"verification_method": "automatic"
}
},
"payment_method_types": [
"acss_debit"
],
"single_use_mandate": null,
"status": "requires_confirmation",
"usage": "off_session"
}
}
That's a SetupIntent, its different than checkout session
is it the right object?
this is the page opened clicking on a price table
Yup that's the stripe checkout page
okay, there is no other event at this point
okay found an example
no checkout.session.created
If you look at this request
https://dashboard.stripe.com/test/logs/req_lJti5ikmjxU4EY
And this event for checkout session completion
https://dashboard.stripe.com/test/events/evt_1LmILnHbABTxAxCgbsz9EvIe
the client-reference-id is getting passed in
the first link does not work
in the second link the client_reference_id is not the same I pass
the first link does not work
Ah it might be due to this being a request created by the pricing table, sorry about that.
Can you print out the reference ID and double check?
are you talking about this? {user.app_metadata.stripe_id}
<stripe-pricing-table
pricing-table-id="prctbl_1LmF5fHbABTxAxCgZsXBnodP"
publishable-key="pk_test_xxxxcensoredxxxx"
client-reference-id={user.app_metadata.stripe_id}
></stripe-pricing-table>
Wait, can I try inserting an hard-coded customer_id?
client-reference-id="cus_xxxxxx"
NP! ๐ Good luck
Hi there
we passed this:
<stripe-pricing-table
pricing-table-id="prctbl_1LmF5fHbABTxAxCgZsXBnodP"
publishable-key="pk_test_51LL0bMHbABTxAxCgRAFVqzIbVPbvHYcbZ4Blp1MpFXww57169BavvqrQQ2UsZenLlnDfiLQXEUc4ckupnyyKt9j500RGpe3TJV"
client-reference-id={'cus_MScezVwHu9wemt'}
></stripe-pricing-table>
but we obtained a payment with cus_MVJz0YNpO2KnKo
huh interesting.
Do you have a test page I can take a look at?
do you want to try yourself in our app?
sure
but we obtained a payment with cus_MVJz0YNpO2KnKo
also can you share the payment intent ID of this payment?
user: stripe@stripe.com
password: L95nrpq8WJ9UkKn
insert this spotify id: 1bzx15Bv1ioIaewP85ad5J
this user is "cus_MVK9GML34eBRhS"
oh but maybe we need to come back to
client-reference-id={user.app_metadata.stripe_id}
This thing is crucial for us at the moment
Hi ๐ I"m stepping in as @runic vine has to go. There is a lot of context here so give me a minute to catch up
Can you summarize your overall goal here?
this message and the subsequent 2
price table can't reference the customer ID so it creates a new customer every time
But the Pricing Table docs just state the setting the client_reference_id will pass this value down to the Checkout page.
https://stripe.com/docs/payments/checkout/pricing-table#track-subscriptions
And Checkout does not use this value to identify a customer
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
oh wait
Sorry, I did not understand. If you understood my problem, there is a way to accomplish this thing?
We can do it with a normal checkout, we did it in the past
This is a known limitation of the Pricing Table
Our docs discuss this as well as mention our plans to roll out more features and fill in these gaps here:
https://stripe.com/docs/payments/checkout/pricing-table#limitations
Sorry, Hanzo gave us hope
Unfortunately, because the Pricing Table code is embedded in your client-side, we cannot do something like that. A hacker could get the ID of another customer and use the dev-tools to change the ID before making many purchases
So we need to create single checkout using "stripe price id" singularly
is it correct?
I don't know what that sentence means. Could you restate the question?
we have to build our own pricing table, with buttons linked to these price id
using the "traditional way" but simulating a pricing table
If you want to pass the Customer ID when creating a Checkout Session so that those purchases are assigned to that Customer in Stripe, yes.
I'm happy I could offer some help. I will also raise this as feedback for the Pricing Table team.