#just-john_unexpected
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/1300673020314255411
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hello! what do you mean by a payment method is not created? If you get a PaymentMethod id back, that means the PaymentMethod is created
do you mean the PaymentMethod is not attached to the customer?
It's possible that it's just not attached to the customer, but I couldn't find it at all.
It's not showing up on the customer in the dashboard
And it also throws an error when I try to create a subscription with it, saying it doesn't exist.
when you create the SetupIntent, you should include the customer id : https://docs.stripe.com/api/setup_intents/create#create_setup_intent-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.
I am doing that
My code:
await createSubscription({
customerId,
dateRange: dateRange as RangeValue<DateValue>,
paymentMethod: setupResult.setupIntent.payment_method!,
propertyId,
});
https://dashboard.stripe.com/test/logs/req_gtvbV7taGPTAOR - i don't see any customer id being passed in here
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Okay, that must be it.
Ah, yep. I just checked again and while there were no code changes to the setupIntent logic, there were changes to the axios code. Post body probably got messed up. My bad.
Thanks a bunch!
By the way, what can I look at to notice that it's not getting attached to a customer?
Is there somewhere I can check in the dashboard or one of the return fields?
looking at the PaymentMethods on the customer is probably the easiest way? I'm not too sure what specifically you're trying to validate though. If you pass in the customer id when creating the SetupIntent, if the SetupIntent is successfully, it'll definitely automatically attach the PaymentMethod to the Customer
Yeah, I follow that, I'm just wondering what the easiest way would have been to realize what the issue was. But I guess now that I know how it works just checking if it showed up on the customer is probably easiest.
Thanks!
Already found and fixed the issue btw. Working now. ๐
great!