<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[202432] trunk/Source/WebKit2</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/202432">202432</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2016-06-24 11:31:05 -0700 (Fri, 24 Jun 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Move WebKit2 Apple Pay code to the open source repository
https://bugs.webkit.org/show_bug.cgi?id=159041
Reviewed by Sam Weinig.
* DerivedSources.make:
* Shared/Cocoa/WebCoreArgumentCodersCocoa.h: Added.
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: Added.
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: Added.
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Added.
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in: Added.
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Added.
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Added.
* UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: Added.
* UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: Added.
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/ApplePay/WebPaymentCoordinator.cpp: Added.
* WebProcess/ApplePay/WebPaymentCoordinator.h: Added.
* WebProcess/ApplePay/WebPaymentCoordinator.messages.in: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2CMakeListstxt">trunk/Source/WebKit2/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2DerivedSourcesmake">trunk/Source/WebKit2/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2SharedCocoaWebCoreArgumentCodersCocoah">trunk/Source/WebKit2/Shared/Cocoa/WebCoreArgumentCodersCocoa.h</a></li>
<li><a href="#trunkSourceWebKit2SharedCocoaWebCoreArgumentCodersCocoamm">trunk/Source/WebKit2/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm</a></li>
<li>trunk/Source/WebKit2/UIProcess/ApplePay/</li>
<li><a href="#trunkSourceWebKit2UIProcessApplePayWebPaymentCoordinatorProxycpp">trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessApplePayWebPaymentCoordinatorProxyh">trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessApplePayWebPaymentCoordinatorProxymessagesin">trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in</a></li>
<li>trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/</li>
<li><a href="#trunkSourceWebKit2UIProcessApplePaycocoaWebPaymentCoordinatorProxyCocoah">trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessApplePaycocoaWebPaymentCoordinatorProxyCocoamm">trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm</a></li>
<li>trunk/Source/WebKit2/UIProcess/ApplePay/ios/</li>
<li><a href="#trunkSourceWebKit2UIProcessApplePayiosWebPaymentCoordinatorProxyIOSmm">trunk/Source/WebKit2/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm</a></li>
<li>trunk/Source/WebKit2/UIProcess/ApplePay/mac/</li>
<li><a href="#trunkSourceWebKit2UIProcessApplePaymacWebPaymentCoordinatorProxyMacmm">trunk/Source/WebKit2/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm</a></li>
<li>trunk/Source/WebKit2/WebProcess/ApplePay/</li>
<li><a href="#trunkSourceWebKit2WebProcessApplePayWebPaymentCoordinatorcpp">trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessApplePayWebPaymentCoordinatorh">trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessApplePayWebPaymentCoordinatormessagesin">trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.messages.in</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2SharedCocoaWebKitAdditionsmm">trunk/Source/WebKit2/Shared/Cocoa/WebKitAdditions.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2CMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/CMakeLists.txt (202431 => 202432)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/CMakeLists.txt        2016-06-24 18:21:05 UTC (rev 202431)
+++ trunk/Source/WebKit2/CMakeLists.txt        2016-06-24 18:31:05 UTC (rev 202432)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> "${WEBKIT2_DIR}/UIProcess/API"
</span><span class="cx"> "${WEBKIT2_DIR}/UIProcess/API/C"
</span><span class="cx"> "${WEBKIT2_DIR}/UIProcess/API/cpp"
</span><ins>+ "${WEBKIT2_DIR}/UIProcess/ApplePay"
</ins><span class="cx"> "${WEBKIT2_DIR}/UIProcess/Authentication"
</span><span class="cx"> "${WEBKIT2_DIR}/UIProcess/Automation"
</span><span class="cx"> "${WEBKIT2_DIR}/UIProcess/Databases"
</span><span class="lines">@@ -43,6 +44,7 @@
</span><span class="cx"> "${WEBKIT2_DIR}/UIProcess/UserContent"
</span><span class="cx"> "${WEBKIT2_DIR}/UIProcess/WebsiteData"
</span><span class="cx"> "${WEBKIT2_DIR}/WebProcess"
</span><ins>+ "${WEBKIT2_DIR}/WebProcess/ApplePay"
</ins><span class="cx"> "${WEBKIT2_DIR}/WebProcess/ApplicationCache"
</span><span class="cx"> "${WEBKIT2_DIR}/WebProcess/Automation"
</span><span class="cx"> "${WEBKIT2_DIR}/WebProcess/Battery"
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (202431 => 202432)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-06-24 18:21:05 UTC (rev 202431)
+++ trunk/Source/WebKit2/ChangeLog        2016-06-24 18:31:05 UTC (rev 202432)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2016-06-22 Anders Carlsson <andersca@apple.com>
+
+ Move WebKit2 Apple Pay code to the open source repository
+ https://bugs.webkit.org/show_bug.cgi?id=159041
+
+ Reviewed by Sam Weinig.
+
+ * DerivedSources.make:
+ * Shared/Cocoa/WebCoreArgumentCodersCocoa.h: Added.
+ * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: Added.
+ * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: Added.
+ * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Added.
+ * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in: Added.
+ * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Added.
+ * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Added.
+ * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: Added.
+ * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: Added.
+ * UIProcess/WebPageProxy.cpp:
+ * UIProcess/WebPageProxy.h:
+ * WebKit2.xcodeproj/project.pbxproj:
+ * WebProcess/ApplePay/WebPaymentCoordinator.cpp: Added.
+ * WebProcess/ApplePay/WebPaymentCoordinator.h: Added.
+ * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: Added.
+
</ins><span class="cx"> 2016-06-24 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> [WK2] PageConfiguration.m_relatedPage keeps WebPageProxy alive after its WebView has been destroyed
</span></span></pre></div>
<a id="trunkSourceWebKit2DerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DerivedSources.make (202431 => 202432)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DerivedSources.make        2016-06-24 18:21:05 UTC (rev 202431)
+++ trunk/Source/WebKit2/DerivedSources.make        2016-06-24 18:31:05 UTC (rev 202432)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> $(WebKit2)/Shared/API/Cocoa \
</span><span class="cx"> $(WebKit2)/Shared/Authentication \
</span><span class="cx"> $(WebKit2)/Shared/mac \
</span><ins>+ $(WebKit2)/WebProcess/ApplePay \
</ins><span class="cx"> $(WebKit2)/WebProcess/ApplicationCache \
</span><span class="cx"> $(WebKit2)/WebProcess/Automation \
</span><span class="cx"> $(WebKit2)/WebProcess/Cookies \
</span><span class="lines">@@ -57,6 +58,7 @@
</span><span class="cx"> $(WebKit2)/WebProcess/ios \
</span><span class="cx"> $(WebKit2)/WebProcess \
</span><span class="cx"> $(WebKit2)/UIProcess \
</span><ins>+ $(WebKit2)/UIProcess/ApplePay \
</ins><span class="cx"> $(WebKit2)/UIProcess/Automation \
</span><span class="cx"> $(WebKit2)/UIProcess/Cocoa \
</span><span class="cx"> $(WebKit2)/UIProcess/Databases \
</span><span class="lines">@@ -138,6 +140,8 @@
</span><span class="cx"> WebPage \
</span><span class="cx"> WebPageProxy \
</span><span class="cx"> WebPasteboardProxy \
</span><ins>+ WebPaymentCoordinator \
+ WebPaymentCoordinatorProxy \
</ins><span class="cx"> WebPlaybackSessionManager \
</span><span class="cx"> WebPlaybackSessionManagerProxy \
</span><span class="cx"> WebProcess \
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedCocoaWebCoreArgumentCodersCocoah"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Shared/Cocoa/WebCoreArgumentCodersCocoa.h (0 => 202432)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/Cocoa/WebCoreArgumentCodersCocoa.h         (rev 0)
+++ trunk/Source/WebKit2/Shared/Cocoa/WebCoreArgumentCodersCocoa.h        2016-06-24 18:31:05 UTC (rev 202432)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(APPLE_PAY)
+
+#include <WebCore/PaymentHeaders.h>
+
+namespace IPC {
+
+template<> struct ArgumentCoder<WebCore::Payment> {
+ static void encode(ArgumentEncoder&, const WebCore::Payment&);
+ static bool decode(ArgumentDecoder&, WebCore::Payment&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentContact> {
+ static void encode(ArgumentEncoder&, const WebCore::PaymentContact&);
+ static bool decode(ArgumentDecoder&, WebCore::PaymentContact&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentMerchantSession> {
+ static void encode(ArgumentEncoder&, const WebCore::PaymentMerchantSession&);
+ static bool decode(ArgumentDecoder&, WebCore::PaymentMerchantSession&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentMethod> {
+ static void encode(ArgumentEncoder&, const WebCore::PaymentMethod&);
+ static bool decode(ArgumentDecoder&, WebCore::PaymentMethod&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentRequest> {
+ static void encode(ArgumentEncoder&, const WebCore::PaymentRequest&);
+ static bool decode(ArgumentDecoder&, WebCore::PaymentRequest&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentRequest::AddressFields> {
+ static void encode(ArgumentEncoder&, const WebCore::PaymentRequest::AddressFields&);
+ static bool decode(ArgumentDecoder&, WebCore::PaymentRequest::AddressFields&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentRequest::LineItem> {
+ static void encode(ArgumentEncoder&, const WebCore::PaymentRequest::LineItem&);
+ static bool decode(ArgumentDecoder&, WebCore::PaymentRequest::LineItem&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentRequest::MerchantCapabilities> {
+ static void encode(ArgumentEncoder&, const WebCore::PaymentRequest::MerchantCapabilities&);
+ static bool decode(ArgumentDecoder&, WebCore::PaymentRequest::MerchantCapabilities&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentRequest::ShippingMethod> {
+ static void encode(ArgumentEncoder&, const WebCore::PaymentRequest::ShippingMethod&);
+ static bool decode(ArgumentDecoder&, WebCore::PaymentRequest::ShippingMethod&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentRequest::SupportedNetworks> {
+ static void encode(ArgumentEncoder&, const WebCore::PaymentRequest::SupportedNetworks&);
+ static bool decode(ArgumentDecoder&, WebCore::PaymentRequest::SupportedNetworks&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentRequest::TotalAndLineItems> {
+ static void encode(ArgumentEncoder&, const WebCore::PaymentRequest::TotalAndLineItems&);
+ static bool decode(ArgumentDecoder&, WebCore::PaymentRequest::TotalAndLineItems&);
+};
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharedCocoaWebCoreArgumentCodersCocoamm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm (0 => 202432)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm         (rev 0)
+++ trunk/Source/WebKit2/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm        2016-06-24 18:31:05 UTC (rev 202432)
</span><span class="lines">@@ -0,0 +1,398 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "WebCoreArgumentCoders.h"
+
+#if ENABLE(APPLE_PAY)
+
+#import "DataReference.h"
+#import <PassKit/PassKit.h>
+#import <WebCore/SoftLinking.h>
+
+#if PLATFORM(MAC)
+SOFT_LINK_PRIVATE_FRAMEWORK(PassKit)
+#else
+SOFT_LINK_FRAMEWORK(PassKit)
+#endif
+
+SOFT_LINK_CLASS(PassKit, PKContact);
+SOFT_LINK_CLASS(PassKit, PKPayment);
+SOFT_LINK_CLASS(PassKit, PKPaymentMethod);
+
+using namespace WebCore;
+
+namespace IPC {
+
+void ArgumentCoder<WebCore::Payment>::encode(ArgumentEncoder& encoder, const WebCore::Payment& payment)
+{
+ auto data = adoptNS([[NSMutableData alloc] init]);
+ auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
+
+ [archiver setRequiresSecureCoding:YES];
+
+ [archiver encodeObject:payment.pkPayment() forKey:NSKeyedArchiveRootObjectKey];
+ [archiver finishEncoding];
+
+ encoder << DataReference(static_cast<const uint8_t*>([data bytes]), [data length]);
+}
+
+bool ArgumentCoder<WebCore::Payment>::decode(ArgumentDecoder& decoder, WebCore::Payment& payment)
+{
+ IPC::DataReference dataReference;
+ if (!decoder.decode(dataReference))
+ return false;
+
+ auto data = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(dataReference.data())) length:dataReference.size() freeWhenDone:NO]);
+ auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:data.get()]);
+ [unarchiver setRequiresSecureCoding:YES];
+ @try {
+ PKPayment *pkPayment = [unarchiver decodeObjectOfClass:getPKPaymentClass() forKey:NSKeyedArchiveRootObjectKey];
+ payment = Payment(pkPayment);
+ } @catch (NSException *exception) {
+ LOG_ERROR("Failed to decode PKPayment: %@", exception);
+ return false;
+ }
+
+ [unarchiver finishDecoding];
+ return true;
+}
+
+void ArgumentCoder<WebCore::PaymentContact>::encode(ArgumentEncoder& encoder, const WebCore::PaymentContact& paymentContact)
+{
+ auto data = adoptNS([[NSMutableData alloc] init]);
+ auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
+
+ [archiver setRequiresSecureCoding:YES];
+
+ [archiver encodeObject:paymentContact.pkContact() forKey:NSKeyedArchiveRootObjectKey];
+ [archiver finishEncoding];
+
+ encoder << DataReference(static_cast<const uint8_t*>([data bytes]), [data length]);
+}
+
+bool ArgumentCoder<WebCore::PaymentContact>::decode(ArgumentDecoder& decoder, WebCore::PaymentContact& paymentContact)
+{
+ IPC::DataReference dataReference;
+ if (!decoder.decode(dataReference))
+ return false;
+
+ auto data = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(dataReference.data())) length:dataReference.size() freeWhenDone:NO]);
+ auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:data.get()]);
+ [unarchiver setRequiresSecureCoding:YES];
+ @try {
+ PKContact *pkContact = [unarchiver decodeObjectOfClass:getPKContactClass() forKey:NSKeyedArchiveRootObjectKey];
+ paymentContact = PaymentContact(pkContact);
+ } @catch (NSException *exception) {
+ LOG_ERROR("Failed to decode PKContact: %@", exception);
+ return false;
+ }
+
+ [unarchiver finishDecoding];
+ return true;
+}
+
+void ArgumentCoder<WebCore::PaymentMerchantSession>::encode(ArgumentEncoder& encoder, const WebCore::PaymentMerchantSession& paymentMerchantSession)
+{
+ encoder << paymentMerchantSession.merchantIdentifier;
+ encoder << paymentMerchantSession.sessionIdentifier;
+ encoder << paymentMerchantSession.nonce;
+ encoder << paymentMerchantSession.domainName;
+ encoder << paymentMerchantSession.epochTimestamp;
+ encoder << paymentMerchantSession.signature;
+}
+
+bool ArgumentCoder<WebCore::PaymentMerchantSession>::decode(ArgumentDecoder& decoder, WebCore::PaymentMerchantSession& paymentMerchantSession)
+{
+ if (!decoder.decode(paymentMerchantSession.merchantIdentifier))
+ return false;
+ if (!decoder.decode(paymentMerchantSession.sessionIdentifier))
+ return false;
+ if (!decoder.decode(paymentMerchantSession.nonce))
+ return false;
+ if (!decoder.decode(paymentMerchantSession.domainName))
+ return false;
+ if (!decoder.decode(paymentMerchantSession.epochTimestamp))
+ return false;
+ if (!decoder.decode(paymentMerchantSession.signature))
+ return false;
+
+ return true;
+}
+
+void ArgumentCoder<WebCore::PaymentMethod>::encode(ArgumentEncoder& encoder, const WebCore::PaymentMethod& paymentMethod)
+{
+ auto data = adoptNS([[NSMutableData alloc] init]);
+ auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
+
+ [archiver setRequiresSecureCoding:YES];
+
+ [archiver encodeObject:paymentMethod.pkPaymentMethod() forKey:NSKeyedArchiveRootObjectKey];
+ [archiver finishEncoding];
+
+ encoder << DataReference(static_cast<const uint8_t*>([data bytes]), [data length]);
+}
+
+bool ArgumentCoder<WebCore::PaymentMethod>::decode(ArgumentDecoder& decoder, WebCore::PaymentMethod& paymentMethod)
+{
+ IPC::DataReference dataReference;
+ if (!decoder.decode(dataReference))
+ return false;
+
+ auto data = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(dataReference.data())) length:dataReference.size() freeWhenDone:NO]);
+ auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:data.get()]);
+ [unarchiver setRequiresSecureCoding:YES];
+ @try {
+ PKPaymentMethod *pkPaymentMethod = [unarchiver decodeObjectOfClass:getPKPaymentMethodClass() forKey:NSKeyedArchiveRootObjectKey];
+ paymentMethod = PaymentMethod(pkPaymentMethod);
+ } @catch (NSException *exception) {
+ LOG_ERROR("Failed to decode PKPayment: %@", exception);
+ return false;
+ }
+
+ [unarchiver finishDecoding];
+ return true;
+}
+
+void ArgumentCoder<PaymentRequest>::encode(ArgumentEncoder& encoder, const PaymentRequest& request)
+{
+ encoder << request.countryCode();
+ encoder << request.currencyCode();
+ encoder << request.requiredBillingAddressFields();
+ encoder << request.billingContact();
+ encoder << request.requiredShippingAddressFields();
+ encoder << request.shippingContact();
+ encoder << request.merchantCapabilities();
+ encoder << request.supportedNetworks();
+ encoder.encodeEnum(request.shippingType());
+ encoder << request.shippingMethods();
+ encoder << request.lineItems();
+ encoder << request.total();
+ encoder << request.applicationData();
+}
+
+bool ArgumentCoder<PaymentRequest>::decode(ArgumentDecoder& decoder, PaymentRequest& request)
+{
+ String countryCode;
+ if (!decoder.decode(countryCode))
+ return false;
+ request.setCountryCode(countryCode);
+
+ String currencyCode;
+ if (!decoder.decode(currencyCode))
+ return false;
+ request.setCurrencyCode(currencyCode);
+
+ PaymentRequest::AddressFields requiredBillingAddressFields;
+ if (!decoder.decode((requiredBillingAddressFields)))
+ return false;
+ request.setRequiredBillingAddressFields(requiredBillingAddressFields);
+
+ PaymentContact billingContact;
+ if (!decoder.decode(billingContact))
+ return false;
+ request.setBillingContact(billingContact);
+
+ PaymentRequest::AddressFields requiredShippingAddressFields;
+ if (!decoder.decode((requiredShippingAddressFields)))
+ return false;
+ request.setRequiredShippingAddressFields(requiredShippingAddressFields);
+
+ PaymentContact shippingContact;
+ if (!decoder.decode(shippingContact))
+ return false;
+ request.setShippingContact(shippingContact);
+
+ PaymentRequest::MerchantCapabilities merchantCapabilities;
+ if (!decoder.decode(merchantCapabilities))
+ return false;
+ request.setMerchantCapabilities(merchantCapabilities);
+
+ PaymentRequest::SupportedNetworks supportedNetworks;
+ if (!decoder.decode(supportedNetworks))
+ return false;
+ request.setSupportedNetworks(supportedNetworks);
+
+ PaymentRequest::ShippingType shippingType;
+ if (!decoder.decodeEnum(shippingType))
+ return false;
+ request.setShippingType(shippingType);
+
+ Vector<PaymentRequest::ShippingMethod> shippingMethods;
+ if (!decoder.decode(shippingMethods))
+ return false;
+ request.setShippingMethods(shippingMethods);
+
+ Vector<PaymentRequest::LineItem> lineItems;
+ if (!decoder.decode(lineItems))
+ return false;
+ request.setLineItems(lineItems);
+
+ PaymentRequest::LineItem total;
+ if (!decoder.decode(total))
+ return false;
+ request.setTotal(total);
+
+ String applicationData;
+ if (!decoder.decode(applicationData))
+ return false;
+ request.setApplicationData(applicationData);
+
+ return true;
+}
+
+void ArgumentCoder<PaymentRequest::AddressFields>::encode(ArgumentEncoder& encoder, const PaymentRequest::AddressFields& addressFields)
+{
+ encoder << addressFields.postalAddress;
+ encoder << addressFields.phone;
+ encoder << addressFields.email;
+ encoder << addressFields.name;
+}
+
+bool ArgumentCoder<PaymentRequest::AddressFields>::decode(ArgumentDecoder& decoder, PaymentRequest::AddressFields& addressFields)
+{
+ if (!decoder.decode(addressFields.postalAddress))
+ return false;
+ if (!decoder.decode(addressFields.phone))
+ return false;
+ if (!decoder.decode(addressFields.email))
+ return false;
+ if (!decoder.decode(addressFields.name))
+ return false;
+
+ return true;
+}
+
+void ArgumentCoder<PaymentRequest::LineItem>::encode(ArgumentEncoder& encoder, const PaymentRequest::LineItem& lineItem)
+{
+ encoder.encodeEnum(lineItem.type);
+ encoder << lineItem.label;
+ encoder << lineItem.amount;
+}
+
+bool ArgumentCoder<PaymentRequest::LineItem>::decode(ArgumentDecoder& decoder, PaymentRequest::LineItem& lineItem)
+{
+ if (!decoder.decodeEnum(lineItem.type))
+ return false;
+ if (!decoder.decode(lineItem.label))
+ return false;
+ if (!decoder.decode(lineItem.amount))
+ return false;
+
+ return true;
+}
+
+void ArgumentCoder<PaymentRequest::MerchantCapabilities>::encode(ArgumentEncoder& encoder, const PaymentRequest::MerchantCapabilities& merchantCapabilities)
+{
+ encoder << merchantCapabilities.supports3DS;
+ encoder << merchantCapabilities.supportsEMV;
+ encoder << merchantCapabilities.supportsCredit;
+ encoder << merchantCapabilities.supportsDebit;
+}
+
+bool ArgumentCoder<PaymentRequest::MerchantCapabilities>::decode(ArgumentDecoder& decoder, PaymentRequest::MerchantCapabilities& merchantCapabilities)
+{
+ if (!decoder.decode(merchantCapabilities.supports3DS))
+ return false;
+ if (!decoder.decode(merchantCapabilities.supportsEMV))
+ return false;
+ if (!decoder.decode(merchantCapabilities.supportsCredit))
+ return false;
+ if (!decoder.decode(merchantCapabilities.supportsDebit))
+ return false;
+
+ return true;
+}
+
+void ArgumentCoder<PaymentRequest::SupportedNetworks>::encode(ArgumentEncoder& encoder, const PaymentRequest::SupportedNetworks& supportedNetworks)
+{
+ encoder << supportedNetworks.amex;
+ encoder << supportedNetworks.chinaUnionPay;
+ encoder << supportedNetworks.discover;
+ encoder << supportedNetworks.interac;
+ encoder << supportedNetworks.masterCard;
+ encoder << supportedNetworks.privateLabel;
+ encoder << supportedNetworks.visa;
+}
+
+bool ArgumentCoder<PaymentRequest::SupportedNetworks>::decode(ArgumentDecoder& decoder, PaymentRequest::SupportedNetworks& supportedNetworks)
+{
+ if (!decoder.decode(supportedNetworks.amex))
+ return false;
+ if (!decoder.decode(supportedNetworks.chinaUnionPay))
+ return false;
+ if (!decoder.decode(supportedNetworks.discover))
+ return false;
+ if (!decoder.decode(supportedNetworks.interac))
+ return false;
+ if (!decoder.decode(supportedNetworks.masterCard))
+ return false;
+ if (!decoder.decode(supportedNetworks.privateLabel))
+ return false;
+ if (!decoder.decode(supportedNetworks.visa))
+ return false;
+
+ return true;
+}
+
+void ArgumentCoder<PaymentRequest::ShippingMethod>::encode(ArgumentEncoder& encoder, const PaymentRequest::ShippingMethod& shippingMethod)
+{
+ encoder << shippingMethod.label;
+ encoder << shippingMethod.detail;
+ encoder << shippingMethod.amount;
+ encoder << shippingMethod.identifier;
+}
+
+bool ArgumentCoder<PaymentRequest::ShippingMethod>::decode(ArgumentDecoder& decoder, PaymentRequest::ShippingMethod& shippingMethod)
+{
+ if (!decoder.decode(shippingMethod.label))
+ return false;
+ if (!decoder.decode(shippingMethod.detail))
+ return false;
+ if (!decoder.decode(shippingMethod.amount))
+ return false;
+ if (!decoder.decode(shippingMethod.identifier))
+ return false;
+ return true;
+}
+
+void ArgumentCoder<PaymentRequest::TotalAndLineItems>::encode(ArgumentEncoder& encoder, const PaymentRequest::TotalAndLineItems& totalAndLineItems)
+{
+ encoder << totalAndLineItems.total;
+ encoder << totalAndLineItems.lineItems;
+}
+
+bool ArgumentCoder<PaymentRequest::TotalAndLineItems>::decode(ArgumentDecoder& decoder, PaymentRequest::TotalAndLineItems& totalAndLineItems)
+{
+ if (!decoder.decode(totalAndLineItems.total))
+ return false;
+ if (!decoder.decode(totalAndLineItems.lineItems))
+ return false;
+ return true;
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharedCocoaWebKitAdditionsmm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/Shared/Cocoa/WebKitAdditions.mm (202431 => 202432)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/Cocoa/WebKitAdditions.mm        2016-06-24 18:21:05 UTC (rev 202431)
+++ trunk/Source/WebKit2/Shared/Cocoa/WebKitAdditions.mm        2016-06-24 18:31:05 UTC (rev 202432)
</span><span class="lines">@@ -1,30 +0,0 @@
</span><del>-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-
-#if USE(APPLE_INTERNAL_SDK)
-#import <WebKitAdditions/WebKitAdditions.mm>
-#endif
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessApplePayWebPaymentCoordinatorProxycpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp (0 => 202432)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp        2016-06-24 18:31:05 UTC (rev 202432)
</span><span class="lines">@@ -0,0 +1,322 @@
</span><ins>+/*
+ * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebPaymentCoordinatorProxy.h"
+
+#if ENABLE(APPLE_PAY)
+
+#include "WebPageProxy.h"
+#include "WebPaymentCoordinatorMessages.h"
+#include "WebPaymentCoordinatorProxyMessages.h"
+#include "WebProcessProxy.h"
+#include <WebCore/PaymentAuthorizationStatus.h>
+
+namespace WebKit {
+
+WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy(WebPageProxy& webPageProxy)
+ : m_webPageProxy(webPageProxy)
+ , m_weakPtrFactory(this)
+ , m_state(State::Idle)
+ , m_merchantValidationState(MerchantValidationState::Idle)
+{
+ m_webPageProxy.process().addMessageReceiver(Messages::WebPaymentCoordinatorProxy::messageReceiverName(), m_webPageProxy.pageID(), *this);
+}
+
+WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy()
+{
+ if (m_state != State::Idle)
+ hidePaymentUI();
+
+ m_webPageProxy.process().removeMessageReceiver(Messages::WebPaymentCoordinatorProxy::messageReceiverName(), m_webPageProxy.pageID());
+}
+
+void WebPaymentCoordinatorProxy::canMakePayments(bool& reply)
+{
+ reply = platformCanMakePayments();
+}
+
+void WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, uint64_t requestID)
+{
+ auto weakThis = m_weakPtrFactory.createWeakPtr();
+ platformCanMakePaymentsWithActiveCard(merchantIdentifier, domainName, [weakThis, requestID](bool canMakePayments) {
+ auto paymentCoordinatorProxy = weakThis.get();
+ if (!paymentCoordinatorProxy)
+ return;
+
+ paymentCoordinatorProxy->m_webPageProxy.send(Messages::WebPaymentCoordinator::CanMakePaymentsWithActiveCardReply(requestID, canMakePayments));
+ });
+}
+
+void WebPaymentCoordinatorProxy::showPaymentUI(const String& originatingURLString, const Vector<String>& linkIconURLStrings, const WebCore::PaymentRequest& paymentRequest)
+{
+ // FIXME: Make this a message check.
+ ASSERT(canBegin());
+
+ m_state = State::Activating;
+
+ WebCore::URL originatingURL(WebCore::URL(), originatingURLString);
+
+ Vector<WebCore::URL> linkIconURLs;
+ for (const auto& linkIconURLString : linkIconURLStrings)
+ linkIconURLs.append(WebCore::URL(WebCore::URL(), linkIconURLString));
+
+ platformShowPaymentUI(originatingURL, linkIconURLs, paymentRequest, [this](bool result) {
+ ASSERT(m_state == State::Activating);
+ if (!result) {
+ didCancelPayment();
+ return;
+ }
+
+ m_state = State::Active;
+ });
+}
+
+static bool isValidEnum(WebCore::PaymentAuthorizationStatus status)
+{
+ switch (status) {
+ case WebCore::PaymentAuthorizationStatus::Success:
+ case WebCore::PaymentAuthorizationStatus::Failure:
+ case WebCore::PaymentAuthorizationStatus::InvalidBillingPostalAddress:
+ case WebCore::PaymentAuthorizationStatus::InvalidShippingPostalAddress:
+ case WebCore::PaymentAuthorizationStatus::InvalidShippingContact:
+ case WebCore::PaymentAuthorizationStatus::PINRequired:
+ case WebCore::PaymentAuthorizationStatus::PINIncorrect:
+ case WebCore::PaymentAuthorizationStatus::PINLockout:
+ return true;
+ }
+
+ return false;
+}
+
+void WebPaymentCoordinatorProxy::completeMerchantValidation(const WebCore::PaymentMerchantSession& paymentMerchantSession)
+{
+ // It's possible that the payment has been canceled already.
+ if (m_state == State::Idle)
+ return;
+
+ // FIXME: This should be a MESSAGE_CHECK.
+ ASSERT(m_merchantValidationState == MerchantValidationState::Validating);
+
+ platformCompleteMerchantValidation(paymentMerchantSession);
+ m_merchantValidationState = MerchantValidationState::ValidationComplete;
+}
+
+void WebPaymentCoordinatorProxy::completeShippingMethodSelection(uint32_t opaqueStatus, const Optional<WebCore::PaymentRequest::TotalAndLineItems>& newTotalAndLineItems)
+{
+ // It's possible that the payment has been canceled already.
+ if (m_state == State::Idle)
+ return;
+
+ // FIXME: This should be a MESSAGE_CHECK.
+ ASSERT(m_state == State::ShippingMethodSelected);
+
+ auto status = static_cast<WebCore::PaymentAuthorizationStatus>(opaqueStatus);
+
+ // FIXME: Make this a message check.
+ RELEASE_ASSERT(isValidEnum(status));
+
+ platformCompleteShippingMethodSelection(status, newTotalAndLineItems);
+ m_state = State::Active;
+}
+
+void WebPaymentCoordinatorProxy::completeShippingContactSelection(uint32_t opaqueStatus, const Vector<WebCore::PaymentRequest::ShippingMethod>& newShippingMethods, const Optional<WebCore::PaymentRequest::TotalAndLineItems>& newTotalAndLineItems)
+{
+ // It's possible that the payment has been canceled already.
+ if (m_state == State::Idle)
+ return;
+
+ // FIXME: This should be a MESSAGE_CHECK.
+ ASSERT(m_state == State::ShippingContactSelected);
+
+ auto status = static_cast<WebCore::PaymentAuthorizationStatus>(opaqueStatus);
+
+ // FIXME: Make this a message check.
+ RELEASE_ASSERT(isValidEnum(status));
+
+ platformCompleteShippingContactSelection(status, newShippingMethods, newTotalAndLineItems);
+ m_state = State::Active;
+}
+
+void WebPaymentCoordinatorProxy::completePaymentMethodSelection(const Optional<WebCore::PaymentRequest::TotalAndLineItems>& newTotalAndLineItems)
+{
+ // It's possible that the payment has been canceled already.
+ if (m_state == State::Idle)
+ return;
+
+ // FIXME: This should be a MESSAGE_CHECK.
+ ASSERT(m_state == State::PaymentMethodSelected);
+
+ platformCompletePaymentMethodSelection(newTotalAndLineItems);
+ m_state = State::Active;
+}
+
+void WebPaymentCoordinatorProxy::completePaymentSession(uint32_t opaqueStatus)
+{
+ // It's possible that the payment has been canceled already.
+ if (!canCompletePayment())
+ return;
+
+ auto status = static_cast<WebCore::PaymentAuthorizationStatus>(opaqueStatus);
+
+ // FIXME: Make this a message check.
+ RELEASE_ASSERT(isValidEnum(status));
+
+ platformCompletePaymentSession(status);
+
+ didReachFinalState();
+}
+
+void WebPaymentCoordinatorProxy::abortPaymentSession()
+{
+ // It's possible that the payment has been canceled already.
+ if (!canAbort())
+ return;
+
+ hidePaymentUI();
+
+ didReachFinalState();
+}
+
+void WebPaymentCoordinatorProxy::didCancelPayment()
+{
+ ASSERT(canCancel());
+
+ m_webPageProxy.send(Messages::WebPaymentCoordinator::DidCancelPayment());
+
+ didReachFinalState();
+}
+
+void WebPaymentCoordinatorProxy::validateMerchant(const WebCore::URL& url)
+{
+ ASSERT(m_merchantValidationState == MerchantValidationState::Idle);
+
+ m_merchantValidationState = MerchantValidationState::Validating;
+ m_webPageProxy.send(Messages::WebPaymentCoordinator::ValidateMerchant(url.string()));
+}
+
+void WebPaymentCoordinatorProxy::didAuthorizePayment(const WebCore::Payment& payment)
+{
+ m_state = State::Authorized;
+ m_webPageProxy.send(Messages::WebPaymentCoordinator::DidAuthorizePayment(payment));
+}
+
+void WebPaymentCoordinatorProxy::didSelectShippingMethod(const WebCore::PaymentRequest::ShippingMethod& shippingMethod)
+{
+ ASSERT(m_state == State::Active);
+
+ m_state = State::ShippingMethodSelected;
+ m_webPageProxy.send(Messages::WebPaymentCoordinator::DidSelectShippingMethod(shippingMethod));
+}
+
+void WebPaymentCoordinatorProxy::didSelectShippingContact(const WebCore::PaymentContact& shippingContact)
+{
+ ASSERT(m_state == State::Active);
+
+ m_state = State::ShippingContactSelected;
+ m_webPageProxy.send(Messages::WebPaymentCoordinator::DidSelectShippingContact(shippingContact));
+}
+
+void WebPaymentCoordinatorProxy::didSelectPaymentMethod(const WebCore::PaymentMethod& paymentMethod)
+{
+ ASSERT(m_state == State::Active);
+
+ m_state = State::PaymentMethodSelected;
+ m_webPageProxy.send(Messages::WebPaymentCoordinator::DidSelectPaymentMethod(paymentMethod));
+}
+
+bool WebPaymentCoordinatorProxy::canBegin() const
+{
+ switch (m_state) {
+ case State::Idle:
+ return true;
+
+ case State::Activating:
+ case State::Active:
+ case State::Authorized:
+ case State::ShippingMethodSelected:
+ case State::ShippingContactSelected:
+ case State::PaymentMethodSelected:
+ return false;
+ }
+}
+
+bool WebPaymentCoordinatorProxy::canCancel() const
+{
+ switch (m_state) {
+ case State::Activating:
+ case State::Active:
+ case State::Authorized:
+ case State::ShippingMethodSelected:
+ case State::ShippingContactSelected:
+ case State::PaymentMethodSelected:
+ return true;
+
+ case State::Idle:
+ return false;
+ }
+}
+
+bool WebPaymentCoordinatorProxy::canCompletePayment() const
+{
+ switch (m_state) {
+ case State::Authorized:
+ return true;
+
+ case State::Idle:
+ case State::Activating:
+ case State::Active:
+ case State::ShippingMethodSelected:
+ case State::ShippingContactSelected:
+ case State::PaymentMethodSelected:
+ return false;
+ }
+}
+
+bool WebPaymentCoordinatorProxy::canAbort() const
+{
+ switch (m_state) {
+ case State::Activating:
+ case State::Active:
+ case State::Authorized:
+ case State::ShippingMethodSelected:
+ case State::ShippingContactSelected:
+ case State::PaymentMethodSelected:
+ return true;
+
+ case State::Idle:
+ return false;
+ }
+}
+
+void WebPaymentCoordinatorProxy::didReachFinalState()
+{
+ m_state = State::Idle;
+ m_merchantValidationState = MerchantValidationState::Idle;
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessApplePayWebPaymentCoordinatorProxyh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h (0 => 202432)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h        2016-06-24 18:31:05 UTC (rev 202432)
</span><span class="lines">@@ -0,0 +1,151 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(APPLE_PAY)
+
+#include "MessageReceiver.h"
+#include <WebCore/PaymentHeaders.h>
+#include <wtf/Forward.h>
+#include <wtf/RetainPtr.h>
+#include <wtf/WeakPtr.h>
+
+namespace IPC {
+class DataReference;
+}
+
+namespace WebCore {
+enum class PaymentAuthorizationStatus;
+class Payment;
+class PaymentContact;
+class PaymentMethod;
+class URL;
+struct PaymentMerchantSession;
+}
+
+OBJC_CLASS NSWindow;
+OBJC_CLASS PKPaymentAuthorizationViewController;
+OBJC_CLASS WKPaymentAuthorizationViewControllerDelegate;
+
+namespace WebKit {
+
+class WebPageProxy;
+
+class WebPaymentCoordinatorProxy : private IPC::MessageReceiver {
+public:
+ explicit WebPaymentCoordinatorProxy(WebPageProxy&);
+ ~WebPaymentCoordinatorProxy();
+
+ void didCancelPayment();
+ void validateMerchant(const WebCore::URL&);
+ void didAuthorizePayment(const WebCore::Payment&);
+ void didSelectShippingMethod(const WebCore::PaymentRequest::ShippingMethod&);
+ void didSelectShippingContact(const WebCore::PaymentContact&);
+ void didSelectPaymentMethod(const WebCore::PaymentMethod&);
+
+ void hidePaymentUI();
+
+private:
+ // IPC::MessageReceiver.
+ void didReceiveMessage(IPC::Connection&, IPC::MessageDecoder&) override;
+ void didReceiveSyncMessage(IPC::Connection&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override;
+
+ // Message handlers.
+ void canMakePayments(bool& reply);
+ void canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, uint64_t requestID);
+ void showPaymentUI(const String& originatingURLString, const Vector<String>& linkIconURLStrings, const WebCore::PaymentRequest&);
+ void completeMerchantValidation(const WebCore::PaymentMerchantSession&);
+ void completeShippingMethodSelection(uint32_t opaqueStatus, const Optional<WebCore::PaymentRequest::TotalAndLineItems>&);
+ void completeShippingContactSelection(uint32_t opaqueStatus, const Vector<WebCore::PaymentRequest::ShippingMethod>& newShippingMethods, const Optional<WebCore::PaymentRequest::TotalAndLineItems>&);
+ void completePaymentMethodSelection(const Optional<WebCore::PaymentRequest::TotalAndLineItems>&);
+ void completePaymentSession(uint32_t opaqueStatus);
+ void abortPaymentSession();
+
+ bool canBegin() const;
+ bool canCancel() const;
+ bool canCompletePayment() const;
+ bool canAbort() const;
+
+ void didReachFinalState();
+
+ bool platformCanMakePayments();
+ void platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, std::function<void (bool)> completionHandler);
+ void platformShowPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::PaymentRequest&, std::function<void (bool)> completionHandler);
+ void platformCompleteMerchantValidation(const WebCore::PaymentMerchantSession&);
+ void platformCompleteShippingMethodSelection(WebCore::PaymentAuthorizationStatus, const Optional<WebCore::PaymentRequest::TotalAndLineItems>&);
+ void platformCompleteShippingContactSelection(WebCore::PaymentAuthorizationStatus, const Vector<WebCore::PaymentRequest::ShippingMethod>& newShippingMethods, const Optional<WebCore::PaymentRequest::TotalAndLineItems>&);
+ void platformCompletePaymentMethodSelection(const Optional<WebCore::PaymentRequest::TotalAndLineItems>&);
+ void platformCompletePaymentSession(WebCore::PaymentAuthorizationStatus);
+
+ WebPageProxy& m_webPageProxy;
+ WeakPtrFactory<WebPaymentCoordinatorProxy> m_weakPtrFactory;
+
+ enum class State {
+ // Idle - Nothing's happening.
+ Idle,
+
+ // Activating - Waiting to show the payment UI.
+ Activating,
+
+ // Active - Showing payment UI.
+ Active,
+
+ // Authorized - Dispatching the authorized event and waiting for the paymentSessionCompleted message.
+ Authorized,
+
+ // ShippingMethodSelected - Dispatching the shippingmethodselected event and waiting for a reply.
+ ShippingMethodSelected,
+
+ // ShippingContactSelected - Dispatching the shippingcontactselected event and waiting for a reply.
+ ShippingContactSelected,
+
+ // PaymentMethodSelected - Dispatching the paymentmethodselected event and waiting for a reply.
+ PaymentMethodSelected,
+ } m_state;
+
+ enum class MerchantValidationState {
+ // Idle - Nothing's happening.
+ Idle,
+
+ // Validating - Dispatching the validatemerchant event and waiting for a reply.
+ Validating,
+
+ // ValidationComplete - A merchant session has been sent along to PassKit.
+ ValidationComplete
+ } m_merchantValidationState;
+
+ RetainPtr<PKPaymentAuthorizationViewController> m_paymentAuthorizationViewController;
+ RetainPtr<WKPaymentAuthorizationViewControllerDelegate> m_paymentAuthorizationViewControllerDelegate;
+
+#if PLATFORM(MAC)
+ uint64_t m_showPaymentUIRequestSeed { 0 };
+ RetainPtr<NSWindow> m_sheetWindow;
+#endif
+};
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessApplePayWebPaymentCoordinatorProxymessagesin"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in (0 => 202432)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in        2016-06-24 18:31:05 UTC (rev 202432)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+# Copyright (C) 2015 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+#/
+
+#if ENABLE(APPLE_PAY)
+
+messages -> WebPaymentCoordinatorProxy {
+
+ CanMakePayments() -> (bool result)
+ CanMakePaymentsWithActiveCard(String merchantIdentifier, String domainName, uint64_t requestID)
+
+ ShowPaymentUI(String originatingURLString, Vector<String> linkIconURLStrings, WebCore::PaymentRequest paymentRequest)
+ CompleteMerchantValidation(struct WebCore::PaymentMerchantSession paymentMerchantSession);
+ CompleteShippingMethodSelection(uint32_t opaqueStatus, Optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems)
+ CompleteShippingContactSelection(uint32_t opaqueStatus, Vector<WebCore::PaymentRequest::ShippingMethod> newShippingMethods, Optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems)
+ CompletePaymentMethodSelection(Optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems)
+ CompletePaymentSession(uint32_t opaqueStatus)
+ AbortPaymentSession()
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessApplePaycocoaWebPaymentCoordinatorProxyCocoah"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h (0 => 202432)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h        2016-06-24 18:31:05 UTC (rev 202432)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(APPLE_PAY)
+
+#import <PassKit/PKPaymentAuthorizationViewController.h>
+#import <PassKit/PKPaymentAuthorizationViewController_Private.h>
+#import <WebCore/PaymentHeaders.h>
+#import <wtf/BlockPtr.h>
+
+namespace WebCore {
+class URL;
+}
+
+namespace WebKit {
+class WebPaymentCoordinatorProxy;
+
+RetainPtr<PKPaymentRequest> toPKPaymentRequest(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::PaymentRequest&);
+
+}
+
+@interface WKPaymentAuthorizationViewControllerDelegate : NSObject <PKPaymentAuthorizationViewControllerDelegate, PKPaymentAuthorizationViewControllerPrivateDelegate> {
+@package
+ WebKit::WebPaymentCoordinatorProxy* _webPaymentCoordinatorProxy;
+ RetainPtr<NSArray> _paymentSummaryItems;
+ RetainPtr<NSArray> _shippingMethods;
+
+ BlockPtr<void (PKPaymentMerchantSession *, NSError *)> _sessionBlock;
+
+ BOOL _authorized;
+ BlockPtr<void (PKPaymentAuthorizationStatus)> _paymentAuthorizedCompletion;
+ BlockPtr<void (NSArray *)> _didSelectPaymentMethodCompletion;
+ BlockPtr<void (PKPaymentAuthorizationStatus, NSArray *)> _didSelectShippingMethodCompletion;
+ BlockPtr<void (PKPaymentAuthorizationStatus, NSArray *, NSArray *)> _didSelectShippingContactCompletion;
+}
+
+- (instancetype)initWithPaymentCoordinatorProxy:(WebKit::WebPaymentCoordinatorProxy&)webPaymentCoordinatorProxy;
+
+- (void)invalidate;
+
+@end
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessApplePaycocoaWebPaymentCoordinatorProxyCocoamm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm (0 => 202432)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm        2016-06-24 18:31:05 UTC (rev 202432)
</span><span class="lines">@@ -0,0 +1,515 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebPaymentCoordinatorProxyCocoa.h"
+
+#if ENABLE(APPLE_PAY)
+
+#import "WebPaymentCoordinatorProxy.h"
+#import <PassKit/PKPaymentAuthorizationViewController_Private.h>
+#import <PassKitCore/PKPaymentMerchantSession.h>
+#import <WebCore/PaymentAuthorizationStatus.h>
+#import <WebCore/PaymentHeaders.h>
+#import <WebCore/SoftLinking.h>
+#import <WebCore/URL.h>
+#import <wtf/RunLoop.h>
+
+#if PLATFORM(MAC)
+SOFT_LINK_PRIVATE_FRAMEWORK(PassKit)
+#else
+SOFT_LINK_FRAMEWORK(PassKit)
+#endif
+
+#if PLATFORM(MAC)
+// FIXME: Once <rdar://problem/26074851> has been fixed we no longer
+// have to fall back to PKInAppPaymentService.
+#import <PassKitCore/PKInAppPaymentService.h>
+SOFT_LINK_CLASS(PassKit, PKInAppPaymentService)
+#endif
+
+SOFT_LINK_CLASS(PassKit, PKPaymentAuthorizationViewController);
+SOFT_LINK_CLASS(PassKit, PKPaymentMerchantSession);
+SOFT_LINK_CLASS(PassKit, PKPaymentRequest);
+SOFT_LINK_CLASS(PassKit, PKPaymentSummaryItem);
+SOFT_LINK_CLASS(PassKit, PKShippingMethod);
+SOFT_LINK_CONSTANT(PassKit, PKPaymentNetworkAmex, NSString *);
+SOFT_LINK_CONSTANT(PassKit, PKPaymentNetworkChinaUnionPay, NSString *);
+SOFT_LINK_CONSTANT(PassKit, PKPaymentNetworkDiscover, NSString *);
+SOFT_LINK_CONSTANT(PassKit, PKPaymentNetworkInterac, NSString *);
+SOFT_LINK_CONSTANT(PassKit, PKPaymentNetworkMasterCard, NSString *);
+SOFT_LINK_CONSTANT(PassKit, PKPaymentNetworkPrivateLabel, NSString *);
+SOFT_LINK_CONSTANT(PassKit, PKPaymentNetworkVisa, NSString *);
+
+typedef void (^PKCanMakePaymentsCompletion)(BOOL isValid, NSError *error);
+extern "C" void PKCanMakePaymentsWithMerchantIdentifierAndDomain(NSString *identifier, NSString *domain, PKCanMakePaymentsCompletion completion);
+
+SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebKit, PassKit, PKCanMakePaymentsWithMerchantIdentifierAndDomain, void, (NSString *identifier, NSString *domain, PKCanMakePaymentsCompletion completion), (identifier, domain, completion));
+
+@implementation WKPaymentAuthorizationViewControllerDelegate
+
+- (instancetype)initWithPaymentCoordinatorProxy:(WebKit::WebPaymentCoordinatorProxy&)webPaymentCoordinatorProxy
+{
+ if (!(self = [super init]))
+ return nullptr;
+
+ _webPaymentCoordinatorProxy = &webPaymentCoordinatorProxy;
+
+ return self;
+}
+
+- (void)invalidate
+{
+ _webPaymentCoordinatorProxy = nullptr;
+ if (_paymentAuthorizedCompletion) {
+ _paymentAuthorizedCompletion(PKPaymentAuthorizationStatusFailure);
+ _paymentAuthorizedCompletion = nullptr;
+ }
+}
+
+- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller willFinishWithError:(NSError *)error
+{
+}
+
+- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller didRequestMerchantSession:(void(^)(PKPaymentMerchantSession *, NSError *))sessionBlock
+{
+ ASSERT(!_sessionBlock);
+ _sessionBlock = sessionBlock;
+
+ [getPKPaymentAuthorizationViewControllerClass() paymentServicesMerchantURL:^(NSURL *merchantURL, NSError *error) {
+ if (error)
+ LOG_ERROR("PKCanMakePaymentsWithMerchantIdentifierAndDomain error %@", error);
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ ASSERT(_sessionBlock);
+
+ if (!_webPaymentCoordinatorProxy) {
+ _sessionBlock(nullptr, nullptr);
+ return;
+ }
+
+ _webPaymentCoordinatorProxy->validateMerchant(merchantURL);
+ });
+ }];
+}
+
+- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller didAuthorizePayment:(PKPayment *)payment completion:(void (^)(PKPaymentAuthorizationStatus))completion
+{
+ if (!_webPaymentCoordinatorProxy) {
+ completion(PKPaymentAuthorizationStatusFailure);
+ return;
+ }
+
+ ASSERT(!_paymentAuthorizedCompletion);
+ _paymentAuthorizedCompletion = completion;
+
+ _webPaymentCoordinatorProxy->didAuthorizePayment(WebCore::Payment(payment));
+}
+
+- (void)paymentAuthorizationViewControllerDidFinish:(PKPaymentAuthorizationViewController *)controller
+{
+ if (!_webPaymentCoordinatorProxy)
+ return;
+
+ if (!_authorized)
+ _webPaymentCoordinatorProxy->didCancelPayment();
+
+ _webPaymentCoordinatorProxy->hidePaymentUI();
+}
+
+static WebCore::PaymentRequest::ShippingMethod toShippingMethod(PKShippingMethod *shippingMethod)
+{
+ ASSERT(shippingMethod);
+
+ WebCore::PaymentRequest::ShippingMethod result;
+ result.label = shippingMethod.label;
+ result.detail = shippingMethod.detail;
+ result.amount = [shippingMethod.amount decimalNumberByMultiplyingByPowerOf10:2].integerValue;
+ result.identifier = shippingMethod.identifier;
+
+ return result;
+}
+
+- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller didSelectShippingMethod:(PKShippingMethod *)shippingMethod completion:(void (^)(PKPaymentAuthorizationStatus status, NSArray<PKPaymentSummaryItem *> *summaryItems))completion
+{
+ if (!_webPaymentCoordinatorProxy) {
+ completion(PKPaymentAuthorizationStatusFailure, @[]);
+ return;
+ }
+
+ ASSERT(!_didSelectShippingMethodCompletion);
+ _didSelectShippingMethodCompletion = completion;
+ _webPaymentCoordinatorProxy->didSelectShippingMethod(toShippingMethod(shippingMethod));
+}
+
+- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller didSelectShippingContact:(PKContact *)contact completion:(void (^)(PKPaymentAuthorizationStatus status, NSArray<PKShippingMethod *> *shippingMethods, NSArray<PKPaymentSummaryItem *> *summaryItems))completion
+{
+ if (!_webPaymentCoordinatorProxy) {
+ completion(PKPaymentAuthorizationStatusFailure, @[], @[]);
+ return;
+ }
+
+ ASSERT(!_didSelectShippingContactCompletion);
+ _didSelectShippingContactCompletion = completion;
+ _webPaymentCoordinatorProxy->didSelectShippingContact(WebCore::PaymentContact(contact));
+}
+
+- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller didSelectPaymentMethod:(PKPaymentMethod *)paymentMethod completion:(void (^)(NSArray<PKPaymentSummaryItem *> *summaryItems))completion
+{
+ if (!_webPaymentCoordinatorProxy) {
+ completion(@[]);
+ return;
+ }
+
+ ASSERT(!_didSelectPaymentMethodCompletion);
+ _didSelectPaymentMethodCompletion = completion;
+
+ _webPaymentCoordinatorProxy->didSelectPaymentMethod(WebCore::PaymentMethod(paymentMethod));
+}
+
+@end
+
+// FIXME: Once rdar://problem/24420024 has been fixed, import PKPaymentRequest_Private.h instead.
+@interface PKPaymentRequest ()
+@property (nonatomic, retain) NSURL *originatingURL;
+@end
+
+@interface PKPaymentRequest ()
+// FIXME: Remove this once it's in an SDK.
+@property (nonatomic, strong) NSArray *thumbnailURLs;
+@property (nonatomic, strong) NSURL *thumbnailURL;
+
+@property (nonatomic, assign) BOOL expectsMerchantSession;
+@end
+
+namespace WebKit {
+
+bool WebPaymentCoordinatorProxy::platformCanMakePayments()
+{
+ return [getPKPaymentAuthorizationViewControllerClass() canMakePayments];
+}
+
+void WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, std::function<void (bool)> completionHandler)
+{
+ if (!canLoad_PassKit_PKCanMakePaymentsWithMerchantIdentifierAndDomain()) {
+ RunLoop::main().dispatch([completionHandler] {
+ completionHandler(false);
+ });
+ return;
+ }
+
+ softLink_PassKit_PKCanMakePaymentsWithMerchantIdentifierAndDomain(merchantIdentifier, domainName, [completionHandler](BOOL canMakePayments, NSError *error) {
+ if (error)
+ LOG_ERROR("PKCanMakePaymentsWithMerchantIdentifierAndDomain error %@", error);
+
+ RunLoop::main().dispatch([completionHandler, canMakePayments] {
+ completionHandler(canMakePayments);
+ });
+ });
+}
+
+static PKAddressField toPKAddressField(const WebCore::PaymentRequest::AddressFields& addressFields)
+{
+ PKAddressField result = 0;
+
+ if (addressFields.postalAddress)
+ result |= PKAddressFieldPostalAddress;
+ if (addressFields.phone)
+ result |= PKAddressFieldPhone;
+ if (addressFields.email)
+ result |= PKAddressFieldEmail;
+ if (addressFields.name)
+ result |= PKAddressFieldName;
+
+ return result;
+}
+
+static PKPaymentSummaryItemType toPKPaymentSummaryItemType(WebCore::PaymentRequest::LineItem::Type type)
+{
+ switch (type) {
+ case WebCore::PaymentRequest::LineItem::Type::Final:
+ return PKPaymentSummaryItemTypeFinal;
+
+ case WebCore::PaymentRequest::LineItem::Type::Pending:
+ return PKPaymentSummaryItemTypePending;
+ }
+}
+
+static RetainPtr<PKPaymentSummaryItem> toPKPaymentSummaryItem(const WebCore::PaymentRequest::LineItem& lineItem)
+{
+ auto amount = adoptNS([[NSDecimalNumber alloc] initWithMantissa:lineItem.amount.valueOr(0) exponent:-2 isNegative:*lineItem.amount < 0]);
+
+ return [getPKPaymentSummaryItemClass() summaryItemWithLabel:lineItem.label amount:amount.get() type:toPKPaymentSummaryItemType(lineItem.type)];
+}
+
+static PKMerchantCapability toPKMerchantCapabilities(const WebCore::PaymentRequest::MerchantCapabilities& merchantCapabilities)
+{
+ PKMerchantCapability result = 0;
+ if (merchantCapabilities.supports3DS)
+ result |= PKMerchantCapability3DS;
+ if (merchantCapabilities.supportsEMV)
+ result |= PKMerchantCapabilityEMV;
+ if (merchantCapabilities.supportsCredit)
+ result |= PKMerchantCapabilityCredit;
+ if (merchantCapabilities.supportsDebit)
+ result |= PKMerchantCapabilityDebit;
+
+ return result;
+}
+
+static RetainPtr<NSArray> toSupportedNetworks(const WebCore::PaymentRequest::SupportedNetworks& supportedNetworks)
+{
+ auto result = adoptNS([[NSMutableArray alloc] init]);
+
+ if (supportedNetworks.amex)
+ [result addObject:getPKPaymentNetworkAmex()];
+ if (supportedNetworks.chinaUnionPay)
+ [result addObject:getPKPaymentNetworkChinaUnionPay()];
+ if (supportedNetworks.discover)
+ [result addObject:getPKPaymentNetworkDiscover()];
+ if (supportedNetworks.interac)
+ [result addObject:getPKPaymentNetworkInterac()];
+ if (supportedNetworks.masterCard)
+ [result addObject:getPKPaymentNetworkMasterCard()];
+ if (supportedNetworks.privateLabel)
+ [result addObject:getPKPaymentNetworkPrivateLabel()];
+ if (supportedNetworks.visa)
+ [result addObject:getPKPaymentNetworkVisa()];
+
+ return result;
+}
+
+static PKShippingType toPKShippingType(WebCore::PaymentRequest::ShippingType shippingType)
+{
+ switch (shippingType) {
+ case WebCore::PaymentRequest::ShippingType::Shipping:
+ return PKShippingTypeShipping;
+
+ case WebCore::PaymentRequest::ShippingType::Delivery:
+ return PKShippingTypeDelivery;
+
+ case WebCore::PaymentRequest::ShippingType::StorePickup:
+ return PKShippingTypeStorePickup;
+
+ case WebCore::PaymentRequest::ShippingType::ServicePickup:
+ return PKShippingTypeServicePickup;
+ }
+}
+
+static RetainPtr<PKShippingMethod> toPKShippingMethod(const WebCore::PaymentRequest::ShippingMethod& shippingMethod)
+{
+ auto amount = adoptNS([[NSDecimalNumber alloc] initWithMantissa:shippingMethod.amount exponent:-2 isNegative:NO]);
+
+ RetainPtr<PKShippingMethod> result = [getPKShippingMethodClass() summaryItemWithLabel:shippingMethod.label amount:amount.get()];
+ [result setIdentifier:shippingMethod.identifier];
+ [result setDetail:shippingMethod.detail];
+
+ return result;
+}
+
+static RetainPtr<PKPaymentMerchantSession> toPKPaymentMerchantSession(const WebCore::PaymentMerchantSession& paymentMerchantSession)
+{
+ NSDictionary *dictionary = @{
+ @"merchantSessionIdentifier" : paymentMerchantSession.sessionIdentifier,
+ @"merchantIdentifier" : paymentMerchantSession.merchantIdentifier,
+ @"nOnce" : paymentMerchantSession.nonce,
+ @"epochTimestamp" : @(static_cast<NSUInteger>(paymentMerchantSession.epochTimestamp)),
+ @"FQDN" : paymentMerchantSession.domainName,
+ @"signature" : paymentMerchantSession.signature,
+ };
+
+ return adoptNS([allocPKPaymentMerchantSessionInstance() initWithDictionary:dictionary]);
+}
+
+RetainPtr<PKPaymentRequest> toPKPaymentRequest(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::PaymentRequest& paymentRequest)
+{
+ auto result = adoptNS([allocPKPaymentRequestInstance() init]);
+
+ [result setOriginatingURL:originatingURL];
+
+ if ([result respondsToSelector:@selector(setThumbnailURLs:)]) {
+ auto thumbnailURLs = adoptNS([[NSMutableArray alloc] init]);
+ for (auto& linkIconURL : linkIconURLs)
+ [thumbnailURLs addObject:static_cast<NSURL *>(linkIconURL)];
+
+ [result setThumbnailURLs:thumbnailURLs.get()];
+ } else if (!linkIconURLs.isEmpty())
+ [result setThumbnailURL:linkIconURLs[0]];
+
+ [result setCountryCode:paymentRequest.countryCode()];
+ [result setCurrencyCode:paymentRequest.currencyCode()];
+ [result setRequiredBillingAddressFields:toPKAddressField(paymentRequest.requiredBillingAddressFields())];
+ [result setBillingContact:paymentRequest.billingContact().pkContact()];
+ [result setRequiredShippingAddressFields:toPKAddressField(paymentRequest.requiredShippingAddressFields())];
+ [result setShippingContact:paymentRequest.shippingContact().pkContact()];
+
+ [result setSupportedNetworks:toSupportedNetworks(paymentRequest.supportedNetworks()).get()];
+ [result setMerchantCapabilities:toPKMerchantCapabilities(paymentRequest.merchantCapabilities())];
+
+ [result setShippingType:toPKShippingType(paymentRequest.shippingType())];
+
+ auto shippingMethods = adoptNS([[NSMutableArray alloc] init]);
+ for (auto& shippingMethod : paymentRequest.shippingMethods())
+ [shippingMethods addObject:toPKShippingMethod(shippingMethod).get()];
+ [result setShippingMethods:shippingMethods.get()];
+
+ auto paymentSummaryItems = adoptNS([[NSMutableArray alloc] init]);
+ for (auto& lineItem : paymentRequest.lineItems()) {
+ if (auto summaryItem = toPKPaymentSummaryItem(lineItem))
+ [paymentSummaryItems addObject:summaryItem.get()];
+ }
+
+ if (auto totalItem = toPKPaymentSummaryItem(paymentRequest.total()))
+ [paymentSummaryItems addObject:totalItem.get()];
+
+ [result setPaymentSummaryItems:paymentSummaryItems.get()];
+
+ [result setExpectsMerchantSession:YES];
+
+ if (!paymentRequest.applicationData().isNull()) {
+ auto applicationData = adoptNS([[NSData alloc] initWithBase64EncodedString:paymentRequest.applicationData() options:0]);
+ [result setApplicationData:applicationData.get()];
+ }
+
+ return result;
+}
+
+static PKPaymentAuthorizationStatus toPKPaymentAuthorizationStatus(WebCore::PaymentAuthorizationStatus status)
+{
+ switch (status) {
+ case WebCore::PaymentAuthorizationStatus::Success:
+ return PKPaymentAuthorizationStatusSuccess;
+ case WebCore::PaymentAuthorizationStatus::Failure:
+ return PKPaymentAuthorizationStatusFailure;
+ case WebCore::PaymentAuthorizationStatus::InvalidBillingPostalAddress:
+ return PKPaymentAuthorizationStatusInvalidBillingPostalAddress;
+ case WebCore::PaymentAuthorizationStatus::InvalidShippingPostalAddress:
+ return PKPaymentAuthorizationStatusInvalidShippingPostalAddress;
+ case WebCore::PaymentAuthorizationStatus::InvalidShippingContact:
+ return PKPaymentAuthorizationStatusInvalidShippingContact;
+ case WebCore::PaymentAuthorizationStatus::PINRequired:
+ return PKPaymentAuthorizationStatusPINRequired;
+ case WebCore::PaymentAuthorizationStatus::PINIncorrect:
+ return PKPaymentAuthorizationStatusPINIncorrect;
+ case WebCore::PaymentAuthorizationStatus::PINLockout:
+ return PKPaymentAuthorizationStatusPINLockout;
+ }
+}
+
+void WebPaymentCoordinatorProxy::platformCompletePaymentSession(WebCore::PaymentAuthorizationStatus status)
+{
+ ASSERT(m_paymentAuthorizationViewController);
+ ASSERT(m_paymentAuthorizationViewControllerDelegate);
+
+ m_paymentAuthorizationViewControllerDelegate->_authorized = YES;
+ m_paymentAuthorizationViewControllerDelegate->_paymentAuthorizedCompletion(toPKPaymentAuthorizationStatus(status));
+ m_paymentAuthorizationViewControllerDelegate->_paymentAuthorizedCompletion = nullptr;
+}
+
+void WebPaymentCoordinatorProxy::platformCompleteMerchantValidation(const WebCore::PaymentMerchantSession& paymentMerchantSession)
+{
+ ASSERT(m_paymentAuthorizationViewController);
+ ASSERT(m_paymentAuthorizationViewControllerDelegate);
+
+ m_paymentAuthorizationViewControllerDelegate->_sessionBlock(toPKPaymentMerchantSession(paymentMerchantSession).get(), nullptr);
+ m_paymentAuthorizationViewControllerDelegate->_sessionBlock = nullptr;
+}
+
+void WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection(WebCore::PaymentAuthorizationStatus status, const Optional<WebCore::PaymentRequest::TotalAndLineItems>& newTotalAndLineItems)
+{
+ ASSERT(m_paymentAuthorizationViewController);
+ ASSERT(m_paymentAuthorizationViewControllerDelegate);
+
+ if (newTotalAndLineItems) {
+ auto paymentSummaryItems = adoptNS([[NSMutableArray alloc] init]);
+ for (auto& lineItem : newTotalAndLineItems->lineItems) {
+ if (auto summaryItem = toPKPaymentSummaryItem(lineItem))
+ [paymentSummaryItems addObject:summaryItem.get()];
+ }
+
+ if (auto totalItem = toPKPaymentSummaryItem(newTotalAndLineItems->total))
+ [paymentSummaryItems addObject:totalItem.get()];
+
+ m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems = WTFMove(paymentSummaryItems);
+ }
+
+ m_paymentAuthorizationViewControllerDelegate->_didSelectShippingMethodCompletion(toPKPaymentAuthorizationStatus(status), m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get());
+ m_paymentAuthorizationViewControllerDelegate->_didSelectShippingMethodCompletion = nullptr;
+}
+
+void WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection(WebCore::PaymentAuthorizationStatus status, const Vector<WebCore::PaymentRequest::ShippingMethod>& newShippingMethods, const Optional<WebCore::PaymentRequest::TotalAndLineItems>& newTotalAndLineItems)
+{
+ ASSERT(m_paymentAuthorizationViewController);
+ ASSERT(m_paymentAuthorizationViewControllerDelegate);
+
+ if (newTotalAndLineItems) {
+ auto paymentSummaryItems = adoptNS([[NSMutableArray alloc] init]);
+ for (auto& lineItem : newTotalAndLineItems->lineItems) {
+ if (auto summaryItem = toPKPaymentSummaryItem(lineItem))
+ [paymentSummaryItems addObject:summaryItem.get()];
+ }
+
+ if (auto totalItem = toPKPaymentSummaryItem(newTotalAndLineItems->total))
+ [paymentSummaryItems addObject:totalItem.get()];
+
+ m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems = WTFMove(paymentSummaryItems);
+
+ auto shippingMethods = adoptNS([[NSMutableArray alloc] init]);
+ for (auto& shippingMethod : newShippingMethods)
+ [shippingMethods addObject:toPKShippingMethod(shippingMethod).get()];
+
+ m_paymentAuthorizationViewControllerDelegate->_shippingMethods = WTFMove(shippingMethods);
+ }
+
+ m_paymentAuthorizationViewControllerDelegate->_didSelectShippingContactCompletion(toPKPaymentAuthorizationStatus(status), m_paymentAuthorizationViewControllerDelegate->_shippingMethods.get(), m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get());
+ m_paymentAuthorizationViewControllerDelegate->_didSelectShippingContactCompletion = nullptr;
+}
+
+void WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection(const Optional<WebCore::PaymentRequest::TotalAndLineItems>& newTotalAndLineItems)
+{
+ ASSERT(m_paymentAuthorizationViewController);
+ ASSERT(m_paymentAuthorizationViewControllerDelegate);
+
+ if (newTotalAndLineItems) {
+ auto paymentSummaryItems = adoptNS([[NSMutableArray alloc] init]);
+ for (auto& lineItem : newTotalAndLineItems->lineItems) {
+ if (auto summaryItem = toPKPaymentSummaryItem(lineItem))
+ [paymentSummaryItems addObject:summaryItem.get()];
+ }
+
+ if (auto totalItem = toPKPaymentSummaryItem(newTotalAndLineItems->total))
+ [paymentSummaryItems addObject:totalItem.get()];
+
+ m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems = WTFMove(paymentSummaryItems);
+ }
+
+ m_paymentAuthorizationViewControllerDelegate->_didSelectPaymentMethodCompletion(m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get());
+ m_paymentAuthorizationViewControllerDelegate->_didSelectPaymentMethodCompletion = nullptr;
+}
+
+}
+
+#endif
+
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessApplePayiosWebPaymentCoordinatorProxyIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm (0 => 202432)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm        2016-06-24 18:31:05 UTC (rev 202432)
</span><span class="lines">@@ -0,0 +1,93 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "WebPaymentCoordinatorProxy.h"
+
+#if PLATFORM(IOS) && ENABLE(APPLE_PAY)
+
+#import "APIUIClient.h"
+#import "WebPageProxy.h"
+#import "WebPaymentCoordinatorProxyCocoa.h"
+#import <PassKit/PassKit.h>
+#import <PassKitCore/PKPaymentMerchantSession.h>
+#import <UIKit/UIViewController.h>
+#import <WebCore/PaymentAuthorizationStatus.h>
+#import <WebCore/SoftLinking.h>
+#import <wtf/BlockPtr.h>
+
+SOFT_LINK_FRAMEWORK(PassKit)
+SOFT_LINK_CLASS(PassKit, PKPaymentAuthorizationViewController);
+
+namespace WebKit {
+
+void WebPaymentCoordinatorProxy::platformShowPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLStrings, const WebCore::PaymentRequest& request, std::function<void (bool)> completionHandler)
+{
+ UIViewController *presentingViewController = m_webPageProxy.uiClient().presentingViewController();
+
+ if (!presentingViewController) {
+ completionHandler(false);
+ return;
+ }
+
+ ASSERT(!m_paymentAuthorizationViewController);
+
+ auto paymentRequest = toPKPaymentRequest(originatingURL, linkIconURLStrings, request);
+
+ m_paymentAuthorizationViewController = adoptNS([allocPKPaymentAuthorizationViewControllerInstance() initWithPaymentRequest:paymentRequest.get()]);
+ if (!m_paymentAuthorizationViewController) {
+ completionHandler(false);
+ return;
+ }
+
+ m_paymentAuthorizationViewControllerDelegate = adoptNS([[WKPaymentAuthorizationViewControllerDelegate alloc] initWithPaymentCoordinatorProxy:*this]);
+ m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems = [paymentRequest paymentSummaryItems];
+ m_paymentAuthorizationViewControllerDelegate->_shippingMethods = [paymentRequest shippingMethods];
+
+ [m_paymentAuthorizationViewController setDelegate:m_paymentAuthorizationViewControllerDelegate.get()];
+ [m_paymentAuthorizationViewController setPrivateDelegate:m_paymentAuthorizationViewControllerDelegate.get()];
+
+ [presentingViewController presentViewController:m_paymentAuthorizationViewController.get() animated:YES completion:nullptr];
+
+ completionHandler(true);
+}
+
+void WebPaymentCoordinatorProxy::hidePaymentUI()
+{
+ ASSERT(m_paymentAuthorizationViewController);
+ ASSERT(m_paymentAuthorizationViewControllerDelegate);
+
+ [[m_paymentAuthorizationViewController presentingViewController] dismissViewControllerAnimated:YES completion:nullptr];
+ [m_paymentAuthorizationViewController setDelegate:nil];
+ [m_paymentAuthorizationViewController setPrivateDelegate:nil];
+ m_paymentAuthorizationViewController = nullptr;
+
+ [m_paymentAuthorizationViewControllerDelegate invalidate];
+ m_paymentAuthorizationViewControllerDelegate = nullptr;
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessApplePaymacWebPaymentCoordinatorProxyMacmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm (0 => 202432)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm        2016-06-24 18:31:05 UTC (rev 202432)
</span><span class="lines">@@ -0,0 +1,153 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "WebPaymentCoordinatorProxy.h"
+
+#if PLATFORM(MAC) && ENABLE(APPLE_PAY)
+
+#import "WebPageProxy.h"
+#import "WebPaymentCoordinatorProxyCocoa.h"
+#import <Foundation/NSExtension.h>
+#import <PassKit/PKPaymentAuthorizationViewController_Private.h>
+#import <WebCore/SoftLinking.h>
+
+SOFT_LINK_PRIVATE_FRAMEWORK(PassKit)
+
+SOFT_LINK_CLASS(PassKit, PKPaymentAuthorizationViewController);
+SOFT_LINK_CONSTANT(PassKit, PKExtensionPaymentAuthorizationUIExtensionPointName, NSString *);
+
+namespace WebKit {
+
+void WebPaymentCoordinatorProxy::platformShowPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLStrings, const WebCore::PaymentRequest& request, std::function<void (bool)> completionHandler)
+{
+ auto paymentRequest = toPKPaymentRequest(originatingURL, linkIconURLStrings, request);
+
+ auto showPaymentUIRequestSeed = m_showPaymentUIRequestSeed;
+ auto weakThis = m_weakPtrFactory.createWeakPtr();
+ [getPKPaymentAuthorizationViewControllerClass() requestViewControllerWithPaymentRequest:paymentRequest.get() completion:[paymentRequest, showPaymentUIRequestSeed, weakThis, completionHandler](PKPaymentAuthorizationViewController *viewController, NSError *error) {
+ auto paymentCoordinatorProxy = weakThis.get();
+ if (!paymentCoordinatorProxy)
+ return;
+
+ if (error) {
+ LOG_ERROR("+[PKPaymentAuthorizationViewController requestViewControllerWithPaymentRequest:completion:] error %@", error);
+
+ completionHandler(false);
+ return;
+ }
+
+ if (showPaymentUIRequestSeed != paymentCoordinatorProxy->m_showPaymentUIRequestSeed) {
+ // We've already been asked to hide the payment UI. Don't attempt to show it.
+ return;
+ }
+
+ ASSERT(viewController);
+
+ paymentCoordinatorProxy->m_paymentAuthorizationViewControllerDelegate = adoptNS([[WKPaymentAuthorizationViewControllerDelegate alloc] initWithPaymentCoordinatorProxy:*paymentCoordinatorProxy]);
+ paymentCoordinatorProxy->m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems = [paymentRequest paymentSummaryItems];
+ paymentCoordinatorProxy->m_paymentAuthorizationViewControllerDelegate->_shippingMethods = [paymentRequest shippingMethods];
+ paymentCoordinatorProxy->m_paymentAuthorizationViewController = viewController;
+ [paymentCoordinatorProxy->m_paymentAuthorizationViewController setDelegate:paymentCoordinatorProxy->m_paymentAuthorizationViewControllerDelegate.get()];
+ [paymentCoordinatorProxy->m_paymentAuthorizationViewController setPrivateDelegate:paymentCoordinatorProxy->m_paymentAuthorizationViewControllerDelegate.get()];
+
+ ASSERT(!paymentCoordinatorProxy->m_sheetWindow);
+ paymentCoordinatorProxy->m_sheetWindow = [NSWindow windowWithContentViewController:viewController];
+ [paymentCoordinatorProxy->m_webPageProxy.platformWindow() beginSheet:paymentCoordinatorProxy->m_sheetWindow.get() completionHandler:nullptr];
+
+ completionHandler(true);
+ }];
+}
+
+void WebPaymentCoordinatorProxy::hidePaymentUI()
+{
+ if (m_state == State::Activating) {
+ ++m_showPaymentUIRequestSeed;
+
+ ASSERT(!m_paymentAuthorizationViewController);
+ ASSERT(!m_paymentAuthorizationViewControllerDelegate);
+ ASSERT(!m_sheetWindow);
+ return;
+ }
+
+ ASSERT(m_paymentAuthorizationViewController);
+ ASSERT(m_paymentAuthorizationViewControllerDelegate);
+ ASSERT(m_sheetWindow);
+
+ [[m_sheetWindow sheetParent] endSheet:m_sheetWindow.get()];
+ [m_paymentAuthorizationViewController setDelegate:nil];
+ [m_paymentAuthorizationViewController setPrivateDelegate:nil];
+ m_paymentAuthorizationViewController = nullptr;
+
+ [m_paymentAuthorizationViewControllerDelegate invalidate];
+ m_paymentAuthorizationViewControllerDelegate = nullptr;
+
+ m_sheetWindow = nullptr;
+}
+
+}
+
+extern "C" {
+WK_EXPORT bool WKPreferencesGetApplePayEnabled(WKPreferencesRef preferencesRef);
+WK_EXPORT void WKPreferencesSetApplePayEnabled(WKPreferencesRef preferencesRef, bool enabled);
+
+WK_EXPORT bool WKPreferencesGetApplePayCapabilityDisclosureAllowed(WKPreferencesRef preferencesRef);
+WK_EXPORT void WKPreferencesSetApplePayCapabilityDisclosureAllowed(WKPreferencesRef preferencesRef, bool allowed);
+
+// FIXME: Get rid of these in favor of the ones that mention Apple Pay.
+WK_EXPORT bool WKPreferencesGetPaymentsEnabled(WKPreferencesRef preferencesRef);
+WK_EXPORT void WKPreferencesSetPaymentsEnabled(WKPreferencesRef preferencesRef, bool enabled);
+}
+
+WK_EXPORT bool WKPreferencesGetApplePayEnabled(WKPreferencesRef preferencesRef)
+{
+ return WebKit::toImpl(preferencesRef)->applePayEnabled();
+}
+
+void WKPreferencesSetApplePayEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+ WebKit::toImpl(preferencesRef)->setApplePayEnabled(enabled);
+}
+
+bool WKPreferencesGetApplePayCapabilityDisclosureAllowed(WKPreferencesRef preferencesRef)
+{
+ return WebKit::toImpl(preferencesRef)->applePayCapabilityDisclosureAllowed();
+}
+
+void WKPreferencesSetApplePayCapabilityDisclosureAllowed(WKPreferencesRef preferencesRef, bool allowed)
+{
+ WebKit::toImpl(preferencesRef)->setApplePayCapabilityDisclosureAllowed(allowed);
+}
+
+bool WKPreferencesGetPaymentsEnabled(WKPreferencesRef preferencesRef)
+{
+ return WKPreferencesGetApplePayEnabled(preferencesRef);
+}
+
+void WKPreferencesSetPaymentsEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+ WKPreferencesSetApplePayEnabled(preferencesRef, enabled);
+}
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (202431 => 202432)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2016-06-24 18:21:05 UTC (rev 202431)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2016-06-24 18:31:05 UTC (rev 202432)
</span><span class="lines">@@ -97,6 +97,7 @@
</span><span class="cx"> #include "WebPageGroupData.h"
</span><span class="cx"> #include "WebPageMessages.h"
</span><span class="cx"> #include "WebPageProxyMessages.h"
</span><ins>+#include "WebPaymentCoordinatorProxy.h"
</ins><span class="cx"> #include "WebPopupItem.h"
</span><span class="cx"> #include "WebPopupMenuProxy.h"
</span><span class="cx"> #include "WebPreferences.h"
</span><span class="lines">@@ -167,10 +168,6 @@
</span><span class="cx"> #include <WebCore/MediaSessionMetadata.h>
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-#if USE(APPLE_INTERNAL_SDK)
-#include <WebKitAdditions/WebPageProxyIncludes.h>
-#endif
-
</del><span class="cx"> #if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
</span><span class="cx"> #include "WebPlaybackSessionManagerProxy.h"
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (202431 => 202432)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-06-24 18:21:05 UTC (rev 202431)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-06-24 18:31:05 UTC (rev 202432)
</span><span class="lines">@@ -55,6 +55,7 @@
</span><span class="cx"> #include "WebPageCreationParameters.h"
</span><span class="cx"> #include "WebPageDiagnosticLoggingClient.h"
</span><span class="cx"> #include "WebPageInjectedBundleClient.h"
</span><ins>+#include "WebPaymentCoordinatorProxy.h"
</ins><span class="cx"> #include "WebPreferences.h"
</span><span class="cx"> #include <WebCore/AlternativeTextClient.h> // FIXME: Needed by WebPageProxyMessages.h for DICTATION_ALTERNATIVES.
</span><span class="cx"> #include "WebPageProxyMessages.h"
</span><span class="lines">@@ -116,10 +117,6 @@
</span><span class="cx"> #include <WebCore/WebMediaSessionManagerClient.h>
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-#if USE(APPLE_INTERNAL_SDK)
-#include <WebKitAdditions/WebPageProxyIncludes.h>
-#endif
-
</del><span class="cx"> #if ENABLE(MEDIA_SESSION)
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class MediaSessionMetadata;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (202431 => 202432)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-06-24 18:21:05 UTC (rev 202431)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-06-24 18:31:05 UTC (rev 202432)
</span><span class="lines">@@ -296,7 +296,6 @@
</span><span class="cx">                 1A6FBD2811E69BC200DB1371 /* NetscapePlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6FBD2611E69BC200DB1371 /* NetscapePlugin.h */; };
</span><span class="cx">                 1A6FBD2911E69BC200DB1371 /* NetscapePlugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FBD2711E69BC200DB1371 /* NetscapePlugin.cpp */; };
</span><span class="cx">                 1A7284481959F8040007BCE5 /* SessionStateConversion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7284441959ED100007BCE5 /* SessionStateConversion.cpp */; };
</span><del>-                1A781AE71C5714DA00FB96DD /* WebKitAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A781AE51C5714DA00FB96DD /* WebKitAdditions.mm */; };
</del><span class="cx">                 1A7865B916CAC71500ACE83A /* PluginProcessConnectionManagerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7865B716CAC71500ACE83A /* PluginProcessConnectionManagerMessageReceiver.cpp */; };
</span><span class="cx">                 1A7865BA16CAC71500ACE83A /* PluginProcessConnectionManagerMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7865B816CAC71500ACE83A /* PluginProcessConnectionManagerMessages.h */; };
</span><span class="cx">                 1A7C0DF61B7D1F1000A9B848 /* WKWindowFeaturesRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7C0DF41B7D1F1000A9B848 /* WKWindowFeaturesRef.cpp */; };
</span><span class="lines">@@ -383,6 +382,19 @@
</span><span class="cx">                 1AB16AE21648656D00290D62 /* RemoteLayerTreeDrawingAreaProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB16AE01648656D00290D62 /* RemoteLayerTreeDrawingAreaProxy.h */; };
</span><span class="cx">                 1AB16AE9164B3A8800290D62 /* RemoteLayerTreeContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AB16AE7164B3A8800290D62 /* RemoteLayerTreeContext.mm */; };
</span><span class="cx">                 1AB16AEA164B3A8800290D62 /* RemoteLayerTreeContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB16AE8164B3A8800290D62 /* RemoteLayerTreeContext.h */; };
</span><ins>+                1AB1F7741D1B2F8A007C9BD1 /* WebPaymentCoordinator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB1F7711D1B2F7E007C9BD1 /* WebPaymentCoordinator.cpp */; };
+                1AB1F77E1D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB1F7781D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyCocoa.h */; };
+                1AB1F77F1D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AB1F7791D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyCocoa.mm */; };
+                1AB1F7801D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AB1F77B1D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyIOS.mm */; };
+                1AB1F7811D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AB1F77D1D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyMac.mm */; };
+                1AB1F78B1D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB1F7881D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.cpp */; };
+                1AB1F78C1D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB1F7891D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.h */; };
+                1AB1F7901D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AB1F78E1D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.mm */; };
+                1AB1F7911D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB1F78F1D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.h */; };
+                1AB1F7961D1B3613007C9BD1 /* WebPaymentCoordinatorMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB1F7921D1B3613007C9BD1 /* WebPaymentCoordinatorMessageReceiver.cpp */; };
+                1AB1F7971D1B3613007C9BD1 /* WebPaymentCoordinatorMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB1F7931D1B3613007C9BD1 /* WebPaymentCoordinatorMessages.h */; };
+                1AB1F7981D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB1F7941D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessageReceiver.cpp */; };
+                1AB1F7991D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB1F7951D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessages.h */; };
</ins><span class="cx">                 1AB31A9616BC688100F6DBC9 /* StorageManagerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB31A9416BC688100F6DBC9 /* StorageManagerMessageReceiver.cpp */; };
</span><span class="cx">                 1AB31A9716BC688100F6DBC9 /* StorageManagerMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB31A9516BC688100F6DBC9 /* StorageManagerMessages.h */; };
</span><span class="cx">                 1AB40EE51BF677E300BA81BE /* WKMenuItemIdentifiers.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AB40EE31BF677E300BA81BE /* WKMenuItemIdentifiers.mm */; };
</span><span class="lines">@@ -2256,7 +2268,6 @@
</span><span class="cx">                 1A6FBD2711E69BC200DB1371 /* NetscapePlugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetscapePlugin.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 1A7284441959ED100007BCE5 /* SessionStateConversion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SessionStateConversion.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 1A7284451959ED100007BCE5 /* SessionStateConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SessionStateConversion.h; sourceTree = "<group>"; };
</span><del>-                1A781AE51C5714DA00FB96DD /* WebKitAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebKitAdditions.mm; sourceTree = "<group>"; };
</del><span class="cx">                 1A7865B616CAC6FD00ACE83A /* PluginProcessConnectionManager.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = PluginProcessConnectionManager.messages.in; sourceTree = "<group>"; };
</span><span class="cx">                 1A7865B716CAC71500ACE83A /* PluginProcessConnectionManagerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginProcessConnectionManagerMessageReceiver.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 1A7865B816CAC71500ACE83A /* PluginProcessConnectionManagerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProcessConnectionManagerMessages.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -2357,6 +2368,22 @@
</span><span class="cx">                 1AB16AE01648656D00290D62 /* RemoteLayerTreeDrawingAreaProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerTreeDrawingAreaProxy.h; sourceTree = "<group>"; };
</span><span class="cx">                 1AB16AE7164B3A8800290D62 /* RemoteLayerTreeContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteLayerTreeContext.mm; sourceTree = "<group>"; };
</span><span class="cx">                 1AB16AE8164B3A8800290D62 /* RemoteLayerTreeContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerTreeContext.h; sourceTree = "<group>"; };
</span><ins>+                1AB1F7711D1B2F7E007C9BD1 /* WebPaymentCoordinator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPaymentCoordinator.cpp; sourceTree = "<group>"; };
+                1AB1F7721D1B2F7E007C9BD1 /* WebPaymentCoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPaymentCoordinator.h; sourceTree = "<group>"; };
+                1AB1F7731D1B2F7E007C9BD1 /* WebPaymentCoordinator.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebPaymentCoordinator.messages.in; sourceTree = "<group>"; };
+                1AB1F7781D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPaymentCoordinatorProxyCocoa.h; sourceTree = "<group>"; };
+                1AB1F7791D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPaymentCoordinatorProxyCocoa.mm; sourceTree = "<group>"; };
+                1AB1F77B1D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPaymentCoordinatorProxyIOS.mm; sourceTree = "<group>"; };
+                1AB1F77D1D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPaymentCoordinatorProxyMac.mm; sourceTree = "<group>"; };
+                1AB1F7881D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPaymentCoordinatorProxy.cpp; sourceTree = "<group>"; };
+                1AB1F7891D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPaymentCoordinatorProxy.h; sourceTree = "<group>"; };
+                1AB1F78A1D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebPaymentCoordinatorProxy.messages.in; sourceTree = "<group>"; };
+                1AB1F78E1D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreArgumentCodersCocoa.mm; sourceTree = "<group>"; };
+                1AB1F78F1D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreArgumentCodersCocoa.h; sourceTree = "<group>"; };
+                1AB1F7921D1B3613007C9BD1 /* WebPaymentCoordinatorMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebPaymentCoordinatorMessageReceiver.cpp; path = WebPaymentCoordinatorMessageReceiver.cpp; sourceTree = "<group>"; };
+                1AB1F7931D1B3613007C9BD1 /* WebPaymentCoordinatorMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebPaymentCoordinatorMessages.h; path = WebPaymentCoordinatorMessages.h; sourceTree = "<group>"; };
+                1AB1F7941D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebPaymentCoordinatorProxyMessageReceiver.cpp; path = WebPaymentCoordinatorProxyMessageReceiver.cpp; sourceTree = "<group>"; };
+                1AB1F7951D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebPaymentCoordinatorProxyMessages.h; path = WebPaymentCoordinatorProxyMessages.h; sourceTree = "<group>"; };
</ins><span class="cx">                 1AB31A9316BC65AB00F6DBC9 /* StorageManager.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = StorageManager.messages.in; sourceTree = "<group>"; };
</span><span class="cx">                 1AB31A9416BC688100F6DBC9 /* StorageManagerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageManagerMessageReceiver.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 1AB31A9516BC688100F6DBC9 /* StorageManagerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageManagerMessages.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -4420,7 +4447,7 @@
</span><span class="cx">                                 518E8EF116B208F000E91429 /* Authentication */,
</span><span class="cx">                                 1AAF0C4712B16328008E49E2 /* cf */,
</span><span class="cx">                                 C01A25FF12662F2100C9ED55 /* cg */,
</span><del>-                                37C4C0901814B37B003688B9 /* Cocoa */,
</del><ins>+                                37C4C0901814B37B003688B9 /* cocoa */,
</ins><span class="cx">                                 51E351C2180F2C8500E53BE9 /* Databases */,
</span><span class="cx">                                 BC82836816B3587900A278FE /* EntryPointUtilities */,
</span><span class="cx">                                 E170877216D6CFEC00F99226 /* FileAPI */,
</span><span class="lines">@@ -4621,6 +4648,54 @@
</span><span class="cx">                         path = cf;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="cx">                 };
</span><ins>+                1AB1F7701D1B2F5D007C9BD1 /* ApplePay */ = {
+                        isa = PBXGroup;
+                        children = (
+                                1AB1F7711D1B2F7E007C9BD1 /* WebPaymentCoordinator.cpp */,
+                                1AB1F7721D1B2F7E007C9BD1 /* WebPaymentCoordinator.h */,
+                                1AB1F7731D1B2F7E007C9BD1 /* WebPaymentCoordinator.messages.in */,
+                        );
+                        path = ApplePay;
+                        sourceTree = "<group>";
+                };
+                1AB1F7761D1B30A9007C9BD1 /* ApplePay */ = {
+                        isa = PBXGroup;
+                        children = (
+                                1AB1F7771D1B30A9007C9BD1 /* cocoa */,
+                                1AB1F77A1D1B30A9007C9BD1 /* ios */,
+                                1AB1F77C1D1B30A9007C9BD1 /* mac */,
+                                1AB1F7881D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.cpp */,
+                                1AB1F7891D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.h */,
+                                1AB1F78A1D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.messages.in */,
+                        );
+                        path = ApplePay;
+                        sourceTree = "<group>";
+                };
+                1AB1F7771D1B30A9007C9BD1 /* cocoa */ = {
+                        isa = PBXGroup;
+                        children = (
+                                1AB1F7781D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyCocoa.h */,
+                                1AB1F7791D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyCocoa.mm */,
+                        );
+                        path = cocoa;
+                        sourceTree = "<group>";
+                };
+                1AB1F77A1D1B30A9007C9BD1 /* ios */ = {
+                        isa = PBXGroup;
+                        children = (
+                                1AB1F77B1D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyIOS.mm */,
+                        );
+                        path = ios;
+                        sourceTree = "<group>";
+                };
+                1AB1F77C1D1B30A9007C9BD1 /* mac */ = {
+                        isa = PBXGroup;
+                        children = (
+                                1AB1F77D1D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyMac.mm */,
+                        );
+                        path = mac;
+                        sourceTree = "<group>";
+                };
</ins><span class="cx">                 1AB7D4C71288AA9A00CFD08C /* Downloads */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -5163,9 +5238,11 @@
</span><span class="cx">                         path = Cocoa;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="cx">                 };
</span><del>-                37C4C0901814B37B003688B9 /* Cocoa */ = {
</del><ins>+                37C4C0901814B37B003688B9 /* cocoa */ = {
</ins><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                1AB1F78E1D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.mm */,
+                                1AB1F78F1D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.h */,
</ins><span class="cx">                                 1A1EF1971A1D5B420023200A /* APIDataCocoa.mm */,
</span><span class="cx">                                 378E1A3B181ED6FF0031007A /* APIObject.mm */,
</span><span class="cx">                                 37BEC4DF19491486008B4286 /* CompletionHandlerCallChecker.h */,
</span><span class="lines">@@ -5172,7 +5249,6 @@
</span><span class="cx">                                 37BEC4DE19491486008B4286 /* CompletionHandlerCallChecker.mm */,
</span><span class="cx">                                 C55F916C1C595E440029E92D /* DataDetectionResult.h */,
</span><span class="cx">                                 C55F916D1C595E440029E92D /* DataDetectionResult.mm */,
</span><del>-                                1A781AE51C5714DA00FB96DD /* WebKitAdditions.mm */,
</del><span class="cx">                                 37C4C0921814B3AF003688B9 /* WKNSArray.h */,
</span><span class="cx">                                 37C4C0911814B3AF003688B9 /* WKNSArray.mm */,
</span><span class="cx">                                 373CEAD4185417AE008C363D /* WKNSData.h */,
</span><span class="lines">@@ -5192,6 +5268,7 @@
</span><span class="cx">                                 378E1A3F181EDA010031007A /* WKObject.h */,
</span><span class="cx">                                 374436871820E7240049579F /* WKObject.mm */,
</span><span class="cx">                         );
</span><ins>+                        name = cocoa;
</ins><span class="cx">                         path = Cocoa;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="cx">                 };
</span><span class="lines">@@ -5718,6 +5795,7 @@
</span><span class="cx">                 BC032D5C10F436D50058C15A /* WebProcess */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                1AB1F7701D1B2F5D007C9BD1 /* ApplePay */,
</ins><span class="cx">                                 1C0A19431C8FF1A800FE0EBB /* Automation */,
</span><span class="cx">                                 7C6E70F818B2D47E00F24E2E /* cocoa */,
</span><span class="cx">                                 3309344B1315B93A0097A7BC /* Cookies */,
</span><span class="lines">@@ -5857,6 +5935,7 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 BC032DC410F4387C0058C15A /* API */,
</span><ins>+                                1AB1F7761D1B30A9007C9BD1 /* ApplePay */,
</ins><span class="cx">                                 512F588D12A8836F00629530 /* Authentication */,
</span><span class="cx">                                 9955A6E81C79809000EB6A93 /* Automation */,
</span><span class="cx">                                 1ABC3DF21899E415004F0626 /* Cocoa */,
</span><span class="lines">@@ -6866,6 +6945,10 @@
</span><span class="cx">                 C0CE729D1247E71D00BC0EC4 /* Derived Sources */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                1AB1F7921D1B3613007C9BD1 /* WebPaymentCoordinatorMessageReceiver.cpp */,
+                                1AB1F7931D1B3613007C9BD1 /* WebPaymentCoordinatorMessages.h */,
+                                1AB1F7941D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessageReceiver.cpp */,
+                                1AB1F7951D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessages.h */,
</ins><span class="cx">                                 512F58A012A883AD00629530 /* AuthenticationManagerMessageReceiver.cpp */,
</span><span class="cx">                                 512F58A112A883AD00629530 /* AuthenticationManagerMessages.h */,
</span><span class="cx">                                 9955A6F01C79866400EB6A93 /* AutomationBackendDispatchers.cpp */,
</span><span class="lines">@@ -7705,6 +7788,7 @@
</span><span class="cx">                                 9391F2CB121B67AD00EBF7E8 /* WebFrameNetworkingContext.h in Headers */,
</span><span class="cx">                                 BCB9F6A01123A84B00A137E0 /* WebFramePolicyListenerProxy.h in Headers */,
</span><span class="cx">                                 BC9B38A110F538BE00443A15 /* WebFrameProxy.h in Headers */,
</span><ins>+                                1AB1F7991D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessages.h in Headers */,
</ins><span class="cx">                                 BC1BE1E012D54A410004A228 /* WebGeolocationClient.h in Headers */,
</span><span class="cx">                                 BC0E5FE512D697160012A72A /* WebGeolocationManager.h in Headers */,
</span><span class="cx">                                 BC0E606212D6BA910012A72A /* WebGeolocationManagerMessages.h in Headers */,
</span><span class="lines">@@ -7786,6 +7870,7 @@
</span><span class="cx">                                 BC306824125A6B9400E71278 /* WebProcessCreationParameters.h in Headers */,
</span><span class="cx">                                 1AFA4B901A65A9E2006C4AB4 /* WebProcessLifetimeObserver.h in Headers */,
</span><span class="cx">                                 1AFA4B8C1A65A1D0006C4AB4 /* WebProcessLifetimeTracker.h in Headers */,
</span><ins>+                                1AB1F78C1D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.h in Headers */,
</ins><span class="cx">                                 BC3066BF125A442100E71278 /* WebProcessMessages.h in Headers */,
</span><span class="cx">                                 7CE4D21B1A4914A300C7F152 /* WebProcessPool.h in Headers */,
</span><span class="cx">                                 7CE4D2281A4916C200C7F152 /* WebProcessPoolMessages.h in Headers */,
</span><span class="lines">@@ -7906,6 +7991,7 @@
</span><span class="cx">                                 3309345B1315B9980097A7BC /* WKCookieManager.h in Headers */,
</span><span class="cx">                                 512F58FA12A88A5400629530 /* WKCredential.h in Headers */,
</span><span class="cx">                                 518ACF1112B015F800B04B83 /* WKCredentialTypes.h in Headers */,
</span><ins>+                                1AB1F7971D1B3613007C9BD1 /* WebPaymentCoordinatorMessages.h in Headers */,
</ins><span class="cx">                                 BC4075F8124FF0270068F20A /* WKData.h in Headers */,
</span><span class="cx">                                 377EAD4517E2C51A002D193D /* WKDeclarationSpecifiers.h in Headers */,
</span><span class="cx">                                 8372DB2F1A677D4A00C697C5 /* WKDiagnosticLoggingResultType.h in Headers */,
</span><span class="lines">@@ -8053,10 +8139,12 @@
</span><span class="cx">                                 1AD01BCD1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.h in Headers */,
</span><span class="cx">                                 1A9E329B1822E1CC00F5D04C /* WKRemoteObject.h in Headers */,
</span><span class="cx">                                 1A9E329F1822FEDD00F5D04C /* WKRemoteObjectCoder.h in Headers */,
</span><ins>+                                1AB1F7911D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.h in Headers */,
</ins><span class="cx">                                 37948409150C4B9700E52CE9 /* WKRenderLayer.h in Headers */,
</span><span class="cx">                                 37608823150414F700FC82C7 /* WKRenderObject.h in Headers */,
</span><span class="cx">                                 3336763B130C99DC006C9DE2 /* WKResourceCacheManager.h in Headers */,
</span><span class="cx">                                 A19DD3C01D07D16800AC823B /* _WKWebViewPrintFormatterInternal.h in Headers */,
</span><ins>+                                1AB1F77E1D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyCocoa.h in Headers */,
</ins><span class="cx">                                 BC8A501511765F5600757573 /* WKRetainPtr.h in Headers */,
</span><span class="cx">                                 1A7E377918E4A4FE003D0FFF /* WKScriptMessage.h in Headers */,
</span><span class="cx">                                 1A7E377518E4A33A003D0FFF /* WKScriptMessageHandler.h in Headers */,
</span><span class="lines">@@ -9009,6 +9097,7 @@
</span><span class="cx">                                 BCC43ABA127B95DC00317F16 /* PlatformPopupMenuData.cpp in Sources */,
</span><span class="cx">                                 1A6FB7D211E651E200DB1371 /* Plugin.cpp in Sources */,
</span><span class="cx">                                 31A67E0C165B2A99006CBA66 /* PlugInAutoStartProvider.cpp in Sources */,
</span><ins>+                                1AB1F7961D1B3613007C9BD1 /* WebPaymentCoordinatorMessageReceiver.cpp in Sources */,
</ins><span class="cx">                                 1A8EF4CC1252403700F7067F /* PluginControllerProxy.cpp in Sources */,
</span><span class="cx">                                 1A2D91A61281D739001EB962 /* PluginControllerProxyMac.mm in Sources */,
</span><span class="cx">                                 1A8EF96E1252AF6B00F7067F /* PluginControllerProxyMessageReceiver.cpp in Sources */,
</span><span class="lines">@@ -9030,6 +9119,7 @@
</span><span class="cx">                                 1A0EC75F124BC7B2007EF4A5 /* PluginProcessProxy.cpp in Sources */,
</span><span class="cx">                                 1A2D90BB1281C931001EB962 /* PluginProcessProxyMac.mm in Sources */,
</span><span class="cx">                                 1A043B5D124D5E9D00FFBFB5 /* PluginProcessProxyMessageReceiver.cpp in Sources */,
</span><ins>+                                1AB1F7741D1B2F8A007C9BD1 /* WebPaymentCoordinator.cpp in Sources */,
</ins><span class="cx">                                 1A043DC2124FF87500FFBFB5 /* PluginProxy.cpp in Sources */,
</span><span class="cx">                                 1A2D92211281DC1B001EB962 /* PluginProxyMac.mm in Sources */,
</span><span class="cx">                                 1A8EFA701252B84100F7067F /* PluginProxyMessageReceiver.cpp in Sources */,
</span><span class="lines">@@ -9209,6 +9299,7 @@
</span><span class="cx">                                 51834592134532E90092B696 /* WebIconDatabaseClient.cpp in Sources */,
</span><span class="cx">                                 51D02F64132EC5B900BEAA96 /* WebIconDatabaseMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 511B24A6132E095700065A0C /* WebIconDatabaseProxy.cpp in Sources */,
</span><ins>+                                1AB1F77F1D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyCocoa.mm in Sources */,
</ins><span class="cx">                                 51D02F6B132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 5105236F1C739D42007993CB /* WebIDBConnectionToClient.cpp in Sources */,
</span><span class="cx">                                 510523791C73DA77007993CB /* WebIDBConnectionToClientMessageReceiver.cpp in Sources */,
</span><span class="lines">@@ -9229,7 +9320,6 @@
</span><span class="cx">                                 C0337DD3127A2A0E008FF4F4 /* WebKeyboardEvent.cpp in Sources */,
</span><span class="cx">                                 1A6280F31919982A006AD9F9 /* WebKit.m in Sources */,
</span><span class="cx">                                 BC9BA5041697C45300E44616 /* WebKit2Initialize.cpp in Sources */,
</span><del>-                                1A781AE71C5714DA00FB96DD /* WebKitAdditions.mm in Sources */,
</del><span class="cx">                                 51FB08FF1639DE1A00EC324A /* WebLoaderStrategy.cpp in Sources */,
</span><span class="cx">                                 CD003A5219D49B5D005ABCE0 /* WebMediaKeyStorageManager.cpp in Sources */,
</span><span class="cx">                                 C98C48A51B6FD4C300145103 /* WebMediaSessionFocusManager.cpp in Sources */,
</span><span class="lines">@@ -9249,8 +9339,10 @@
</span><span class="cx">                                 BC857F8612B82D0B00EDEB2E /* WebOpenPanelResultListener.cpp in Sources */,
</span><span class="cx">                                 BC857F7E12B82CEE00EDEB2E /* WebOpenPanelResultListenerProxy.cpp in Sources */,
</span><span class="cx">                                 BC963D6B113DD19200574BE2 /* WebPage.cpp in Sources */,
</span><ins>+                                1AB1F78B1D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.cpp in Sources */,
</ins><span class="cx">                                 C06C6095124C144B0001682F /* WebPageCreationParameters.cpp in Sources */,
</span><span class="cx">                                 8372DB281A67562800C697C5 /* WebPageDiagnosticLoggingClient.cpp in Sources */,
</span><ins>+                                1AB1F7981D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessageReceiver.cpp in Sources */,
</ins><span class="cx">                                 BC7B6207129A0A6700D174A4 /* WebPageGroup.cpp in Sources */,
</span><span class="cx">                                 BC7B625312A43C9600D174A4 /* WebPageGroupData.cpp in Sources */,
</span><span class="cx">                                 BC7B621612A4219A00D174A4 /* WebPageGroupProxy.cpp in Sources */,
</span><span class="lines">@@ -9371,6 +9463,7 @@
</span><span class="cx">                                 EDCA71B7128DDA8C00201B26 /* WKBundlePageOverlay.cpp in Sources */,
</span><span class="cx">                                 BC60C57A1240A546008C5E29 /* WKBundleRangeHandle.cpp in Sources */,
</span><span class="cx">                                 BC14DF9E120B635F00826C0C /* WKBundleScriptWorld.cpp in Sources */,
</span><ins>+                                1AB1F7801D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyIOS.mm in Sources */,
</ins><span class="cx">                                 BC4075F5124FF0270068F20A /* WKCertificateInfo.cpp in Sources */,
</span><span class="cx">                                 BC407628124FF0400068F20A /* WKCertificateInfoMac.mm in Sources */,
</span><span class="cx">                                 BCA284D61492F2C7001F9042 /* WKConnection.mm in Sources */,
</span><span class="lines">@@ -9384,6 +9477,7 @@
</span><span class="cx">                                 3309345A1315B9980097A7BC /* WKCookieManager.cpp in Sources */,
</span><span class="cx">                                 512F58F912A88A5400629530 /* WKCredential.cpp in Sources */,
</span><span class="cx">                                 BC4075F7124FF0270068F20A /* WKData.cpp in Sources */,
</span><ins>+                                1AB1F7901D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.mm in Sources */,
</ins><span class="cx">                                 1AFF49001833DE78009AB15A /* WKDeprecatedFunctions.cpp in Sources */,
</span><span class="cx">                                 BC4075F9124FF0270068F20A /* WKDictionary.cpp in Sources */,
</span><span class="cx">                                 BC017D0816260FF4007054F5 /* WKDOMDocument.mm in Sources */,
</span><span class="lines">@@ -9497,6 +9591,7 @@
</span><span class="cx">                                 0FCB4E6918BBE3D9000FCFC9 /* WKTextInputWindowController.mm in Sources */,
</span><span class="cx">                                 BC407607124FF0270068F20A /* WKType.cpp in Sources */,
</span><span class="cx">                                 7CD5EBBE1746B04C000C1C45 /* WKTypeRefWrapper.mm in Sources */,
</span><ins>+                                1AB1F7811D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyMac.mm in Sources */,
</ins><span class="cx">                                 BC407609124FF0270068F20A /* WKURL.cpp in Sources */,
</span><span class="cx">                                 BC40761B124FF0370068F20A /* WKURLCF.mm in Sources */,
</span><span class="cx">                                 BC40760B124FF0270068F20A /* WKURLRequest.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessApplePayWebPaymentCoordinatorcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.cpp (0 => 202432)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.cpp         (rev 0)
+++ trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.cpp        2016-06-24 18:31:05 UTC (rev 202432)
</span><span class="lines">@@ -0,0 +1,174 @@
</span><ins>+/*
+ * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebPaymentCoordinator.h"
+
+#if ENABLE(APPLE_PAY)
+
+#include "DataReference.h"
+#include "WebPage.h"
+#include "WebPaymentCoordinatorMessages.h"
+#include "WebPaymentCoordinatorProxyMessages.h"
+#include "WebProcess.h"
+#include <WebCore/MainFrame.h>
+#include <WebCore/PaymentCoordinator.h>
+#include <WebCore/URL.h>
+
+namespace WebKit {
+
+WebPaymentCoordinator::WebPaymentCoordinator(WebPage& webPage)
+ : m_webPage(webPage)
+{
+ WebProcess::singleton().addMessageReceiver(Messages::WebPaymentCoordinator::messageReceiverName(), m_webPage.pageID(), *this);
+}
+
+WebPaymentCoordinator::~WebPaymentCoordinator()
+{
+ WebProcess::singleton().removeMessageReceiver(Messages::WebPaymentCoordinator::messageReceiverName(), m_webPage.pageID());
+}
+
+bool WebPaymentCoordinator::supportsVersion(unsigned version)
+{
+ ASSERT(version > 0);
+
+ if (version == 1)
+ return true;
+
+ return false;
+}
+
+bool WebPaymentCoordinator::canMakePayments()
+{
+ bool canMakePayments;
+ if (!m_webPage.sendSync(Messages::WebPaymentCoordinatorProxy::CanMakePayments(), Messages::WebPaymentCoordinatorProxy::CanMakePayments::Reply(canMakePayments)))
+ return false;
+
+ return canMakePayments;
+}
+
+static uint64_t generateCanMakePaymentsWithActiveCardReplyID()
+{
+ static uint64_t canMakePaymentsWithActiveCardReplyID;
+
+ return ++canMakePaymentsWithActiveCardReplyID;
+}
+
+void WebPaymentCoordinator::canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, std::function<void (bool)> completionHandler)
+{
+ auto replyID = generateCanMakePaymentsWithActiveCardReplyID();
+
+ m_pendingCanMakePaymentsWithActiveCardCallbacks.add(replyID, WTFMove(completionHandler));
+ m_webPage.send(Messages::WebPaymentCoordinatorProxy::CanMakePaymentsWithActiveCard(merchantIdentifier, domainName, replyID));
+}
+
+void WebPaymentCoordinator::showPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::PaymentRequest& paymentRequest)
+{
+ Vector<String> linkIconURLStrings;
+ for (const auto& linkIconURL : linkIconURLs)
+ linkIconURLStrings.append(linkIconURL.string());
+
+ m_webPage.send(Messages::WebPaymentCoordinatorProxy::ShowPaymentUI(originatingURL.string(), linkIconURLStrings, paymentRequest));
+}
+
+void WebPaymentCoordinator::completeMerchantValidation(const WebCore::PaymentMerchantSession& paymentMerchantSession)
+{
+ m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompleteMerchantValidation(paymentMerchantSession));
+}
+
+void WebPaymentCoordinator::completeShippingMethodSelection(WebCore::PaymentAuthorizationStatus status, Optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems)
+{
+ m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompleteShippingMethodSelection(static_cast<uint32_t>(status), newTotalAndItems));
+}
+
+void WebPaymentCoordinator::completeShippingContactSelection(WebCore::PaymentAuthorizationStatus status, const Vector<WebCore::PaymentRequest::ShippingMethod>& newShippingMethods, Optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems)
+{
+ m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompleteShippingContactSelection(static_cast<uint32_t>(status), newShippingMethods, newTotalAndItems));
+}
+
+void WebPaymentCoordinator::completePaymentMethodSelection(Optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems)
+{
+ m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompletePaymentMethodSelection(newTotalAndItems));
+}
+
+void WebPaymentCoordinator::completePaymentSession(WebCore::PaymentAuthorizationStatus status)
+{
+ m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompletePaymentSession(static_cast<uint32_t>(status)));
+}
+
+void WebPaymentCoordinator::abortPaymentSession()
+{
+ m_webPage.send(Messages::WebPaymentCoordinatorProxy::AbortPaymentSession());
+}
+
+void WebPaymentCoordinator::mainFrameDestroyed()
+{
+ delete this;
+}
+
+void WebPaymentCoordinator::validateMerchant(const String& validationURLString)
+{
+ paymentCoordinator().validateMerchant(WebCore::URL(WebCore::URL(), validationURLString));
+}
+
+void WebPaymentCoordinator::didAuthorizePayment(const WebCore::Payment& payment)
+{
+ paymentCoordinator().didAuthorizePayment(payment);
+}
+
+void WebPaymentCoordinator::didSelectShippingMethod(const WebCore::PaymentRequest::ShippingMethod& shippingMethod)
+{
+ paymentCoordinator().didSelectShippingMethod(shippingMethod);
+}
+
+void WebPaymentCoordinator::didSelectShippingContact(const WebCore::PaymentContact& shippingContact)
+{
+ paymentCoordinator().didSelectShippingContact(shippingContact);
+}
+
+void WebPaymentCoordinator::didSelectPaymentMethod(const WebCore::PaymentMethod& paymentMethod)
+{
+ paymentCoordinator().didSelectPaymentMethod(paymentMethod);
+}
+
+void WebPaymentCoordinator::didCancelPayment()
+{
+ paymentCoordinator().didCancelPayment();
+}
+
+void WebPaymentCoordinator::canMakePaymentsWithActiveCardReply(uint64_t requestID, bool canMakePayments)
+{
+ auto callback = m_pendingCanMakePaymentsWithActiveCardCallbacks.take(requestID);
+ callback(canMakePayments);
+}
+
+WebCore::PaymentCoordinator& WebPaymentCoordinator::paymentCoordinator()
+{
+ return m_webPage.mainFrame()->paymentCoordinator();
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessApplePayWebPaymentCoordinatorh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.h (0 => 202432)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.h         (rev 0)
+++ trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.h        2016-06-24 18:31:05 UTC (rev 202432)
</span><span class="lines">@@ -0,0 +1,89 @@
</span><ins>+/*
+ * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(APPLE_PAY)
+
+#include "MessageReceiver.h"
+#include <WebCore/PaymentCoordinatorClient.h>
+#include <WebCore/PaymentHeaders.h>
+#include <wtf/Forward.h>
+#include <wtf/HashMap.h>
+
+namespace IPC {
+class DataReference;
+}
+
+namespace WebCore {
+class PaymentCoordinator;
+class PaymentContact;
+}
+
+namespace WebKit {
+
+class WebPage;
+
+class WebPaymentCoordinator final : public WebCore::PaymentCoordinatorClient, private IPC::MessageReceiver {
+public:
+ explicit WebPaymentCoordinator(WebPage&);
+ ~WebPaymentCoordinator();
+
+private:
+ // WebCore::PaymentCoordinatorClient.
+ bool supportsVersion(unsigned version) override;
+ bool canMakePayments() override;
+ void canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, std::function<void (bool)> completionHandler) override;
+ void showPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::PaymentRequest&) override;
+ void completeMerchantValidation(const WebCore::PaymentMerchantSession&) override;
+ void completeShippingMethodSelection(WebCore::PaymentAuthorizationStatus, Optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems) override;
+ void completeShippingContactSelection(WebCore::PaymentAuthorizationStatus, const Vector<WebCore::PaymentRequest::ShippingMethod>&, Optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems) override;
+ void completePaymentMethodSelection(Optional<WebCore::PaymentRequest::TotalAndLineItems>) override;
+ void completePaymentSession(WebCore::PaymentAuthorizationStatus) override;
+ void abortPaymentSession() override;
+
+ void mainFrameDestroyed() override;
+
+ // IPC::MessageReceiver.
+ void didReceiveMessage(IPC::Connection&, IPC::MessageDecoder&) override;
+
+ // Message handlers.
+ void validateMerchant(const String& validationURLString);
+ void didAuthorizePayment(const WebCore::Payment&);
+ void didSelectShippingMethod(const WebCore::PaymentRequest::ShippingMethod&);
+ void didSelectShippingContact(const WebCore::PaymentContact&);
+ void didSelectPaymentMethod(const WebCore::PaymentMethod&);
+ void didCancelPayment();
+ void canMakePaymentsWithActiveCardReply(uint64_t requestID, bool canMakePayments);
+
+ WebCore::PaymentCoordinator& paymentCoordinator();
+
+ WebPage& m_webPage;
+
+ HashMap<uint64_t, std::function<void (bool)>> m_pendingCanMakePaymentsWithActiveCardCallbacks;
+};
+
+}
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessApplePayWebPaymentCoordinatormessagesin"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.messages.in (0 => 202432)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.messages.in         (rev 0)
+++ trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.messages.in        2016-06-24 18:31:05 UTC (rev 202432)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+# Copyright (C) 2016 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+#/
+
+#if ENABLE(APPLE_PAY)
+
+messages -> WebPaymentCoordinator {
+
+ ValidateMerchant(String validationURLString)
+ DidAuthorizePayment(WebCore::Payment payment)
+ DidSelectShippingMethod(WebCore::PaymentRequest::ShippingMethod shippingMethod)
+ DidSelectShippingContact(WebCore::PaymentContact shippingContact)
+ DidSelectPaymentMethod(WebCore::PaymentMethod paymentMethod)
+ DidCancelPayment()
+ CanMakePaymentsWithActiveCardReply(uint64_t requestID, bool canMakePayments)
+}
+
+#endif
</ins></span></pre>
</div>
</div>
</body>
</html>