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)
Firefox
WebPayments UI
Tracking
()
VERIFIED
FIXED
Firefox 63
| Tracking | Status | |
|---|---|---|
| firefox63 | --- | verified |
People
(Reporter: tbabos, Assigned: prathiksha)
Details
(Whiteboard: [webpayments])
Attachments
(2 files)
[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.
Updated•8 years ago
|
status-firefox63:
affected → ---
Whiteboard: [webpayments] [triage]
Updated•8 years ago
|
Whiteboard: [webpayments] [triage] → [webpayments] [triage] [user-testing]
| Assignee | ||
Updated•8 years ago
|
Assignee: nobody → prathikshaprasadsuman
Status: NEW → ASSIGNED
Updated•8 years ago
|
Priority: -- → P1
Whiteboard: [webpayments] [triage] [user-testing] → [webpayments]
| Comment hidden (mozreview-request) |
Comment 2•8 years ago
|
||
| mozreview-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/#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 hidden (mozreview-request) |
Comment 4•8 years ago
|
||
| mozreview-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
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+
| Assignee | ||
Comment 5•8 years ago
|
||
| mozreview-review-reply | ||
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. :)
| Comment hidden (mozreview-request) |
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
Comment 8•8 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
Updated•8 years ago
|
Flags: qe-verify?
Updated•8 years ago
|
Flags: qe-verify?
Flags: qe-verify+
Flags: needinfo?(MattN+bmo)
Updated•8 years ago
|
QA Contact: hani.yacoub
Comment 10•8 years ago
|
||
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.
You need to log in
before you can comment on or make changes to this bug.
Description
•