WebKit Bugzilla
Attachment 361229 Details for
Bug 194311
: [Payment Request] It should be possible to require a phonetic name for shipping contacts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194311-20190205153427.patch (text/plain), 55.58 KB, created by
Andy Estes
on 2019-02-05 15:34:28 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Andy Estes
Created:
2019-02-05 15:34:28 PST
Size:
55.58 KB
patch
obsolete
>Subversion Revision: 240997 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 9c8b0913f8c1d0cec8ca9973de66271f58cd518a..f7825fe28896af30c7f74a07163f39da09c885ec 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,50 @@ >+2019-02-05 Andy Estes <aestes@apple.com> >+ >+ [Payment Request] It should be possible to require a phonetic name for shipping contacts >+ https://bugs.webkit.org/show_bug.cgi?id=194311 >+ <rdar://46733045> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ It should be possible to require that a shipping contact has a phonetic name in Payment Request. >+ To accomplish this, move requiredShippingContactFields from ApplePayPaymentRequest to >+ ApplePayRequestBase so that it can be used as part of an Apple Pay payment method data. >+ >+ Since required shipping contact fields can now be specified both in >+ requiredShippingContactFields and PaymentOptions, we merge the required fields from these >+ two sources such that, e.g., email is required if it is specified in either place. >+ >+ So that clients can detect this new feature, the API version number is bumped from 5 to 6. >+ >+ Added test cases to ApplePayRequestShippingContact.https.html and ApplePayRequestShippingContactV3.https.html. >+ >+ * DerivedSources.make: >+ * Modules/applepay/ApplePayPaymentRequest.h: >+ * Modules/applepay/ApplePayPaymentRequest.idl: >+ * Modules/applepay/ApplePayRequestBase.cpp: >+ (WebCore::convertAndValidate): >+ * Modules/applepay/ApplePayRequestBase.h: >+ * Modules/applepay/ApplePayRequestBase.idl: >+ * Modules/applepay/ApplePaySession.cpp: >+ (WebCore::convertAndValidate): >+ * Modules/applepay/PaymentCoordinatorClient.cpp: Added. >+ (WebCore::PaymentCoordinatorClient::supportsVersion): >+ * Modules/applepay/PaymentCoordinatorClient.h: >+ * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: >+ (WebCore::mergePaymentOptions): >+ (WebCore::ApplePayPaymentHandler::show): >+ * SourcesCocoa.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * loader/EmptyClients.cpp: >+ * testing/MockPaymentContactFields.h: Added. >+ (WebCore::MockPaymentContactFields::MockPaymentContactFields): >+ * testing/MockPaymentContactFields.idl: Added. >+ * testing/MockPaymentCoordinator.cpp: >+ (WebCore::MockPaymentCoordinator::showPaymentUI): >+ (WebCore::MockPaymentCoordinator::supportsVersion): Deleted. >+ * testing/MockPaymentCoordinator.h: >+ * testing/MockPaymentCoordinator.idl: >+ > 2019-02-05 Keith Rollin <krollin@apple.com> > > Enable the automatic checking and regenerations of .xcfilelists during builds >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 4688d540c4d1804ae58cb05df12057550caa5be0..4563fe1d17681186562f3744a230b6618d8d9925 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,15 @@ >+2019-02-05 Andy Estes <aestes@apple.com> >+ >+ [Payment Request] It should be possible to require a phonetic name for shipping contacts >+ https://bugs.webkit.org/show_bug.cgi?id=194311 >+ <rdar://46733045> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebProcess/ApplePay/WebPaymentCoordinator.cpp: >+ (WebKit::WebPaymentCoordinator::supportsVersion): Deleted. >+ * WebProcess/ApplePay/WebPaymentCoordinator.h: >+ > 2019-02-05 Tim Horton <timothy_horton@apple.com> > > Reproducible crash under WKShareSheet presentWithParameters when cancelling a share >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 6ea34d36b496fb2996fcab22c7d8b933ef4727d0..a3fa2498e793d2277707be607b66a86f5b513628 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,15 @@ >+2019-02-05 Andy Estes <aestes@apple.com> >+ >+ [Payment Request] It should be possible to require a phonetic name for shipping contacts >+ https://bugs.webkit.org/show_bug.cgi?id=194311 >+ <rdar://46733045> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebCoreSupport/WebPaymentCoordinatorClient.h: >+ * WebCoreSupport/WebPaymentCoordinatorClient.mm: >+ (WebPaymentCoordinatorClient::supportsVersion): Deleted. >+ > 2019-02-04 Said Abou-Hallawa <said@apple.com> > > [CG] Enable setAdditionalSupportedImageTypes for WK1 >diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make >index bc3009ef50c964b6e6784ce82c07649cf7945edd..f2a311600493db50e4653a106009f053522d7533 100644 >--- a/Source/WebCore/DerivedSources.make >+++ b/Source/WebCore/DerivedSources.make >@@ -1050,6 +1050,7 @@ JS_BINDING_IDLS = \ > $(WebCore)/testing/MockContentFilterSettings.idl \ > $(WebCore)/testing/MockPageOverlay.idl \ > $(WebCore)/testing/MockPaymentAddress.idl \ >+ $(WebCore)/testing/MockPaymentContactFields.idl \ > $(WebCore)/testing/MockPaymentCoordinator.idl \ > $(WebCore)/testing/MockPaymentError.idl \ > $(WebCore)/testing/ServiceWorkerInternals.idl \ >diff --git a/Source/WebCore/Modules/applepay/ApplePayPaymentRequest.h b/Source/WebCore/Modules/applepay/ApplePayPaymentRequest.h >index e6fb6026b3da12904d2c879b4052afdb4a46b87f..3f0b66f17937aa41b4ec4fd81d78a80a0867ab9b 100644 >--- a/Source/WebCore/Modules/applepay/ApplePayPaymentRequest.h >+++ b/Source/WebCore/Modules/applepay/ApplePayPaymentRequest.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016-2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -40,8 +40,6 @@ struct ApplePayPaymentRequest : ApplePayRequestBase { > > String currencyCode; > >- Optional<Vector<ApplePayContactField>> requiredShippingContactFields; >- > ShippingType shippingType { ShippingType::Shipping }; > Optional<Vector<ApplePayShippingMethod>> shippingMethods; > >diff --git a/Source/WebCore/Modules/applepay/ApplePayPaymentRequest.idl b/Source/WebCore/Modules/applepay/ApplePayPaymentRequest.idl >index 0ec1927430f05bb1f0b4117cc03089047b409927..b826bee37424eeada1dd4d16da74879aeca2d0a4 100644 >--- a/Source/WebCore/Modules/applepay/ApplePayPaymentRequest.idl >+++ b/Source/WebCore/Modules/applepay/ApplePayPaymentRequest.idl >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016-2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -40,8 +40,6 @@ > > required DOMString currencyCode; > >- sequence<ApplePayContactField> requiredShippingContactFields; >- > ApplePayShippingType shippingType = "shipping"; > sequence<ApplePayShippingMethod> shippingMethods; > }; >diff --git a/Source/WebCore/Modules/applepay/ApplePayRequestBase.cpp b/Source/WebCore/Modules/applepay/ApplePayRequestBase.cpp >index 817d9fab113634d64eab5a750d0e0858bc7f1f61..d626c04a32f75d758ca0533db4de5a0eca4d5f56 100644 >--- a/Source/WebCore/Modules/applepay/ApplePayRequestBase.cpp >+++ b/Source/WebCore/Modules/applepay/ApplePayRequestBase.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016-2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -78,6 +78,13 @@ ExceptionOr<ApplePaySessionPaymentRequest> convertAndValidate(unsigned version, > > if (request.billingContact) > result.setBillingContact(PaymentContact::fromApplePayPaymentContact(version, *request.billingContact)); >+ >+ if (request.requiredShippingContactFields) { >+ auto requiredShippingContactFields = convertAndValidate(version, *request.requiredShippingContactFields); >+ if (requiredShippingContactFields.hasException()) >+ return requiredShippingContactFields.releaseException(); >+ result.setRequiredShippingContactFields(requiredShippingContactFields.releaseReturnValue()); >+ } > > if (request.shippingContact) > result.setShippingContact(PaymentContact::fromApplePayPaymentContact(version, *request.shippingContact)); >diff --git a/Source/WebCore/Modules/applepay/ApplePayRequestBase.h b/Source/WebCore/Modules/applepay/ApplePayRequestBase.h >index 2051189da97d2743db3b9d6ce911d0ec1ef0091f..68c66b864056df296aae4d4c6b11578a825120fe 100644 >--- a/Source/WebCore/Modules/applepay/ApplePayRequestBase.h >+++ b/Source/WebCore/Modules/applepay/ApplePayRequestBase.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016-2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -43,6 +43,7 @@ struct ApplePayRequestBase { > Optional<Vector<ApplePayContactField>> requiredBillingContactFields; > Optional<ApplePayPaymentContact> billingContact; > >+ Optional<Vector<ApplePayContactField>> requiredShippingContactFields; > Optional<ApplePayPaymentContact> shippingContact; > > String applicationData; >diff --git a/Source/WebCore/Modules/applepay/ApplePayRequestBase.idl b/Source/WebCore/Modules/applepay/ApplePayRequestBase.idl >index 8c1bf197563665109058bd400ce04b0f12fb331c..342b4086945e8d06d1e0d7f83c1996d1fbc9c6ff 100644 >--- a/Source/WebCore/Modules/applepay/ApplePayRequestBase.idl >+++ b/Source/WebCore/Modules/applepay/ApplePayRequestBase.idl >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016-2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -33,6 +33,7 @@ > sequence<ApplePayContactField> requiredBillingContactFields; > ApplePayPaymentContact billingContact; > >+ sequence<ApplePayContactField> requiredShippingContactFields; > ApplePayPaymentContact shippingContact; > > DOMString applicationData; >diff --git a/Source/WebCore/Modules/applepay/ApplePaySession.cpp b/Source/WebCore/Modules/applepay/ApplePaySession.cpp >index 06c0fae67f30e6876608b1f73dabc94bc4e66a33..c673fccc1b30570b7fa2badc2c01b0e3fdd45139 100644 >--- a/Source/WebCore/Modules/applepay/ApplePaySession.cpp >+++ b/Source/WebCore/Modules/applepay/ApplePaySession.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2015-2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -227,13 +227,6 @@ static ExceptionOr<ApplePaySessionPaymentRequest> convertAndValidate(unsigned ve > return lineItems.releaseException(); > result.setLineItems(lineItems.releaseReturnValue()); > >- if (paymentRequest.requiredShippingContactFields) { >- auto requiredShippingContactFields = convertAndValidate(version, WTFMove(*paymentRequest.requiredShippingContactFields)); >- if (requiredShippingContactFields.hasException()) >- return requiredShippingContactFields.releaseException(); >- result.setRequiredShippingContactFields(requiredShippingContactFields.releaseReturnValue()); >- } >- > result.setShippingType(paymentRequest.shippingType); > > if (paymentRequest.shippingMethods) { >diff --git a/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.cpp b/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..f6682f3f9d5af3a492346ef5a4a98db5e3d0fcc5 >--- /dev/null >+++ b/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.cpp >@@ -0,0 +1,50 @@ >+/* >+ * Copyright (C) 2015-2019 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 "PaymentCoordinatorClient.h" >+ >+#if ENABLE(APPLE_PAY) >+ >+namespace WebCore { >+ >+bool PaymentCoordinatorClient::supportsVersion(unsigned version) >+{ >+ ASSERT(version > 0); >+ >+#if !ENABLE(APPLE_PAY_SESSION_V3) >+ static const unsigned currentVersion = 2; >+#elif !ENABLE(APPLE_PAY_SESSION_V4) >+ static const unsigned currentVersion = 3; >+#else >+ static const unsigned currentVersion = 6; >+#endif >+ >+ return version <= currentVersion; >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(APPLE_PAY) >diff --git a/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h b/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h >index 170a4f3d35c0c9f1c2271a6910791e6751c9cd05..35ac0d131dcfc9d51c86c684f9aa92645a20dec8 100644 >--- a/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h >+++ b/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2015-2018 Apple Inc. All rights reserved. >+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -45,7 +45,8 @@ struct ShippingMethodUpdate; > > class PaymentCoordinatorClient { > public: >- virtual bool supportsVersion(unsigned version) = 0; >+ bool supportsVersion(unsigned version); >+ > virtual Optional<String> validatedPaymentNetwork(const String&) = 0; > virtual bool canMakePayments() = 0; > virtual void canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler) = 0; >diff --git a/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp b/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp >index ea44d5f8e14987467d6f2e912847bc185ed70042..da71c2fac52a40f39c28338a81ba94774684a451 100644 >--- a/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp >+++ b/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017-2018 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -129,16 +129,6 @@ static ExceptionOr<Vector<ApplePaySessionPaymentRequest::LineItem>> convertAndVa > return { WTFMove(result) }; > } > >-static ApplePaySessionPaymentRequest::ContactFields convert(const PaymentOptions& options) >-{ >- ApplePaySessionPaymentRequest::ContactFields result; >- result.email = options.requestPayerEmail; >- result.name = options.requestPayerName; >- result.phone = options.requestPayerPhone; >- result.postalAddress = options.requestShipping; >- return result; >-} >- > static ApplePaySessionPaymentRequest::ShippingType convert(PaymentShippingType type) > { > switch (type) { >@@ -182,6 +172,19 @@ ExceptionOr<void> ApplePayPaymentHandler::convertData(JSC::JSValue&& data) > return { }; > } > >+static void mergePaymentOptions(const PaymentOptions& options, ApplePaySessionPaymentRequest& request) >+{ >+ auto requiredShippingContactFields = request.requiredShippingContactFields(); >+ requiredShippingContactFields.email |= options.requestPayerEmail; >+ requiredShippingContactFields.name |= options.requestPayerName; >+ requiredShippingContactFields.phone |= options.requestPayerPhone; >+ requiredShippingContactFields.postalAddress |= options.requestShipping; >+ request.setRequiredShippingContactFields(requiredShippingContactFields); >+ >+ if (options.requestShipping) >+ request.setShippingType(convert(options.shippingType)); >+} >+ > ExceptionOr<void> ApplePayPaymentHandler::show() > { > auto validatedRequest = convertAndValidate(m_applePayRequest->version, *m_applePayRequest, paymentCoordinator()); >@@ -203,9 +206,7 @@ ExceptionOr<void> ApplePayPaymentHandler::show() > return convertedLineItems.releaseException(); > request.setLineItems(convertedLineItems.releaseReturnValue()); > >- request.setRequiredShippingContactFields(convert(m_paymentRequest->paymentOptions())); >- if (m_paymentRequest->paymentOptions().requestShipping) >- request.setShippingType(convert(m_paymentRequest->paymentOptions().shippingType)); >+ mergePaymentOptions(m_paymentRequest->paymentOptions(), request); > > auto shippingMethods = computeShippingMethods(); > if (shippingMethods.hasException()) >diff --git a/Source/WebCore/SourcesCocoa.txt b/Source/WebCore/SourcesCocoa.txt >index 0722288da1c8935a78f7e192096a7ad8572e8043..a07b26d015f105b104f4f400cade25c7f6f7c747 100644 >--- a/Source/WebCore/SourcesCocoa.txt >+++ b/Source/WebCore/SourcesCocoa.txt >@@ -1,4 +1,4 @@ >-// Copyright (C) 2017-2018 Apple Inc. All rights reserved. >+// Copyright (C) 2017-2019 Apple Inc. All rights reserved. > // > // Redistribution and use in source and binary forms, with or without > // modification, are permitted provided that the following conditions >@@ -588,6 +588,7 @@ platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp > Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp > Modules/applepay/ApplePayValidateMerchantEvent.cpp > Modules/applepay/PaymentCoordinator.cpp >+ Modules/applepay/PaymentCoordinatorClient.cpp > Modules/applepay/PaymentRequestValidator.mm > Modules/applepay/PaymentSession.cpp > >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index dab111437bd5c3799ebf0bad1a4121017fdef197..10cae9239da21735ea9290a3e7829183f8bd01ae 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -2942,6 +2942,9 @@ > A0EE0DF6144F825500F80B0D /* WebGLDebugRendererInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = A0EE0DF2144F825500F80B0D /* WebGLDebugRendererInfo.h */; }; > A0EE0DF7144F825500F80B0D /* WebGLDebugShaders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0EE0DF3144F825500F80B0D /* WebGLDebugShaders.cpp */; }; > A0EE0DF8144F825500F80B0D /* WebGLDebugShaders.h in Headers */ = {isa = PBXBuildFile; fileRef = A0EE0DF4144F825500F80B0D /* WebGLDebugShaders.h */; }; >+ A104EC5A220A3DE000CBF67A /* MockPaymentContactFields.h in Headers */ = {isa = PBXBuildFile; fileRef = A104EC55220A39B400CBF67A /* MockPaymentContactFields.h */; }; >+ A104EC5D220A3E4B00CBF67A /* JSMockPaymentContactFields.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A104EC5B220A3E4300CBF67A /* JSMockPaymentContactFields.cpp */; }; >+ A104EC5E220A3E4E00CBF67A /* JSMockPaymentContactFields.h in Headers */ = {isa = PBXBuildFile; fileRef = A104EC5C220A3E4400CBF67A /* JSMockPaymentContactFields.h */; }; > A104F24414C71F7A009E2C23 /* CachedSVGDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = A104F24214C71F7A009E2C23 /* CachedSVGDocument.h */; settings = {ATTRIBUTES = (Private, ); }; }; > A10BB5851484E3A700B2E87A /* RenderSVGRect.h in Headers */ = {isa = PBXBuildFile; fileRef = A10BB5831484E3A700B2E87A /* RenderSVGRect.h */; }; > A10BB58B1484E3B300B2E87A /* RenderSVGShape.h in Headers */ = {isa = PBXBuildFile; fileRef = A10BB5891484E3B300B2E87A /* RenderSVGShape.h */; }; >@@ -11139,6 +11142,11 @@ > A0EE0DF2144F825500F80B0D /* WebGLDebugRendererInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLDebugRendererInfo.h; sourceTree = "<group>"; }; > A0EE0DF3144F825500F80B0D /* WebGLDebugShaders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebGLDebugShaders.cpp; sourceTree = "<group>"; }; > A0EE0DF4144F825500F80B0D /* WebGLDebugShaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLDebugShaders.h; sourceTree = "<group>"; }; >+ A104EC53220A017400CBF67A /* PaymentCoordinatorClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PaymentCoordinatorClient.cpp; sourceTree = "<group>"; }; >+ A104EC55220A39B400CBF67A /* MockPaymentContactFields.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MockPaymentContactFields.h; sourceTree = "<group>"; }; >+ A104EC57220A39B400CBF67A /* MockPaymentContactFields.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = MockPaymentContactFields.idl; sourceTree = "<group>"; }; >+ A104EC5B220A3E4300CBF67A /* JSMockPaymentContactFields.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSMockPaymentContactFields.cpp; sourceTree = "<group>"; }; >+ A104EC5C220A3E4400CBF67A /* JSMockPaymentContactFields.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSMockPaymentContactFields.h; sourceTree = "<group>"; }; > A104F24114C71F7A009E2C23 /* CachedSVGDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedSVGDocument.cpp; sourceTree = "<group>"; }; > A104F24214C71F7A009E2C23 /* CachedSVGDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedSVGDocument.h; sourceTree = "<group>"; }; > A10BB5821484E3A700B2E87A /* RenderSVGRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGRect.cpp; sourceTree = "<group>"; }; >@@ -16747,6 +16755,7 @@ > 1A8A64381D19FC5300D0E00F /* PaymentContact.h */, > 1A58E86B1D19E42D00C0EA73 /* PaymentCoordinator.cpp */, > 1A58E86C1D19E42D00C0EA73 /* PaymentCoordinator.h */, >+ A104EC53220A017400CBF67A /* PaymentCoordinatorClient.cpp */, > 1A58E8621D19D3BF00C0EA73 /* PaymentCoordinatorClient.h */, > 7CF930E61E01F9AD00BAFFBE /* PaymentHeaders.h */, > 1AE96A871D1A0CEB00B86768 /* PaymentMerchantSession.h */, >@@ -17853,6 +17862,8 @@ > A146D31C1F99C9C200D29196 /* MockPaymentAddress.h */, > A146D31E1F99C9C200D29196 /* MockPaymentAddress.idl */, > A146D3241F99D69800D29196 /* MockPaymentContact.h */, >+ A104EC55220A39B400CBF67A /* MockPaymentContactFields.h */, >+ A104EC57220A39B400CBF67A /* MockPaymentContactFields.idl */, > A1AFEDE51F8BFF6D0087013F /* MockPaymentCoordinator.cpp */, > A1AFEDE41F8BFF6D0087013F /* MockPaymentCoordinator.h */, > A146D3161F99B53D00D29196 /* MockPaymentCoordinator.idl */, >@@ -17894,6 +17905,8 @@ > 2D6F3E931C1F85550061DBD4 /* JSMockPageOverlay.h */, > A146D3201F99CA3E00D29196 /* JSMockPaymentAddress.cpp */, > A146D31F1F99CA3D00D29196 /* JSMockPaymentAddress.h */, >+ A104EC5B220A3E4300CBF67A /* JSMockPaymentContactFields.cpp */, >+ A104EC5C220A3E4400CBF67A /* JSMockPaymentContactFields.h */, > A146D3191F99BCBB00D29196 /* JSMockPaymentCoordinator.cpp */, > A146D3181F99BCBA00D29196 /* JSMockPaymentCoordinator.h */, > A1BB85B42159B3890067E07D /* JSMockPaymentError.cpp */, >@@ -28249,6 +28262,7 @@ > A19AEA211AAA808600B52B25 /* JSMockContentFilterSettings.h in Headers */, > 538EC9341F99B9F7004D22A8 /* JSMockPageOverlay.h in Headers */, > A146D3231F99D0EF00D29196 /* JSMockPaymentAddress.h in Headers */, >+ A104EC5E220A3E4E00CBF67A /* JSMockPaymentContactFields.h in Headers */, > A146D31B1F99BCFB00D29196 /* JSMockPaymentCoordinator.h in Headers */, > A1BB85B92159B3AE0067E07D /* JSMockPaymentError.h in Headers */, > 427DA71E13735DFA007C57FB /* JSServiceWorkerInternals.h in Headers */, >@@ -28264,6 +28278,7 @@ > A14BB0A01F9813B800605A35 /* MockPayment.h in Headers */, > A146D3211F99CB1A00D29196 /* MockPaymentAddress.h in Headers */, > A146D3251F99D69800D29196 /* MockPaymentContact.h in Headers */, >+ A104EC5A220A3DE000CBF67A /* MockPaymentContactFields.h in Headers */, > A1AFEDE61F8BFF6D0087013F /* MockPaymentCoordinator.h in Headers */, > A1CBEF641F9F11290028DE7C /* MockPaymentMethod.h in Headers */, > A140618C1E2ECA0A0032B34E /* MockPreviewLoaderClient.h in Headers */, >@@ -32823,6 +32838,7 @@ > A19AEA221AAA808A00B52B25 /* JSMockContentFilterSettings.cpp in Sources */, > 2D4150DE1C1F868C000A3BA2 /* JSMockPageOverlay.cpp in Sources */, > A146D3221F99D0EC00D29196 /* JSMockPaymentAddress.cpp in Sources */, >+ A104EC5D220A3E4B00CBF67A /* JSMockPaymentContactFields.cpp in Sources */, > A146D31A1F99BCF800D29196 /* JSMockPaymentCoordinator.cpp in Sources */, > A1BB85B82159B3A40067E07D /* JSMockPaymentError.cpp in Sources */, > 427DA71D13735DFA007C57FB /* JSServiceWorkerInternals.cpp in Sources */, >diff --git a/Source/WebCore/loader/EmptyClients.cpp b/Source/WebCore/loader/EmptyClients.cpp >index b58322168ff5aa4db2c8b3d4cff89e53be29c96a..fb02baf6755590846fc0279a333aca3c1fd07093 100644 >--- a/Source/WebCore/loader/EmptyClients.cpp >+++ b/Source/WebCore/loader/EmptyClients.cpp >@@ -1,6 +1,6 @@ > /* > * Copyright (C) 2006 Eric Seidel <eric@webkit.org> >- * Copyright (C) 2008-2018 Apple Inc. All rights reserved. >+ * Copyright (C) 2008-2019 Apple Inc. All rights reserved. > * Copyright (C) Research In Motion Limited 2011. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without >@@ -312,7 +312,6 @@ class EmptyInspectorClient final : public InspectorClient { > #if ENABLE(APPLE_PAY) > > class EmptyPaymentCoordinatorClient final : public PaymentCoordinatorClient { >- bool supportsVersion(unsigned) final { return false; } > Optional<String> validatedPaymentNetwork(const String&) final { return WTF::nullopt; } > bool canMakePayments() final { return false; } > void canMakePaymentsWithActiveCard(const String&, const String&, WTF::Function<void(bool)>&& completionHandler) final { callOnMainThread([completionHandler = WTFMove(completionHandler)] { completionHandler(false); }); } >diff --git a/Source/WebCore/testing/MockPaymentContactFields.h b/Source/WebCore/testing/MockPaymentContactFields.h >new file mode 100644 >index 0000000000000000000000000000000000000000..b9845363fa029d8b641e2a5a0ab2ab7ef1f07889 >--- /dev/null >+++ b/Source/WebCore/testing/MockPaymentContactFields.h >@@ -0,0 +1,44 @@ >+/* >+ * Copyright (C) 2019 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 "ApplePaySessionPaymentRequest.h" >+ >+namespace WebCore { >+ >+struct MockPaymentContactFields : public ApplePaySessionPaymentRequest::ContactFields { >+ MockPaymentContactFields() = default; >+ MockPaymentContactFields(const ApplePaySessionPaymentRequest::ContactFields& contactFields) >+ : ApplePaySessionPaymentRequest::ContactFields { contactFields } >+ { >+ } >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(APPLE_PAY) >diff --git a/Source/WebCore/testing/MockPaymentContactFields.idl b/Source/WebCore/testing/MockPaymentContactFields.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..649173478af3995773eb9be1430eb640aeb22b1c >--- /dev/null >+++ b/Source/WebCore/testing/MockPaymentContactFields.idl >@@ -0,0 +1,35 @@ >+/* >+ * Copyright (C) 2019 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. >+ */ >+ >+[ >+ Conditional=APPLE_PAY, >+ JSGenerateToJSObject, >+] dictionary MockPaymentContactFields { >+ boolean postalAddress = false; >+ boolean phone = false; >+ boolean email = false; >+ boolean name = false; >+ boolean phoneticName = false; >+}; >diff --git a/Source/WebCore/testing/MockPaymentCoordinator.cpp b/Source/WebCore/testing/MockPaymentCoordinator.cpp >index 38241b7d0e649199ee37a3faf5d1e8b013fa8eb0..661f18057d017a5dbddde8958d3158719b6f7026 100644 >--- a/Source/WebCore/testing/MockPaymentCoordinator.cpp >+++ b/Source/WebCore/testing/MockPaymentCoordinator.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017-2018 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -53,21 +53,6 @@ MockPaymentCoordinator::MockPaymentCoordinator(Page& page) > m_availablePaymentNetworks.add("visa"); > } > >-bool MockPaymentCoordinator::supportsVersion(unsigned version) >-{ >- ASSERT(version > 0); >- >-#if !ENABLE(APPLE_PAY_SESSION_V3) >- static const unsigned currentVersion = 2; >-#elif !ENABLE(APPLE_PAY_SESSION_V4) >- static const unsigned currentVersion = 3; >-#else >- static const unsigned currentVersion = 5; >-#endif >- >- return version <= currentVersion; >-} >- > Optional<String> MockPaymentCoordinator::validatedPaymentNetwork(const String& paymentNetwork) > { > auto result = m_availablePaymentNetworks.find(paymentNetwork); >@@ -119,6 +104,8 @@ bool MockPaymentCoordinator::showPaymentUI(const URL&, const Vector<URL>&, const > if (request.shippingContact().pkContact()) > m_shippingAddress = request.shippingContact().toApplePayPaymentContact(request.version()); > m_shippingMethods = convert(request.shippingMethods()); >+ m_requiredBillingContactFields = request.requiredBillingContactFields(); >+ m_requiredShippingContactFields = request.requiredShippingContactFields(); > > ASSERT(showCount == hideCount); > ++showCount; >diff --git a/Source/WebCore/testing/MockPaymentCoordinator.h b/Source/WebCore/testing/MockPaymentCoordinator.h >index 8de2a870ed4da7fe1d90cb6c2a61237583b7610f..a54c21a711d4c1fa6d2e53a6dbd69562d5274f5c 100644 >--- a/Source/WebCore/testing/MockPaymentCoordinator.h >+++ b/Source/WebCore/testing/MockPaymentCoordinator.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017-2018 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -30,6 +30,7 @@ > #include "ApplePayLineItem.h" > #include "ApplePayShippingMethod.h" > #include "MockPaymentAddress.h" >+#include "MockPaymentContactFields.h" > #include "MockPaymentError.h" > #include "PaymentCoordinatorClient.h" > #include <wtf/HashSet.h> >@@ -56,12 +57,13 @@ public: > const Vector<ApplePayLineItem>& lineItems() const { return m_lineItems; } > const Vector<MockPaymentError>& errors() const { return m_errors; } > const Vector<ApplePayShippingMethod>& shippingMethods() const { return m_shippingMethods; } >+ const MockPaymentContactFields& requiredBillingContactFields() const { return m_requiredBillingContactFields; } >+ const MockPaymentContactFields& requiredShippingContactFields() const { return m_requiredShippingContactFields; } > > void ref() const { } > void deref() const { } > > private: >- bool supportsVersion(unsigned) final; > Optional<String> validatedPaymentNetwork(const String&) final; > bool canMakePayments() final; > void canMakePaymentsWithActiveCard(const String&, const String&, WTF::Function<void(bool)>&&); >@@ -89,6 +91,8 @@ private: > Vector<MockPaymentError> m_errors; > Vector<ApplePayShippingMethod> m_shippingMethods; > HashSet<String, ASCIICaseInsensitiveHash> m_availablePaymentNetworks; >+ MockPaymentContactFields m_requiredBillingContactFields; >+ MockPaymentContactFields m_requiredShippingContactFields; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/testing/MockPaymentCoordinator.idl b/Source/WebCore/testing/MockPaymentCoordinator.idl >index 702d5953a9a8d20f73850eee1f0229eaeb9382f6..785546d2f4a48fc900f6d6ef75c592d410c45e74 100644 >--- a/Source/WebCore/testing/MockPaymentCoordinator.idl >+++ b/Source/WebCore/testing/MockPaymentCoordinator.idl >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017-2018 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -39,4 +39,6 @@ > readonly attribute sequence<ApplePayLineItem> lineItems; > readonly attribute sequence<MockPaymentError> errors; > readonly attribute sequence<ApplePayShippingMethod> shippingMethods; >+ readonly attribute MockPaymentContactFields requiredBillingContactFields; >+ readonly attribute MockPaymentContactFields requiredShippingContactFields; > }; >diff --git a/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp b/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp >index 3fcccb488fd6cc05f00e1368d5b1d1e318a3ea21..b375c8e421e9e67b84f68fba4dc7f26e659debc9 100644 >--- a/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp >+++ b/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2015-2018 Apple Inc. All rights reserved. >+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -51,21 +51,6 @@ WebPaymentCoordinator::~WebPaymentCoordinator() > WebProcess::singleton().removeMessageReceiver(*this); > } > >-bool WebPaymentCoordinator::supportsVersion(unsigned version) >-{ >- ASSERT(version > 0); >- >-#if !ENABLE(APPLE_PAY_SESSION_V3) >- static const unsigned currentVersion = 2; >-#elif !ENABLE(APPLE_PAY_SESSION_V4) >- static const unsigned currentVersion = 3; >-#else >- static const unsigned currentVersion = 5; >-#endif >- >- return version <= currentVersion; >-} >- > const WebPaymentCoordinator::AvailablePaymentNetworksSet& WebPaymentCoordinator::availablePaymentNetworks() > { > if (m_availablePaymentNetworks) >diff --git a/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h b/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h >index 2fe5ec7cb24f424f30657af1ae1bc66f85705fb5..67105440ddc82336b21ec23f575ed2066a3cebc4 100644 >--- a/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h >+++ b/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2015-2018 Apple Inc. All rights reserved. >+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -55,7 +55,6 @@ public: > > private: > // WebCore::PaymentCoordinatorClient. >- bool supportsVersion(unsigned version) override; > Optional<String> validatedPaymentNetwork(const String&) override; > bool canMakePayments() override; > void canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler) override; >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.h b/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.h >index 09da2ee9eff4c0a7a7ebf21e30b44054eea6c049..ec0c34a6958bab42341ecd050a227d9808bf5569 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.h >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2015-2018 Apple Inc. All rights reserved. >+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -36,7 +36,6 @@ public: > private: > ~WebPaymentCoordinatorClient(); > >- bool supportsVersion(unsigned) override; > Optional<String> validatedPaymentNetwork(const String&) override; > bool canMakePayments() override; > void canMakePaymentsWithActiveCard(const String&, const String&, WTF::Function<void (bool)>&& completionHandler) override; >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm >index 3b33f49f2190ca5bcdcd941930b0ca63be6b1ba4..a56543541ff77954d7506a3b46ff01be822564f9 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2015-2018 Apple Inc. All rights reserved. >+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -38,11 +38,6 @@ WebPaymentCoordinatorClient::~WebPaymentCoordinatorClient() > { > } > >-bool WebPaymentCoordinatorClient::supportsVersion(unsigned) >-{ >- return false; >-} >- > Optional<String> WebPaymentCoordinatorClient::validatedPaymentNetwork(const String&) > { > return WTF::nullopt; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 74908a7fa06567b5bd8e5dc2c62e2aca801455b4..c14c5000f41bef1391396688b1b2b75f545d7603 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,18 @@ >+2019-02-05 Andy Estes <aestes@apple.com> >+ >+ [Payment Request] It should be possible to require a phonetic name for shipping contacts >+ https://bugs.webkit.org/show_bug.cgi?id=194311 >+ <rdar://46733045> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * http/tests/ssl/applepay/ApplePayRequestShippingContact.https-expected.txt: >+ * http/tests/ssl/applepay/ApplePayRequestShippingContact.https.html: >+ * http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https-expected.txt: >+ * http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https.html: >+ * http/tests/ssl/applepay/PaymentRequest.https-expected.txt: >+ * http/tests/ssl/applepay/PaymentRequest.https.html: >+ > 2019-02-05 Nikita Vasilyev <nvasilyev@apple.com> > > Web Inspector: Fix modify-css-property-race.html test failures >diff --git a/LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContact.https-expected.txt b/LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContact.https-expected.txt >index 2e87a3caa9d257f25eb9770616e4aec9f7bf7d0f..864e468b9aa82767cb81db76d9e92d6273436fe5 100644 >--- a/LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContact.https-expected.txt >+++ b/LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContact.https-expected.txt >@@ -3,6 +3,16 @@ Test ApplePayRequest.shippingContact. > On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". > > >+Test setting required contact fields in a version 2 request. >+PASS internals.mockPaymentCoordinator.requiredBillingContactFields.name is true >+PASS internals.mockPaymentCoordinator.requiredBillingContactFields.email is true >+PASS internals.mockPaymentCoordinator.requiredBillingContactFields.phone is true >+PASS internals.mockPaymentCoordinator.requiredBillingContactFields.postalAddress is true >+PASS internals.mockPaymentCoordinator.requiredShippingContactFields.name is true >+PASS internals.mockPaymentCoordinator.requiredShippingContactFields.email is true >+PASS internals.mockPaymentCoordinator.requiredShippingContactFields.phone is true >+PASS internals.mockPaymentCoordinator.requiredShippingContactFields.postalAddress is true >+ > Test setting a default shipping contact in a version 2 request. > PASS paymentResponse.details.shippingContact.phoneNumber is expectedPhoneNumber > PASS paymentResponse.details.shippingContact.emailAddress is expectedEmailAddress >diff --git a/LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContact.https.html b/LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContact.https.html >index 33e2089379c2822949094d349371ceb066b87557..e1bd03ff30738542220b785daf1de4329ec902a2 100644 >--- a/LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContact.https.html >+++ b/LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContact.https.html >@@ -82,6 +82,39 @@ function validPaymentOptions() { > } > > async function runTests() { >+ await new Promise((resolve, reject) => { >+ debug("Test setting required contact fields in a version 2 request."); >+ >+ var paymentMethod = validPaymentMethod(2, validShippingContact()); >+ paymentMethod.data.requiredBillingContactFields = ["email", "name", "phone", "postalAddress"]; >+ paymentMethod.data.requiredShippingContactFields = ["email"]; >+ >+ var paymentOptions = validPaymentOptions(); >+ paymentOptions.email = false; >+ >+ var paymentRequest = new PaymentRequest([paymentMethod], validPaymentDetails(), paymentOptions); >+ >+ activateThen(() => { >+ paymentRequest.show().then((response) => { >+ shouldBe("internals.mockPaymentCoordinator.requiredBillingContactFields.name", "true"); >+ shouldBe("internals.mockPaymentCoordinator.requiredBillingContactFields.email", "true"); >+ shouldBe("internals.mockPaymentCoordinator.requiredBillingContactFields.phone", "true"); >+ shouldBe("internals.mockPaymentCoordinator.requiredBillingContactFields.postalAddress", "true"); >+ >+ shouldBe("internals.mockPaymentCoordinator.requiredShippingContactFields.name", "true"); >+ shouldBe("internals.mockPaymentCoordinator.requiredShippingContactFields.email", "true"); >+ shouldBe("internals.mockPaymentCoordinator.requiredShippingContactFields.phone", "true"); >+ shouldBe("internals.mockPaymentCoordinator.requiredShippingContactFields.postalAddress", "true"); >+ >+ response.complete("success"); >+ resolve(); >+ }); >+ >+ internals.mockPaymentCoordinator.acceptPayment(); >+ }); >+ }); >+ debug(""); >+ > await new Promise((resolve, reject) => { > debug("Test setting a default shipping contact in a version 2 request."); > >diff --git a/LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https-expected.txt b/LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https-expected.txt >index 00bf674abba2d4f6fa35cdba7de8aaf519fcec23..0f86536c8b9c166a909bf7a1edd5ee1176018c9b 100644 >--- a/LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https-expected.txt >+++ b/LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https-expected.txt >@@ -3,6 +3,18 @@ Test ApplePayRequest.shippingContact. > On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". > > >+Test setting required contact fields in a version 3 request. >+PASS internals.mockPaymentCoordinator.requiredBillingContactFields.name is true >+PASS internals.mockPaymentCoordinator.requiredBillingContactFields.phoneticName is true >+PASS internals.mockPaymentCoordinator.requiredBillingContactFields.email is true >+PASS internals.mockPaymentCoordinator.requiredBillingContactFields.phone is true >+PASS internals.mockPaymentCoordinator.requiredBillingContactFields.postalAddress is true >+PASS internals.mockPaymentCoordinator.requiredShippingContactFields.name is true >+PASS internals.mockPaymentCoordinator.requiredShippingContactFields.phoneticName is true >+PASS internals.mockPaymentCoordinator.requiredShippingContactFields.email is true >+PASS internals.mockPaymentCoordinator.requiredShippingContactFields.phone is true >+PASS internals.mockPaymentCoordinator.requiredShippingContactFields.postalAddress is true >+ > Test setting a default shipping contact in a version 3 request. > PASS paymentResponse.details.shippingContact.phoneticGivenName is expectedGivenName > PASS paymentResponse.details.shippingContact.phoneticFamilyName is expectedFamilyName >diff --git a/LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https.html b/LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https.html >index da7184cfa623892effc097859c26e25166b0ee74..d4fab63af2e42492f56a23061635614ef316a262 100644 >--- a/LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https.html >+++ b/LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https.html >@@ -82,6 +82,38 @@ function validPaymentOptions() { > } > > async function runTests() { >+ await new Promise((resolve, reject) => { >+ debug("Test setting required contact fields in a version 3 request."); >+ >+ var paymentMethod = validPaymentMethod(3, validShippingContact()); >+ paymentMethod.data.requiredBillingContactFields = ["email", "name", "phoneticName", "phone", "postalAddress"]; >+ paymentMethod.data.requiredShippingContactFields = ["phoneticName"]; >+ >+ var paymentRequest = new PaymentRequest([paymentMethod], validPaymentDetails(), validPaymentOptions()); >+ >+ activateThen(() => { >+ paymentRequest.show().then((response) => { >+ shouldBe("internals.mockPaymentCoordinator.requiredBillingContactFields.name", "true"); >+ shouldBe("internals.mockPaymentCoordinator.requiredBillingContactFields.phoneticName", "true"); >+ shouldBe("internals.mockPaymentCoordinator.requiredBillingContactFields.email", "true"); >+ shouldBe("internals.mockPaymentCoordinator.requiredBillingContactFields.phone", "true"); >+ shouldBe("internals.mockPaymentCoordinator.requiredBillingContactFields.postalAddress", "true"); >+ >+ shouldBe("internals.mockPaymentCoordinator.requiredShippingContactFields.name", "true"); >+ shouldBe("internals.mockPaymentCoordinator.requiredShippingContactFields.phoneticName", "true"); >+ shouldBe("internals.mockPaymentCoordinator.requiredShippingContactFields.email", "true"); >+ shouldBe("internals.mockPaymentCoordinator.requiredShippingContactFields.phone", "true"); >+ shouldBe("internals.mockPaymentCoordinator.requiredShippingContactFields.postalAddress", "true"); >+ >+ response.complete("success"); >+ resolve(); >+ }); >+ >+ internals.mockPaymentCoordinator.acceptPayment(); >+ }); >+ }); >+ debug(""); >+ > await new Promise((resolve, reject) => { > debug("Test setting a default shipping contact in a version 3 request."); > >diff --git a/LayoutTests/http/tests/ssl/applepay/PaymentRequest.https-expected.txt b/LayoutTests/http/tests/ssl/applepay/PaymentRequest.https-expected.txt >index f26c86851a03d3a2cf49d78dd926674e7f6e6fb4..c9c4b0e66e4dde974a178fb2413b66f47bd38a5e 100644 >--- a/LayoutTests/http/tests/ssl/applepay/PaymentRequest.https-expected.txt >+++ b/LayoutTests/http/tests/ssl/applepay/PaymentRequest.https-expected.txt >@@ -124,6 +124,43 @@ PASS new PaymentRequest([paymentMethod], validPaymentDetails()); request.show() > SETUP: paymentMethod = validPaymentMethod(); paymentMethod.data.billingContact = 7; > PASS new PaymentRequest([paymentMethod], validPaymentDetails()); request.show() rejected promise with InvalidStateError: The object is in an invalid state.. > >+Testing ApplePayRequest.requiredShippingContactFields >+ >+SETUP: paymentMethod = validPaymentMethod(); paymentMethod.data.requiredShippingContactFields = ''; >+PASS request = new PaymentRequest([paymentMethod], validPaymentDetails()); request.show() rejected promise with TypeError: Value is not a sequence. >+ >+SETUP: paymentMethod = validPaymentMethod(); paymentMethod.data.requiredShippingContactFields = null; >+PASS request = new PaymentRequest([paymentMethod], validPaymentDetails()); request.show() rejected promise with TypeError: Value is not a sequence. >+ >+SETUP: paymentMethod = validPaymentMethod(); paymentMethod.data.requiredShippingContactFields = 7; >+PASS request = new PaymentRequest([paymentMethod], validPaymentDetails()); request.show() rejected promise with TypeError: Value is not a sequence. >+ >+SETUP: paymentMethod = validPaymentMethod(); paymentMethod.data.requiredShippingContactFields = { }; >+PASS request = new PaymentRequest([paymentMethod], validPaymentDetails()); request.show() rejected promise with TypeError: Type error. >+ >+SETUP: paymentMethod = validPaymentMethod(); paymentMethod.data.requiredShippingContactFields = ['']; >+PASS request = new PaymentRequest([paymentMethod], validPaymentDetails()); request.show() rejected promise with TypeError: Type error. >+ >+SETUP: paymentMethod = validPaymentMethod(); paymentMethod.data.requiredShippingContactFields = [null]; >+PASS request = new PaymentRequest([paymentMethod], validPaymentDetails()); request.show() rejected promise with TypeError: Type error. >+ >+SETUP: paymentMethod = validPaymentMethod(); paymentMethod.data.requiredShippingContactFields = [undefined]; >+PASS request = new PaymentRequest([paymentMethod], validPaymentDetails()); request.show() rejected promise with TypeError: Type error. >+ >+SETUP: paymentMethod = validPaymentMethod(); paymentMethod.data.requiredShippingContactFields = [{}]; >+PASS request = new PaymentRequest([paymentMethod], validPaymentDetails()); request.show() rejected promise with TypeError: Type error. >+ >+SETUP: paymentMethod = validPaymentMethod(); paymentMethod.data.requiredShippingContactFields = ['invalid']; >+PASS request = new PaymentRequest([paymentMethod], validPaymentDetails()); request.show() rejected promise with TypeError: Type error. >+ >+Testing ApplePayRequest.shippingContact >+ >+SETUP: paymentMethod = validPaymentMethod(); paymentMethod.data.shippingContact = ''; >+PASS new PaymentRequest([paymentMethod], validPaymentDetails()); request.show() rejected promise with InvalidStateError: The object is in an invalid state.. >+ >+SETUP: paymentMethod = validPaymentMethod(); paymentMethod.data.shippingContact = 7; >+PASS new PaymentRequest([paymentMethod], validPaymentDetails()); request.show() rejected promise with InvalidStateError: The object is in an invalid state.. >+ > Testing ApplePayRequest.applicationData > > SETUP: paymentMethod = validPaymentMethod(); paymentMethod.data.applicationData = { toString: function() { throw '"Error in toString"'; } }; >diff --git a/LayoutTests/http/tests/ssl/applepay/PaymentRequest.https.html b/LayoutTests/http/tests/ssl/applepay/PaymentRequest.https.html >index 94825233a120d445bad58e84a5bc05c858f5628b..9e979e92c14f43f43e5c3cf489afe4e27d168691 100644 >--- a/LayoutTests/http/tests/ssl/applepay/PaymentRequest.https.html >+++ b/LayoutTests/http/tests/ssl/applepay/PaymentRequest.https.html >@@ -142,6 +142,34 @@ async function go() { > debug("") > await logAndShouldReject("paymentMethod = validPaymentMethod(); paymentMethod.data.billingContact = 7;", "new PaymentRequest([paymentMethod], validPaymentDetails()); request.show()") > debug("") >+ >+ debug("Testing ApplePayRequest.requiredShippingContactFields") >+ debug("") >+ await logAndShouldReject("paymentMethod = validPaymentMethod(); paymentMethod.data.requiredShippingContactFields = '';", "request = new PaymentRequest([paymentMethod], validPaymentDetails()); request.show()") >+ debug("") >+ await logAndShouldReject("paymentMethod = validPaymentMethod(); paymentMethod.data.requiredShippingContactFields = null;", "request = new PaymentRequest([paymentMethod], validPaymentDetails()); request.show()") >+ debug("") >+ await logAndShouldReject("paymentMethod = validPaymentMethod(); paymentMethod.data.requiredShippingContactFields = 7;", "request = new PaymentRequest([paymentMethod], validPaymentDetails()); request.show()") >+ debug("") >+ await logAndShouldReject("paymentMethod = validPaymentMethod(); paymentMethod.data.requiredShippingContactFields = { };", "request = new PaymentRequest([paymentMethod], validPaymentDetails()); request.show()") >+ debug("") >+ await logAndShouldReject("paymentMethod = validPaymentMethod(); paymentMethod.data.requiredShippingContactFields = [''];", "request = new PaymentRequest([paymentMethod], validPaymentDetails()); request.show()") >+ debug("") >+ await logAndShouldReject("paymentMethod = validPaymentMethod(); paymentMethod.data.requiredShippingContactFields = [null];", "request = new PaymentRequest([paymentMethod], validPaymentDetails()); request.show()") >+ debug("") >+ await logAndShouldReject("paymentMethod = validPaymentMethod(); paymentMethod.data.requiredShippingContactFields = [undefined];", "request = new PaymentRequest([paymentMethod], validPaymentDetails()); request.show()") >+ debug("") >+ await logAndShouldReject("paymentMethod = validPaymentMethod(); paymentMethod.data.requiredShippingContactFields = [{}];", "request = new PaymentRequest([paymentMethod], validPaymentDetails()); request.show()") >+ debug("") >+ await logAndShouldReject("paymentMethod = validPaymentMethod(); paymentMethod.data.requiredShippingContactFields = ['invalid'];", "request = new PaymentRequest([paymentMethod], validPaymentDetails()); request.show()") >+ debug("") >+ >+ debug("Testing ApplePayRequest.shippingContact") >+ debug("") >+ await logAndShouldReject("paymentMethod = validPaymentMethod(); paymentMethod.data.shippingContact = '';", "new PaymentRequest([paymentMethod], validPaymentDetails()); request.show()") >+ debug("") >+ await logAndShouldReject("paymentMethod = validPaymentMethod(); paymentMethod.data.shippingContact = 7;", "new PaymentRequest([paymentMethod], validPaymentDetails()); request.show()") >+ debug("") > > debug("Testing ApplePayRequest.applicationData") > debug("")
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194311
:
361228
|
361229
|
361301
|
361331