#madmark00178
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
- madmark00178, 17 hours ago, 9 messages
- madmark00178, 19 hours ago, 30 messages
Hello! A Customer's payment details are always saved for future use in subscription mode. You only need to use setup_future_usage when you're in payment mode.
But thats not happening in this case, ill test again now but i spoke to yesterday about this, if i do a checkout session the default payment method isn't being saved.
Can you give me the request ID showing creation of the Checkout Session so I can take a look? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_Eh5frZt9gr6oHz
And this is hte event data id for the completed checkout session: cs_test_a1gx6T3X5nZonRuJSs4p9taEgWOU0o0ITudhLLXv4goGt4EgGWWsWOGFTZ
Okay but if i retrieve the customer:
{
"address": null,
"balance": 0,
"created": 1707850908,
"currency": "usd",
"default_source": null,
"delinquent": false,
"description": null,
"discount": null,
"email": "max@vocalist.ai",
"id": "cus_PYYLkLlu4goR3K",
"invoice_prefix": "211F4063",
"invoice_settings": {
"custom_fields": null,
"default_payment_method": null,
"footer": null,
"rendering_options": null
},
"livemode": false,
"metadata": {
"uid": "rs37cP1q3bZ7lWFGcOiJ2HJfqQ63"
},
"name": null,
"next_invoice_sequence": 2,
"object": "customer",
"phone": null,
"preferred_locales": [],
"shipping": null,
"tax_exempt": "none",
"test_clock": null
}
Default payment method is null, which has never been the case when i have done test clock / api calls to simulate checkout sessions
Actually i'm looking how i've tested before:
customer = stripe.Customer.create(
email=test_email,
test_clock=test_clock,
payment_method=payment_method,
invoice_settings={"default_payment_method": "pm_card_visa"},
metadata={"uid": test_uid},
)
subscription = stripe.Subscription.create(
customer=customer["id"],
items=[{"price": price_pro}],
proration_behavior=None,
trial_period_days=7,
)
This python code. So does this not accurately recreate what happens during a checkout session?
You're explicitly setting the default on the Customer in that code.
Checkout will set the default on the Subscription, not the Customer: https://stripe.com/docs/api/subscriptions/object#subscription_object-default_payment_method
If you want it set on the Customer you need to do that, like your code above is doing when you create the Customer.