#x001w-subscriptions
1 messages · Page 1 of 1 (latest)
[ERROR] Request error from Stripe (status 400): {"code":"resource_missing","doc_url":"https://stripe.com/docs/error-codes/resource-missing","status":400,"message":"This customer has no attached payment source or default payment method. Please consider adding a default payment method. For more information, visit https://stripe.com/docs/billing/subscriptions/payment-methods-setting#payment-method-priority.","request_id":"req_H2EnZOr3yIuWiO","type":"invalid_request_error"}
pls help
hello~
hi
?
when creating the subscription, if you don't set default_payment_method, the subscription will attempt to use the customer’s invoice_settings.default_payment_method. So either set default_payment_method to the PaymentMethod attached on the customer on the subscription, or set the PaymentMethod attached to the customer as the invoice_settings.default_payment_method
it's this parameter : https://stripe.com/docs/api/subscriptions/create#create_subscription-default_payment_method. Not PaymentSettings
Example
params := &stripe.SubscriptionParams{
Customer: stripe.String("cus_..."),
DefaultPaymentMethod: stripe.String("pm_..."),
Items: []*stripe.SubscriptionItemsParams{
{
Price: stripe.String("price_..."),
},
},
}
s, _ := sub.New(params)
ID of a payment method that’s attached to the customer, to be used as the customer’s default payment method for subscriptions and invoices.
I can't get the ID.
what is it the ID?
you can list a customer's payment methods using https://stripe.com/docs/api/payment_methods/customer_list
it's not exportable via the Dashboard unless you've set the payment method to the customer's default payment method
Can my existing customers still set a default payment method? If possible, how to do it? Please tell me, thank you.
I'm migrating data on customer subscriptions. pls
if you want to do it for your existing customers, you can either set it via https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method or do it via the Dashboard
do it via the Dashboard is one by one for old customers ?
yes, you have to do it one by one for each customer via the Dashboard
ok, thanks very much. I will try