#mtanzi - subscription migration
1 messages · Page 1 of 1 (latest)
the exact error returned is the following:
Stripe::InvalidRequestError: This customer has no attached payment source or default payment method.
from /Users/mtanzi/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/stripe-5.28.0/lib/stripe/stripe_client.rb:592:in `handle_error_response'
Can you share the request id where you get this please? such as req_123
https://stripe.com/docs/api/request_ids
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
But yes it looks like you don't have a payment method specified as the invoice default for that customer
If you create the subscription with payment_behavior=default_incomplete you can do so without a payment method, if you intend to confirm the payment when collecting payment details later
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I am using the ruby wrapper, I am not receiveing the request id
to have an active subscription I always need a payment method assigned to the customer?
You can still access it on the response object, or check your dashboard logs for recent requests:
https://dashboard.stripe.com/test/logs
let say I, as an admin want to activate a subscription for a customer via API
req_8gXouYtPQ6Nktc
With charge_automatically, yes, you can also provide a customer email address and use send_invoice instead:
https://stripe.com/docs/api/subscriptions/create?lang=curl#create_subscription-collection_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.
also using charge_automatically it failed, here is the req: req_rIdrJI6w1Y9LqE
Yes you need a payment method to charge automatically
You can either defer the first payment with default_incomplete, or you can send invoices for payment
I see, ok...
Thanks for the help!