#stripe_connect_platform-customer-PM

1 messages ยท Page 1 of 1 (latest)

quasi canopy
#

Hi ๐Ÿ‘‹ we're not very familiar with the dashboard in this forum, but I believe that column in your first screenshot shows the default payment method. While that customer does appear to have a payment method attached, it doesn't look like it was set as their default payment method.

south tangle
#

OK, if they have only one, it is not by default the default?

#

Is this something we force in the CheckoutSession?

#

Or does the customer have to check the box that says "Save my info for secure 1-click checkout" to save as default

quasi canopy
#

Correct, we don't assume a payment method should be a customer's default. I'll need to double check whether there is a checkout setting that can adjust that behavior.

south tangle
#

OK, yes, I imagine we want to set whatever payment method they use on that first payment to the default and set up the card to allow future payments on that default card.

quasi canopy
#

So when creating the Checkout Session, you can pass the payment_intent_data.setup_future_usage parameter to tell us to attempt optimizing the card for reuse.
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage

That doesn't however set the default payment method for the customer, that is something you would need to manually do. If you do, you'll also need to take into account what behavior you want to build when a customer uses a new payment method.

But, Checkout Sessions will try to pull in the most recently used card for existing customers if certain criteria are met. That's talked about more here:
https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=checkout#handling-existing-customers

Securely accept payments online.

south tangle
#

OK, just last thing before I code it.

#

If the customer only has one payment method, I can set it to default? I'm hoping it will then get the cool little default tag in the dashboard and show up in the index page (but I realize you don't advise on dashboard),

quasi canopy
#

In the middle of testing now, should have an answer for you shortly.

south tangle
#

*OK, looks like when someone updates a credit card number we just set customer.source
but in this case we don't have the token, we just have to take the existing payment_method and set it to the customer's default.

quasi canopy
#

Confirmed, once you specify a Payment Method as default it will appear in that column you pointed to initially, and adds the default tag when looking at a single customer record.

https://stripe.com/docs/api/customers/update?lang=python#update_customer-invoice_settings-default_payment_method

south tangle
#

Can we set customer.source = pm or is there some other way to set an existing pm to the default pm?

#

ok reading that now

quasi canopy
#

๐Ÿ‘ it's the invoice_settings.default_payment_method parameter that you want to update.

#

Oh, but if you're working with sources I don't think that will work as that field expects a payment method.

south tangle
#

right. So get the Customer and set invoice_settings.default_payment_method = pm_xxxxxxxx

quasi canopy
#

Exactly