#Dejan - Coach

1 messages ยท Page 1 of 1 (latest)

rustic kelpBOT
runic vine
#

Hello ๐Ÿ‘‹
Can you give me an example of what you're passing in and what you're expecting as the outcome?

ocean igloo
#

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>

runic vine
#

Gotcha. So if you pass the customer ID with the pricing table, then it's not carrying over to the checkout session?

ocean igloo
#

yep!

#

this thing mess up invoices and so on

runic vine
#

Do you have an example of a checkout.session.created event which I can inspect to confirm that it is definitely missing

ocean igloo
#

Sorry, I don't understand what you are asking for

#

"an example" in which sense?

runic vine
#

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.created event should be generated)
Which should tell us what's exactly being set as client-reference-id on that session

ocean igloo
#

Can I find this object into the dashboard? For example in Log?

runic vine
ocean igloo
#

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"
}
}

runic vine
#

That's a SetupIntent, its different than checkout session

ocean igloo
#

is it the right object?

ocean igloo
runic vine
#

Yup that's the stripe checkout page

ocean igloo
#

okay, there is no other event at this point

runic vine
#

okay found an example

ocean igloo
#

no checkout.session.created

runic vine
ocean igloo
#

the first link does not work

#

in the second link the client_reference_id is not the same I pass

runic vine
#

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?

ocean igloo
#

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>

runic vine
#

yes

#

because I grabbed the latest example from your test mode account

ocean igloo
#

Wait, can I try inserting an hard-coded customer_id?

#

client-reference-id="cus_xxxxxx"

runic vine
#

suire

#

sure*

ocean igloo
#

ok I'm trying with my colleague

#

thank you

#

I'll write in some minutes

runic vine
#

NP! ๐Ÿ™‚ Good luck

ocean igloo
#

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

runic vine
#

huh interesting.
Do you have a test page I can take a look at?

ocean igloo
#

do you want to try yourself in our app?

runic vine
#

sure

but we obtained a payment with cus_MVJz0YNpO2KnKo
also can you share the payment intent ID of this payment?

ocean igloo
#

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

sweet oak
#

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

ocean igloo
#

oh okay thank you

#

it seems a bug

sweet oak
#

Can you summarize your overall goal here?

ocean igloo
#

price table can't reference the customer ID so it creates a new customer every time

sweet oak
#

And Checkout does not use this value to identify a customer

ocean igloo
#

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

sweet oak
#

This is a known limitation of the Pricing Table

ocean igloo
#

Sorry, Hanzo gave us hope

sweet oak
#

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

ocean igloo
#

So we need to create single checkout using "stripe price id" singularly

#

is it correct?

sweet oak
#

I don't know what that sentence means. Could you restate the question?

ocean igloo
#

we have to build our own pricing table, with buttons linked to these price id

#

using the "traditional way" but simulating a pricing table

sweet oak
#

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.

ocean igloo
#

ok perfect

#

Thank you

#

have a nice day

sweet oak
#

I'm happy I could offer some help. I will also raise this as feedback for the Pricing Table team.

ocean igloo
#

thank you! That feature would be amazing

#

it would simplify things A LOT