#madmark00178

1 messages · Page 1 of 1 (latest)

hollow shadowBOT
#

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.

jovial acorn
#

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.

dry vigil
#

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.

jovial acorn
dry vigil
#

req_Eh5frZt9gr6oHz

#

And this is hte event data id for the completed checkout session: cs_test_a1gx6T3X5nZonRuJSs4p9taEgWOU0o0ITudhLLXv4goGt4EgGWWsWOGFTZ

jovial acorn
#

Looking, hang on...

#

The Subscription has default_payment_method set as expected.

dry vigil
#

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?

jovial acorn
#

You're explicitly setting the default on the Customer in that code.

#

If you want it set on the Customer you need to do that, like your code above is doing when you create the Customer.

dry vigil
#

Ah i see

#

Okay ill play around with that, thank you for the help!