зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1504032 - Remove concept of card types, supportedTypes, BasicCardType enum r=MattN,baku
The concept of card types, supportedTypes, BasicCardType enum, were removed from the Basic Card spec. Differential Revision: https://phabricator.services.mozilla.com/D10646 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
85b6855540
Коммит
da6078096e
|
@ -178,9 +178,7 @@ let REQUEST_2 = {
|
|||
},
|
||||
},
|
||||
],
|
||||
data: {
|
||||
supportedTypes: "credit",
|
||||
},
|
||||
data: {},
|
||||
},
|
||||
],
|
||||
error: "",
|
||||
|
|
|
@ -250,7 +250,7 @@ var paymentRequest = {
|
|||
}
|
||||
let modifier = modifiers.find(m => {
|
||||
// take the first matching modifier
|
||||
// TODO (bug 1429198): match on supportedTypes and supportedNetworks
|
||||
// TODO (bug 1429198): match on supportedNetworks
|
||||
return m.supportedMethods == "basic-card";
|
||||
});
|
||||
return modifier || null;
|
||||
|
|
|
@ -421,9 +421,7 @@ var PaymentTestUtils = {
|
|||
label: "Total due",
|
||||
amount: { currency: "USD", value: "2.50" },
|
||||
},
|
||||
data: {
|
||||
supportedTypes: "credit",
|
||||
},
|
||||
data: {},
|
||||
},
|
||||
{
|
||||
additionalDisplayItems: [
|
||||
|
|
|
@ -108,20 +108,6 @@ function checkComplexRequest(payRequest) {
|
|||
supportedNetworks[idx] + "'.");
|
||||
}
|
||||
}
|
||||
const supportedTypes = data.supportedTypes;
|
||||
const expectedSupportedTypes = ["prepaid", "debit", "credit"];
|
||||
if (supportedTypes.length != expectedSupportedTypes.length) {
|
||||
emitTestFail("supportedTypes.length should be '" +
|
||||
expectedSupportedTypes.length + "', but got '" +
|
||||
supportedTypes.length + "'.");
|
||||
}
|
||||
for (let idx = 0; idx < supportedTypes.length; idx++) {
|
||||
if (supportedTypes[idx] != expectedSupportedTypes[idx]) {
|
||||
emitTestFail("supportedTypes[" + idx + "] should be '" +
|
||||
expectedSupportedTypes[idx] + "', but got '" +
|
||||
supportedTypes[idx] + "'.");
|
||||
}
|
||||
}
|
||||
// checking the passed PaymentDetails parameter
|
||||
const details = payRequest.paymentDetails;
|
||||
if (details.id != "payment details" ) {
|
||||
|
|
|
@ -5,7 +5,6 @@ const defaultMethods = [{
|
|||
supportedNetworks: ['unionpay', 'visa', 'mastercard', 'amex', 'discover',
|
||||
'diners', 'jcb', 'mir',
|
||||
],
|
||||
supportedTypes: ['prepaid', 'debit', 'credit'],
|
||||
},
|
||||
}, {
|
||||
supportedMethods: "testing-payment-method",
|
||||
|
|
|
@ -21,13 +21,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1375345
|
|||
}
|
||||
gScript.addMessageListener("test-fail", testFailHandler);
|
||||
|
||||
const errorTypesMethods = [{
|
||||
supportedMethods: "basic-card",
|
||||
data: {
|
||||
supportedTypes: ["myType"],
|
||||
},
|
||||
}];
|
||||
|
||||
const errorNetworksMethods = [{
|
||||
supportedMethods: "basic-card",
|
||||
data: {
|
||||
|
@ -55,7 +48,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1375345
|
|||
supportedNetworks: ["unionpay", "visa", "mastercard", "amex", "discover",
|
||||
"diners", "jcb", "mir",
|
||||
],
|
||||
supportedTypes: ["prepaid", "debit", "credit"],
|
||||
},
|
||||
}];
|
||||
const defaultDetails = {
|
||||
|
@ -97,19 +89,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1375345
|
|||
shippingType: "shipping"
|
||||
};
|
||||
|
||||
function testBasicCardRequestWithErrorTypes() {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
const payRequest = new PaymentRequest(errorTypesMethods, defaultDetails, defaultOptions);
|
||||
ok(false, "Expected 'TypeError', but got success construction.");
|
||||
resolve();
|
||||
} catch (e) {
|
||||
is(e.name, "TypeError", "Expected TypeError, but got " + e.name);
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function testBasicCardRequestWithErrorNetworks() {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
|
@ -282,8 +261,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1375345
|
|||
}
|
||||
|
||||
function runTests() {
|
||||
testBasicCardRequestWithErrorTypes()
|
||||
.then(testBasicCardRequestWithErrorNetworks)
|
||||
testBasicCardRequestWithErrorNetworks()
|
||||
.then(testBasicCardRequestWithUnconvertableData)
|
||||
.then(testBasicCardRequestWithNullData)
|
||||
.then(testBasicCardRequestWithEmptyData)
|
||||
|
|
|
@ -40,7 +40,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1345361
|
|||
supportedNetworks: ['unionpay', 'visa', 'mastercard', 'amex', 'discover',
|
||||
'diners', 'jcb', 'mir',
|
||||
],
|
||||
supportedTypes: ['prepaid', 'debit', 'credit'],
|
||||
},
|
||||
}];
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1436903
|
|||
supportedNetworks: ['unionpay', 'visa', 'mastercard', 'amex', 'discover',
|
||||
'diners', 'jcb', 'mir',
|
||||
],
|
||||
supportedTypes: ['prepaid', 'debit', 'credit'],
|
||||
},
|
||||
}, {
|
||||
supportedMethods: "testing-payment-method",
|
||||
|
|
|
@ -33,7 +33,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1345366
|
|||
supportedNetworks: ['unionpay', 'visa', 'mastercard', 'amex', 'discover',
|
||||
'diners', 'jcb', 'mir',
|
||||
],
|
||||
supportedTypes: ['prepaid', 'debit', 'credit'],
|
||||
},
|
||||
}, {
|
||||
supportedMethods: "testing-payment-method",
|
||||
|
|
|
@ -6,15 +6,9 @@
|
|||
* The origin of this WebIDL file is
|
||||
* https://www.w3.org/TR/payment-request/#paymentrequest-interface
|
||||
*/
|
||||
enum BasicCardType {
|
||||
"credit",
|
||||
"debit",
|
||||
"prepaid"
|
||||
};
|
||||
|
||||
dictionary BasicCardRequest {
|
||||
sequence<DOMString> supportedNetworks;
|
||||
sequence<BasicCardType> supportedTypes;
|
||||
};
|
||||
|
||||
dictionary BasicCardResponse {
|
||||
|
|
Загрузка…
Ссылка в новой задаче