#just-john_unexpected

1 messages ยท Page 1 of 1 (latest)

left sluiceBOT
#

๐Ÿ‘‹ 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.

vestal herald
#

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?

dusky solar
#

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.

vestal herald
dusky solar
#

I am doing that

#

My code:

      await createSubscription({
        customerId,
        dateRange: dateRange as RangeValue<DateValue>,
        paymentMethod: setupResult.setupIntent.payment_method!,
        propertyId,
      });
vestal herald
dusky solar
#

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?

vestal herald
#

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

dusky solar
#

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. ๐Ÿ™‚

vestal herald
#

great!