#Deathnfudge-hello

1 messages · Page 1 of 1 (latest)

full dust
#

Hi there!

#

Post your question in this thread

hidden tartan
#

Sorry about that. Hit enter too quickly.
I'm working on subscription reactivation after being canceled. I'm getting an error stating This customer has no attached payment source or default payment method.

Customers are created via Stripe Checkout. I'm fetching the customer but it's coming back without a default payment method. I'm seeing a card on file when looking at their account in the development dashboard. I'm not sure if we need to add a setting in order to set that card as their default payment method or if there's something I'm missing as I'm looking through the docs. This is what is linked to in the error message but I couldn't find anything that seemed to fix our issue.

https://stripe.com/docs/billing/subscriptions/payment-methods-setting#payment-method-priority

Learn how to specify which payment methods are allowed for a subscription.

full dust
#

Can you provide the request ID where you see that error?

#

Would be happy to look

hidden tartan
#

Hmm. In the error it's giving me a nil for the request id.
Here's the full error. I'm using Elixir stripity_stripe.

{:error,
 %Stripe.Error{
   code: :invalid_request_error,
   extra: %{
     card_code: :resource_missing,
     http_status: 400,
     raw_error: %{
       "code" => "resource_missing",
       "doc_url" => "https://stripe.com/docs/error-codes/resource-missing",
       "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.",
       "type" => "invalid_request_error"
     }
   },
   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: nil,
   source: :stripe,
   user_message: nil
 }}

Does that point to something being set up incorrectly?

full dust
#

Do you have any object ID I can look at?

hidden tartan
#

Perfect. Here's the request id.
req_CswcGYzlZ8Wu56
Customer id. cus_MIgUy3W0CbyJBB

full dust
#

Thanks! Taking a look

#

This is weird, or I'm missing something obvious 😅

#

Still looking

#

Ah wait I think I know

#

Okay yeah

#

So when you create a Subscription using Checkout it sets the PaymentMethod as the default for that Subscription

#

As opposed to setting it as the default at the Customer-level to be used for all Subscriptions for that Customer

hidden tartan
#

Gotcha. Thanks for the help!