[Payment Request] Apple Pay sheet does not dismiss when calling complete() with resul...
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Feb 2018 00:03:13 +0000 (00:03 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Feb 2018 00:03:13 +0000 (00:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=182658
<rdar://problem/37293917>

Reviewed by Brady Eidson.

When PaymentResponse::complete() is called with a result of "unknown" or "fail", we should
treat this as a fatal error and dismiss the Apple Pay sheet. However, we were adding an
error with code "unknown" to the authorization result, which PassKit interprets as a
non-fatal error. Instead, we should not set any errors and just use a status code of
PaymentAuthorizationStatus::Failure, which PassKit interprets as a fatal error, dismissing
the sheet.

No test possible.

* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::complete):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228342 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp

index 254e56e..6734399 100644 (file)
@@ -1,3 +1,23 @@
+2018-02-09  Andy Estes  <aestes@apple.com>
+
+        [Payment Request] Apple Pay sheet does not dismiss when calling complete() with result "unknown" or "fail"
+        https://bugs.webkit.org/show_bug.cgi?id=182658
+        <rdar://problem/37293917>
+
+        Reviewed by Brady Eidson.
+
+        When PaymentResponse::complete() is called with a result of "unknown" or "fail", we should
+        treat this as a fatal error and dismiss the Apple Pay sheet. However, we were adding an
+        error with code "unknown" to the authorization result, which PassKit interprets as a
+        non-fatal error. Instead, we should not set any errors and just use a status code of
+        PaymentAuthorizationStatus::Failure, which PassKit interprets as a fatal error, dismissing
+        the sheet.
+
+        No test possible.
+
+        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
+        (WebCore::ApplePayPaymentHandler::complete):
+
 2018-02-09  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Pasting from Excel no longer provides text/html data
index c13b1e0..a6d0e5a 100644 (file)
@@ -409,7 +409,6 @@ void ApplePayPaymentHandler::complete(std::optional<PaymentComplete>&& result)
     case PaymentComplete::Fail:
     case PaymentComplete::Unknown:
         authorizationResult.status = PaymentAuthorizationStatus::Failure;
-        authorizationResult.errors.append({ PaymentError::Code::Unknown, { }, std::nullopt });
         break;
     case PaymentComplete::Success:
         authorizationResult.status = PaymentAuthorizationStatus::Success;