#the-farrnacle_code
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1459289543520948325
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there, so you're looking for a way to detect when someone clicks that Edit icon on the saved payment method, do I have that right?
I guess another potential solution would be to always display all of the billing address fields in the PaymentElement but from what I can tell the only options are 'never' and 'auto', which chooses the least amount of fields possible
Yep! The idea is that if they hit the edit button, we can have the AddressElement appear so they can update the billingAddress on that card as well.
got it, I'm not sure if that's possible, please give me a few minutes to try a few things
perfect! Thanks for looking into it
yeah, just tested myself and clicking that button only throws the focus event, which doesn't have enough data to distinguish from other times the element would be focused. tried asking my colleagues as well and they are unaware of any way to detect this
changing the values in the saved payment method will throw the change event however, and the data from that includes the payment method id. perhaps you could check that event and determine whether the user is modifying a saved payment method?
Oh interesting idea. That's good to know. I'll try that.
While I have you here, do you know if either of these things is possible?
Displaying all address fields in PaymentElement?
Turn off editing the saved payment methods completely? (but still having them show up)
Turn off editing the saved payment methods completely? (but still having them show up)
no, but oddly enough you can control whether the remove button shows up in the Customer Session https://docs.stripe.com/api/customer_sessions/object#customer_session_object-components-payment_element-features-payment_method_remove
looking into your other question, one moment
Displaying all address fields in PaymentElement?
unfortunately not, the only way to always collect billing address is by using the Address Element https://docs.stripe.com/payments/payment-element/control-billing-details-collection#advanced:-using-address-element-in-billing-mode
Yea i did see that in the docs. However, I was a little concerned by this little excerpt:
Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the customer object from that PaymentMethod.
Can you help me understand what that means? Does that mean that it removes the card from the subscription and won't charge it anymore?
right, if the customer has a recurring Subscription and they remove the payment method that the subscription depends on, the next billing cycle of that subscription will fail unless a new payment method is set up for it. The Customer object can have a default payment method defined for use for all that customer's subscriptions
basically I think that section of the doc is just a warning that you may not want to enable removing payment methods if you're also using subscriptions