Move card brand fieldnames to CC constants

This commit is contained in:
Daniel James Smith 2022-01-02 14:18:17 +01:00
parent 7e5b50a6cb
commit 5c66dade4a
No known key found for this signature in database
GPG Key ID: 03E4BD365FF06726
2 changed files with 9 additions and 1 deletions

View File

@ -415,7 +415,7 @@ export default class AutofillService implements AutofillServiceInterface {
fillFields.code = f;
break;
} else if (!fillFields.brand && this.isFieldMatch(f[attr],
['cc-type', 'card-type', 'card-brand', 'cc-brand', 'cb-type'])) {
CreditCardAutoFillConstants.CardBrandFieldNames)) {
fillFields.brand = f;
break;
}

View File

@ -162,6 +162,14 @@ export class CreditCardAutoFillConstants {
"ccv",
];
static readonly CardBrandFieldNames: string[] = [
"cc-type",
"card-type",
"card-brand",
"cc-brand",
"cb-type",
];
// Each index represents a language. These three arrays should all be the same length.
// 0: English, 1: Danish, 2: German/Dutch, 3: French/Spanish/Italian, 4: Russian, 5: Portuguese
static readonly MonthAbbr = ["mm", "mm", "mm", "mm", "mm", "mm"];