#mdubya

1 messages · Page 1 of 1 (latest)

small flumeBOT
zinc tulip
#

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.

weak crane
#

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

zinc tulip
#

Yes, that's correct.

weak crane
#

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.

zinc tulip
#

Yep!

weak crane
#

rgr that. want to test both and dont have any src__ on test customers.

#

thx

weak crane
#

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

zinc tulip
#

Yep, that's correct.

weak crane
#

hmm

#

odd. but got it.

#

thx

weak crane
#

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

zinc tulip
#

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.