#tequila-customer-payment-methods
1 messages · Page 1 of 1 (latest)
Hello! You can set a customers invoice_settings with a default payment method for invoices/subscriptions: https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
There is no such default for one time payment intents, you always need to explicitly provide a payment method to use
Is there a way to go from the Customer object to its default PaymentMethod?
sure, you can look at the customer object and inspect invoice_settings.default_payment_method as the docs above refer you.
I'm using this...
Customer customer = Customer.retrieve("cust_1234");
PaymentMethod paymentMethod = customer.getInvoiceSettings().getDefaultPaymentMethodObject();
but getting null
Hello! What's the Customer ID?
cus_Kb97j74Vt0E341 its a test user
Thanks, let me take a look...
Hm, there is a default Payment Method set for Invoices on that Customer...
Does PaymentMethod paymentMethod = customer.getInvoiceSettings().getDefaultPaymentMethod(); work?
yep that return the id so was able to use it to call the PaymentMethod API and got back the full object. Thanks.