-
Notifications
You must be signed in to change notification settings - Fork 680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[14.x] Handle automatic payment method updates #1534
Conversation
Hi @shatterproof. Although this looks good to me, I'm wondering if the |
Hey Dries, that is correct. I was surprised to find a It is an issue many might not even realize is happening, but could easily cause confusion or frustration for end users when an old card number is being shown to them in an app while a different one is getting charged by Stripe for recurring payments. |
Thanks @shatterproof. Can you add a section in the upgrade guide? This can target |
Definitely, I can take care of both tomorrow. |
Thanks, feel free to mark this as ready once done. |
@driesvints For the release can the version be adjusted to v14.13 as mentioned above to match the upgrade guide? |
As sorry, I messed that up. I changed the release in the upgrade guide instead. |
Thanks for your work on this btw! |
That works, thanks! Also no problem at all, contributing to a package I’ve been using for years is an honor. |
Vendors, including Visa and Mastercard, often reissue and update stored payment methods in place for Stripe users. This can involve updating the expiration date, but frequently also changes the entire card number as well.
The Stripe events log filtered for this type of event shows how often it happens, which we are seeing several times per day in our own apps (more than I would have expected).
These automatic updates allow the payment methods to continue to be successfully charged by Stripe, but has the side effect of causing the Cashier user model to become out of sync with the outdated
pm_last_four
stored.Fortunately, Stripe sends a
payment_method.automatically_updated
webhook when this happens that can be listened to for triggering an update of the locally stored payment method to ensure it stays in sync, which is the purpose of this PR.Since this is a non-breaking change, I believe it is a good candidate for a 14.x release to benefit users right away. Enabling it does require adding that webhook in the Stripe dashboard though, which I can note in the upgrade guide and docs upon merge.