#nicus_api

1 messages ¡ Page 1 of 1 (latest)

gaunt gulchBOT
zenith nightBOT
#

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.

gaunt gulchBOT
#

👋 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/1275807907031679068

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

queen bay
#

Hi,
We are charging a customer using the API, but the payment fails.
I debugged the code, and when I tried to get the default payment method for this customer I get an None.

This is the method we use:
def get_default_payment_method(self, customer_id) -> Optional[str]:
customer = self.stripe.Customer.retrieve(customer_id)
if pydash.get(customer, "invoice_settings.default_payment_method"):
return pydash.get(customer, "invoice_settings.default_payment_method")
return None

The API version is 2019_08_14

The customer is this one: https://dashboard.stripe.com/customers/cus_Podb5ggvaCuD3d

It's weird because on the customer page it figures that an ACH is the default payment method.

rich tundra
#

I believe the payment method was generated using an older API which sets the default on default_source parameter on the customer

#

If you retrieve the customer and look at customer.default_source

#

you should see that payment method

queen bay
#

yes, that field returns the id of the payment method. This is the only customer we have with this problem, do you know if we can modify the setup using Stripe's dashboard so the invoice_settings.default_payment_method returns the same payment method that defualt_source?

rich tundra
#

I believe you'd need to recollect the payment method using a newer API to do this.. You can use SetupIntents and ask customer to provide the payment method again