Bug 1497110 - remove currencySystem from PaymentRequest. r=edenchuang, peterv
authorMarcos Cáceres <mcaceres@mozilla.com>
Sun, 07 Oct 2018 21:00:00 +0300
changeset 489774 26d29ab41cdf753774f2d7ccdc0a7b460a5528cc
parent 489773 31ceac3c03fc21c6a53cf667844ffbfe5caad0d9
child 489775 2a75c991871634b64f4dbf179130be4d279f521d
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersedenchuang, peterv
bugs1497110
milestone64.0a1
Bug 1497110 - remove currencySystem from PaymentRequest. r=edenchuang, peterv
dom/payments/PaymentRequest.cpp
dom/webidl/PaymentRequest.webidl
--- a/dom/payments/PaymentRequest.cpp
+++ b/dom/payments/PaymentRequest.cpp
@@ -398,25 +398,16 @@ PaymentRequest::IsValidCurrency(const ns
 
 nsresult
 PaymentRequest::IsValidCurrencyAmount(const nsAString& aItem,
                                       const PaymentCurrencyAmount& aAmount,
                                       const bool aIsTotalItem,
                                       nsAString& aErrorMsg)
 {
   nsresult rv;
-  // currencySystem must equal urn:iso:std:iso:4217
-  if (!aAmount.mCurrencySystem.EqualsASCII("urn:iso:std:iso:4217")) {
-    aErrorMsg.AssignLiteral("The amount.currencySystem of \"");
-    aErrorMsg.Append(aItem);
-    aErrorMsg.AppendLiteral("\"(");
-    aErrorMsg.Append(aAmount.mCurrencySystem);
-    aErrorMsg.AppendLiteral(") must equal urn:iso:std:iso:4217.");
-    return NS_ERROR_RANGE_ERR;
-  }
   rv = IsValidCurrency(aItem, aAmount.mCurrency, aErrorMsg);
   if (NS_FAILED(rv)) {
     return rv;
   }
   if (aIsTotalItem) {
     rv = IsNonNegativeNumber(aItem, aAmount.mValue, aErrorMsg);
     if (NS_FAILED(rv)) {
       return rv;
--- a/dom/webidl/PaymentRequest.webidl
+++ b/dom/webidl/PaymentRequest.webidl
@@ -13,17 +13,16 @@
 dictionary PaymentMethodData {
   required DOMString           supportedMethods;
            object              data;
 };
 
 dictionary PaymentCurrencyAmount {
   required DOMString currency;
   required DOMString value;
-           DOMString currencySystem = "urn:iso:std:iso:4217";
 };
 
 enum PaymentItemType {
   "tax"
 };
 
 dictionary PaymentItem {
   required DOMString             label;