#napolean_solo
1 messages · Page 1 of 1 (latest)
hello
the webhook i receive is always from the wrong customer_id
Can you explain more about this, or share a concrete example we can look at?
When i subscribe from the pricing table the webhook payload i am receiving is from an invalid customer_id and not the actual id.
But when I subscribe from the main site of stripe by manually creating a sub for a customer it send the correct customer_id in the webhook.
Well i wish i could but the thing is the customer_id is invalid so I can't fetch the event as it doesn't exist for the actual user.
is there a another workaround ?
I don't really understand what you're trying to do, then
I thought you were describing receiving an event with a customer id you did not expect
but now it seems liek you're describing something else
no
Can you explain exactl what you are trying to do and what is not doing what you expect?
I mean exactly what I said
the webhook payload i am receiving is from an invalid customer_id
what webhook payload?
Can you show me that payload?
I received an event on my endpoint but turns out it is the wrong customer_id. This is happening only when using pricing table embedded on my app.
When i create a sub manually it sends the webhook payload with correct customer_id.
I will try to get the payload
Or just the event ID, i can look that up
I'm not sure what you mean by "wrong" customer ID, since you don't know that ahead of time, unless there's a piece here that i am missing
i am checking the logs of my code and I can see the customer_id I am receiving is wrong and that is causing it my code to error.
Basically the customer_id of the user and the id I am receiving on my webhook, there's a big difference
I cannot get the event_id because as the customer_id is not in my stripe database so I cannot fetch the event
Ok if you can share an example event, and a snippet of relevant code you use to consume this, I can take a look to help understand whats going on
Can you give me the example customer id?
the code is all fine, it is working completely fine when i manually create sub, The issue for sure is on your end in pricing table.
I can't hlep you if you can't share more details
just give me 2 mins, I am trying to get the payload so I can show the differene
in the meantime let me explain:
this is the actual id of the customer: cus_Oq8EZMKhqdlFub
But when I create sub from the pricing table i get this ID: cus_P66Ey6e2emBqi7
Which doesn't exist
ok so got it
This is the actual customer_id of the customer: cus_OfQiL7oGV31aUv
And this is the event_id: evt_1OHvSUSCkgVAHKZay20utdQb
you can check for yourself
the customer_id doesn't match
This is the customer_id i am receiving my brother: cus_P67hJxgJYFBTh7
you there brother?
Yes, looking at customers and events around this
These appear to be four separate customers
hmm
is it the email issue? I am using a generic email for testing like tim@test.com
The issue is that you're expecting the customer email you provide in the pricing table url to be tied to the customer you separately created
Yes, but customer emails are not unique, you can have many customers with the same email, as here
If you want to limit customers two a single subscription you can optionally enable that as described here: https://stripe.com/docs/payments/checkout/limit-subscriptions#direct-your-customers-to-the-customer-portal-or-your-website
Which points to a Dashboard setting that allows you to have those recognized customers with existing subscriptions to redirect them to the customer portal or a url you choose on your site
Where you can then create additional subscriptions for the existing customer
wait this doesn't explain the discrepancy in the customer_id.
or whatever you need to do
You're expecting the email to get mapped to that existing customer id, but that's not how that works
so it is creating a new one is what you mean>
It's expected that by default a new customer is created for each click of a payment link (or pricing table button)
yes
👍
The option to limit customers to a single subscription is how you can manage customers using the same email via the pricing table/payment link to reach Checkout: https://stripe.com/docs/payments/checkout/pricing-table#limit-subscriptions
ok thanks
https://dashboard.stripe.com/settings/checkout go here and enable "limit customer to 1 subscription" then try your flow again
yes I did,
Hi, stepping as my teammate needs to step away. Let me catch up here