#sintonz - Save Payment Method
1 messages · Page 1 of 1 (latest)
Hello! I don't think so, no. We recommend using a Setup Intent or Payment Intent to attach a Payment Method to a Customer. Can you tell me more about what you're trying to build?
it might be the save() that interacts with my database maybe
It has been a while since i wrote this code
Basically I do not want to get the customer id from my database
top line and bottom lines
And am replacing with try blocks
to create the customer id in stripe if the email cannot find it
This is the part of the code that attaches the Payment Method to the Customer: stripe.PaymentMethod.attach(payment_method_id,customer=customer)
ok so the customer.save() seems to be saving to my db not the stripe API
right?
Weird since the customer top variable is querying the stripe API using the value in my database
the user_membership database value
Honestly I don't know, I've never seen .save() on a Stripe Customer Object like that...
i have seen it in django that is probably it
Just weird though how it is saving the stripe API call which is what the customer variable is
the long commented one with #####
Yeah, the comment there doesn't make sense to me. Attaching the Payment Method happens in that single line of code, there's no second step. See the snippet here, for example: https://stripe.com/docs/api/payment_methods/attach?lang=python