#paulc7053_api
1 messages · Page 1 of 1 (latest)
👋 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/1357754646449361047
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- paulc7053_handling-setup-intent-confirm-failures, 1 day ago, 148 messages
Hi again! Not 100% sure I understand what you mean here; can you tell me more?
Hello again! Sure. I'm trying to create 2 test accounts in production (to submit an app for review), but when I create the second subscription (and customer), it seems like I cannot find the user's subscriptions. Logs look like this { customer: { id: 'cus_S4LOdAvqBBsA2u', object: 'customer', address: null, } }
These are the user's subscriptions { subscriptions: { object: 'list', data: [ [Object] ], has_more: false, url: '/v1/subscriptions' } }
But none seem to match the payment intent { subscription: undefined }
Sorry setup Intent
and the setup intent is `{
setupIntent: {
id: 'seti_1RAChpJ4ILijjURSTucDEV7l',
created: 1743782577,
customer: 'cus_S4LOdAvqBBsA2u',
}
}`
Okay, sorry for blasting all that, I made them shorter
I mean, you can never take back that wall of text. 😂 No worries. 🙂
data: [ [Object] ],
really? arent the updates I see in real time?
Sorry, what?
I thought that as soon as I edit a message its being updated for you in real time
Oh, it is. It was a joke.
aah okay 🙂
A bad joke, it seems. ¯_(ツ)_/¯
im just bad at picking them sometimes
data: [ [Object] ],
So that contains a result, which should be that Subscription.
Am I correct in assuming you are just trying to retrieve all the Subscriptions for a Customer?
yes
and then // try to match the setup intent const subscription = subscriptions.data.find( (sub) => sub.pending_setup_intent === setupIntent.id );
but none seem to match the setup intent.. which is weird
What does the Setup Intent have to do with this exactly?
I retrieve the user's subscription based on the setup intent id in the sent event
Which event?
setup_intent.succeeded
to be noted that it works as expectd when I usually sign up. it behaves unexpected when I create the second subscription/customer with the same card
Can you share the second Customer ID with me?
it's cus_S4LOdAvqBBsA2u
Oh! You wouldn't have a SetupIntent with the second Subscription because the card is already set up.
Huh
really? but the event was sent
Sorry, I got confused.
no worries
Do you not record the Subscription ID when you create it? I'm just trying to understand why you're using the Setup Intent like this.
I do, but I just need to retrieve the stripe subscription in this event.
i need to read the metadata here, and I cannot change the flow
everything looks as expxcted in the dashboard, but no subscription matches the payload setup intent ID
Okay I really have to go... The building closes. I'll come back to this in a few hours....
Thanks for your time!
No worries - I'll have to close this one out but you can pop open a new thread when you get back. 🙂
Nice, ok.
So you have a Setup Intent, and you want to figure out which Subscription it relates to, ya?
Sweet. And that's sub_1RAChoJ4ILijjURS3k7KD7hM ya?
Yes
I think you might want to try using the Payment Method ID instead: Subscription has default_payment_method and Setup Intent has payment_method, and they should always match in/after the setup_intent.succeeded event.
That’s correct
But by the same logic shouldn’t the setup intent also work?
I would even be inclined to believe the payment method Id could be even more problematic, because I’m using the same card, no?
No, because once the Setup Intent is no longer pending, it's no longer a pending_setup_intent.
Each Payment Method ID is globally unique (across Stripe).
You're very welcome! 🙂