Title: [215588] trunk/Source/WebCore
Revision
215588
Author
[email protected]
Date
2017-04-20 16:49:34 -0700 (Thu, 20 Apr 2017)

Log Message

Remove one use of toPaymentAuthorizationStatus
https://bugs.webkit.org/show_bug.cgi?id=171086

Reviewed by Tim Horton.

Just switch on the individual ApplePaySession::STATUS_ values.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::completeShippingMethodSelection):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (215587 => 215588)


--- trunk/Source/WebCore/ChangeLog	2017-04-20 23:42:00 UTC (rev 215587)
+++ trunk/Source/WebCore/ChangeLog	2017-04-20 23:49:34 UTC (rev 215588)
@@ -1,3 +1,15 @@
+2017-04-20  Anders Carlsson  <[email protected]>
+
+        Remove one use of toPaymentAuthorizationStatus
+        https://bugs.webkit.org/show_bug.cgi?id=171086
+
+        Reviewed by Tim Horton.
+
+        Just switch on the individual ApplePaySession::STATUS_ values.
+
+        * Modules/applepay/ApplePaySession.cpp:
+        (WebCore::ApplePaySession::completeShippingMethodSelection):
+
 2017-04-20  Fujii Hironori  <[email protected]>
 
         [WinCairo] Fix build break after updating ANGLE

Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp (215587 => 215588)


--- trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-04-20 23:42:00 UTC (rev 215587)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2017-04-20 23:49:34 UTC (rev 215588)
@@ -799,15 +799,23 @@
 {
     ApplePayShippingMethodUpdate update;
 
-    auto authorizationStatus = toPaymentAuthorizationStatus(status);
-    if (!authorizationStatus)
-        return Exception { INVALID_ACCESS_ERR };
-
-    if (*authorizationStatus != PaymentAuthorizationStatus::Success) {
+    switch (status) {
+    case ApplePaySession::STATUS_SUCCESS:
+        break;
+    case ApplePaySession::STATUS_FAILURE:
+    case ApplePaySession::STATUS_INVALID_BILLING_POSTAL_ADDRESS:
+    case ApplePaySession::STATUS_INVALID_SHIPPING_POSTAL_ADDRESS:
+    case ApplePaySession::STATUS_INVALID_SHIPPING_CONTACT:
+    case ApplePaySession::STATUS_PIN_REQUIRED:
+    case ApplePaySession::STATUS_PIN_INCORRECT:
+    case ApplePaySession::STATUS_PIN_LOCKOUT:
         // This is a fatal error. Cancel the request.
         m_state = State::CancelRequested;
         paymentCoordinator().cancelPaymentSession();
         return { };
+
+    default:
+        return Exception { INVALID_ACCESS_ERR };
     }
 
     update.newTotal = WTFMove(newTotal);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to