#mariohd
1 messages · Page 1 of 1 (latest)
Hello! There shouldn't be differences like the one you're describing. Are you using Stripe Connect at all?
Hi Rubeus. No, I'm using ES Module Stripe.js SDK for web and Stripe Android SDK for mobile.
Can you share the code that triggered the error?
Well, the error is triggered when making a request similar to this one (these are fake stripe ids):
subscription = stripe.Subscription.create(
customer="cus_4fdAW5ftNQow1a",
items="price_1Hh6bXCRMbs6FrXf5GK4k3kN",
default_payment_method="pm_1Hh6bXCRMbs6FrXf5GK4k3kN",
trial_period_days=7,
)
None of those IDs are sensitive and you can share the actual ones. In particular, can you tell me the actual Customer and Payment Method IDs you tried to use?
Ahhh, sure, give me a minutre
Rubeus, my fault, I double checked and seems that the error was triggered one step before in:
stripe.Customer.modify("cus_PbW1FIFdUfVynd", default_source="pm_1OmJ09IXCQvpWxEKbTNIxO4f")
I removed this code and the subscription works ... but why does the default source assignment fail?
You can't set a Payment Method as a default_source.
Payment Methods are our current, modern API and default_source is part of our older, legacy API.
It sounds like you want to set invoice_settings.default_payment_method instead: https://docs.stripe.com/api/customers/update#update_customer-invoice_settings-default_payment_method
Great, that's exactly what I'm looking for. I'll tweak the code to do it that way.
Many thanks! 🙌