Closed Bug 1476571 Opened 8 years ago Closed 8 years ago

Billing address is incorrectly pre-filled starting from the second flow

Categories

(Firefox :: WebPayments UI, defect, P1)

defect

Tracking

()

VERIFIED FIXED
Firefox 63
Tracking Status
firefox63 --- verified

People

(Reporter: tbabos, Assigned: prathiksha)

Details

(Whiteboard: [webpayments])

Attachments

(2 files)

Attached video Video of the issue
[Affected versions]: Nightly 63.0a1 [Affected platforms]: Windows 10 x64, Mac OS X 10.12, Ubuntu 18.04 x64 [Prerequisites]: - set the pref dom.payments.request.enabled to "true" - make sure to have at least 2 Shipping Address saved on your profile [Steps to reproduce]: 1. Go to “https://rsolomakhin.github.io/pr/single/” and click on “Buy” 2. Select the second (or third and so on) Shipping Address from the dropdown menu 3. Click on “Add” for a new Payment method [Expected Result]: As per the requirements document: “Billing address: default would be as same as shipping address...” “General credit card form includes credit card details and pre-filled billing address” Thus, the pre-filled billing address should be the shipping address that was selected in Step 2. [Actual Result]: The pre-filled billing address is always the first shipping address from the drop-down menu.
Whiteboard: [webpayments] [triage]
Whiteboard: [webpayments] [triage] → [webpayments] [triage] [user-testing]
Assignee: nobody → prathikshaprasadsuman
Status: NEW → ASSIGNED
Priority: -- → P1
Whiteboard: [webpayments] [triage] [user-testing] → [webpayments]
Comment on attachment 8994722 [details] Bug 1476571 - Auto-select selectedShippingAddress as billing address when it is not null. https://reviewboard.mozilla.org/r/259222/#review266238 ::: browser/components/payments/res/containers/basic-card-form.js:172 (Diff revision 1) > + checkAddressExists(guid) { > + if (!guid) { > + return false; > + } > + > + let state = this.requestStore.getState(); I don't think we need to get the state again as you could pass it in but really I think you could do the following instead: ```js if (paymentRequest.getAddresses(state)[selectedShippingAddress]) { billingAddressSelect.value = selectedShippingAddress; } else { billingAddressSelect.value = Object.keys(addresses)[0]; } ``` This also avoid an unnecessary negation which helps readability. ::: browser/components/payments/test/mochitest/test_basic_card_form.html:187 (Diff revision 1) > checkCCForm(form, { > billingAddressGUID: address1.guid, > }); > > + let select = document.getElementById("billingAddressGUID"); > + ok(select.value, address1.guid, "Correct billing addresss shown"); I don't think this test is actually testing anything new and would have passed even before your fix as line 188 was already testing this and the first address is getting selected here. You need to test with multiple addresses where the selectedShippingAddress isn't the first address that would get naturallly selected.
Attachment #8994722 - Flags: review?(MattN+bmo)
Comment on attachment 8994722 [details] Bug 1476571 - Auto-select selectedShippingAddress as billing address when it is not null. https://reviewboard.mozilla.org/r/259222/#review266522 Thanks ::: browser/components/payments/test/mochitest/test_basic_card_form.html:190 (Diff revision 2) > checkCCForm(form, { > - billingAddressGUID: address1.guid, > + billingAddressGUID: address2.guid, > }); > > + let select = document.getElementById("billingAddressGUID"); > + ok(select.value, address2.guid, "Correct billing addresss shown"); I think this addition can be deleted because doesn't the `checkCCForm` handle this like I mentioned in my last review?
Attachment #8994722 - Flags: review?(MattN+bmo) → review+
Comment on attachment 8994722 [details] Bug 1476571 - Auto-select selectedShippingAddress as billing address when it is not null. https://reviewboard.mozilla.org/r/259222/#review266522 > I think this addition can be deleted because doesn't the `checkCCForm` handle this like I mentioned in my last review? Yeah, looks like it does. Removing it, sorry. :)
Pushed by prathikshaprasadsuman@gmail.com: https://hg.mozilla.org/integration/autoland/rev/c92cbb9c1b4d Auto-select selectedShippingAddress as billing address when it is not null. r=MattN
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
Flags: qe-verify?
Hi Matt, can you review and set the QE flag.
Flags: needinfo?(MattN+bmo)
Flags: qe-verify?
Flags: qe-verify+
Flags: needinfo?(MattN+bmo)
QA Contact: hani.yacoub
Build ID: 20180730221422 User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0 Verified as fixed on Firefox Nightly 63.0a1 on Windows 10 x 64, Mac OS X 10.13 and Ubuntu 18.04 x64.
Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: