Commit c0773253 authored by Olivier Robin's avatar Olivier Robin Committed by Commit Bot

Do not consider CVV as first field of credit card

CVV field in credit cards are unlikely to be the first
field of a form.
Allowing it result in wrong parsing in case there are two
series of fields for two different kind of cards
Exemple is on westelm.com.
Form contains

Westelm card number
---------------------
Westelm verification number
Credit card type
Credit card number
Credit card expiration
---------------------
Credit card verification

--------------------- is delimitation of what is considered as
credit card fields at the moment.

This CL forbids credit card to be the first field of the form.
It preserve the exception of reattaching a verification to the
previous card if it is an only field.

Bug: 728845
Change-Id: Ie29b323666651e671b25246532c68407534bbb0c
Reviewed-on: https://chromium-review.googlesource.com/809015Reviewed-by: default avatarRoger McFarlane <rogerm@chromium.org>
Reviewed-by: default avatarPeter Lee <pkl@chromium.org>
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524669}
parent 41f6c876
......@@ -168,13 +168,14 @@ std::unique_ptr<FormField> CreditCardField::Parse(AutofillScanner* scanner) {
scanner->Advance();
return std::move(credit_card_field);
} else {
// Put the scanner back to the field right after the current cvv.
scanner->Advance();
// Chances that verification field is the first of a card are really
// low.
scanner->Advance();
credit_card_field->verification_ = nullptr;
}
} else {
continue;
}
continue;
}
// TODO(crbug.com/591816): Make sure parsing cc-numbers of type password
......
......@@ -27,13 +27,13 @@ ADDRESS_HOME_CITY | PayPalCity | City/town/department* | | CreditCardViewModels
ADDRESS_HOME_STATE | PayPalState | State/province/region/county* | | CreditCardViewModels[0].CardTypeCode_1-default
ADDRESS_HOME_ZIP | PayPalZipCode | ZIP/Postal code* | | CreditCardViewModels[0].CardTypeCode_1-default
ADDRESS_HOME_COUNTRY | PayPalCountryCode | United States | US | CreditCardViewModels[0].CardTypeCode_1-default
CREDIT_CARD_VERIFICATION_CODE | WalletCCSecurityCode | Security code | | CreditCardViewModels[0].CardTypeCode_1-cc
UNKNOWN_TYPE | WalletCCSecurityCode | Security code | | CreditCardViewModels[0].CardTypeCode_1-default
UNKNOWN_TYPE | CashType | Western Union ($11.95 service charge per transaction) | WU | CreditCardViewModels[0].CardTypeCode_1-default
UNKNOWN_TYPE | CashType | Airport Ticket Office (service charge per transaction may apply) | ATO | CreditCardViewModels[0].CardTypeCode_1-default
UNKNOWN_TYPE | CashType | United Ticket Office (service charge per transaction may apply) | CTO | CreditCardViewModels[0].CardTypeCode_1-default
UNKNOWN_TYPE | BmlModel.IfForSixMonthsNoPayment | Yes, I would like to make no payments for six months on orders greater than $250. | true | CreditCardViewModels[0].CardTypeCode_1-default
CREDIT_CARD_NAME_FIRST | BmlModel.FirstName | First name* | | CreditCardViewModels[0].CardTypeCode_1-cc
CREDIT_CARD_NAME_LAST | BmlModel.LastName | Last name* | | CreditCardViewModels[0].CardTypeCode_1-cc
NAME_FIRST | BmlModel.FirstName | First name* | | CreditCardViewModels[0].CardTypeCode_1-default
NAME_LAST | BmlModel.LastName | Last name* | | CreditCardViewModels[0].CardTypeCode_1-default
ADDRESS_HOME_LINE1 | BmlModel.BMLAddressLine1 | Billing address* | | CreditCardViewModels[0].CardTypeCode_1-default
ADDRESS_HOME_CITY | BmlModel.BMLCity | City* | | CreditCardViewModels[0].CardTypeCode_1-default
ADDRESS_HOME_STATE | BmlModel.BMLStateCode | State/territory/province* | | CreditCardViewModels[0].CardTypeCode_1-default
......
......@@ -49,9 +49,9 @@ UNKNOWN_TYPE | Incident.CustomFields.c.email_opt_in | No | 0 | Incident.CustomFi
UNKNOWN_TYPE | Incident.CustomFields.c.franchise_forward | Yes | 1 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default
UNKNOWN_TYPE | Incident.CustomFields.c.franchise_forward | No | 0 | Incident.CustomFields.c.escalated_gift_card_devalue_1-default
UNKNOWN_TYPE | Incident.CustomFields.c.passthrough_textarea | Pass Through Text Area Optional Optional | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default
UNKNOWN_TYPE | Incident.Subject | Subject Optional Optional | | Incident.CustomFields.c.escalated_gift_card_devalue_1-cc
NAME_FIRST | Contact.Name.First | First Name * Required | | Incident.CustomFields.c.escalated_gift_card_devalue_1-cc
NAME_LAST | Contact.Name.Last | Last Name * Required | | Incident.CustomFields.c.escalated_gift_card_devalue_1-cc
UNKNOWN_TYPE | Incident.Subject | Subject Optional Optional | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default
NAME_FIRST | Contact.Name.First | First Name * Required | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default
NAME_LAST | Contact.Name.Last | Last Name * Required | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default
EMAIL_ADDRESS | Contact.Emails.PRIMARY.Address | Email Address * Required | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default
PHONE_HOME_WHOLE_NUMBER | Contact.Phones.HOME.Number | Phone Number Optional Optional | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default
UNKNOWN_TYPE | Contact.CustomFields.c.panera_my_panera_number | MyPanera Card Number Optional Optional | | Incident.CustomFields.c.escalated_gift_card_devalue_1-default
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment