When updating credit card in settings use existing card instance.
The current code creates a new card instance and sets all the values form the settings page. It then replaces the existing card instance in the DB. This is dangerous because it's easy to forget some. It would also reset all the metadata associated with this card. More specifically in this example, the settings don't have a way to set the billing address id. Instead of passing the value along in the settings to set it back on save, using the existing card and updating it is much more simple. Bug: 800829 Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation Change-Id: Ia6ce196c16295961bb6536a609ea866f953e1590 Reviewed-on: https://chromium-review.googlesource.com/860200 Commit-Queue: Sebastien Seguin-Gagnon <sebsg@chromium.org> Reviewed-by:Toni Barzic <tbarzic@chromium.org> Reviewed-by:
Devlin <rdevlin.cronin@chromium.org> Reviewed-by:
Michael Giuffrida <michaelpg@chromium.org> Reviewed-by:
Roger McFarlane <rogerm@chromium.org> Reviewed-by:
Jared Saul <jsaul@google.com> Cr-Commit-Position: refs/heads/master@{#531710}
Showing
Please register or sign in to comment