#mdubya
1 messages · Page 1 of 1 (latest)
Hello! They can't be converted, no, but they can be used as if they were a Payment Method. So, for example, you can set the payment_method on a Payment Intent to src_... for example.
so a ```py
response = stripe.PaymentIntent.create('cus_', 'src__')
```py
response = stripe.PaymentIntent.create('cus__', 'pm__') ```
?
half my customers payment info (cards) were saved as a src and then newer customers are a pm
Yes, that's correct.
is there an easy way to still attach a source to a test customer?
like how you have 'pm_card_visa'
nm. i see i can still use the tok_visa.
Yep!
one more question/thought.
if im going thru my customers and trying to get the default payment method for every customer
stripe does not have a standard default_payment_method that could be either a src__ or a pm__
its more of a ```py
if customer.invoice_settings.default_payment_method:
default_payment_method = default_settings.default_payment_method
else:
if customer.default_source:
default_payment_method = customer.default_source
Yep, that's correct.
ok. really one last question which i know is more of a preference or optimization.
i have a cron that pre-authorizes card charges
do you see more people storing payment_methods locally or do you see them peforming 2 queries?
one to get default payment_method and then one to create a payment_intent
What you might want to do is set your own default in metadata: https://stripe.com/docs/api/metadata
You could have a default_pm metadata key which contains either the src_ or pm_ and then ignore default_source and invoice_settings.default_payment_method.