[Payment Request] It should be possible to require a phonetic name for shipping contacts
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Feb 2019 23:18:07 +0000 (23:18 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Feb 2019 23:18:07 +0000 (23:18 +0000)
commit50a37b6ee9384ff9300e89ab090fa1bac6f9e94d
tree0464a4ca08ea0d3a5158facdeda624abac35159b
parentc9ed2fbaf5dc2c3ef58db8cc0612b6c8c332d934
[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 Alex Christensen.

Source/WebCore:

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:

Source/WebKit:

* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::supportsVersion): Deleted.
* WebProcess/ApplePay/WebPaymentCoordinator.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebPaymentCoordinatorClient.h:
* WebCoreSupport/WebPaymentCoordinatorClient.mm:
(WebPaymentCoordinatorClient::supportsVersion): Deleted.

LayoutTests:

* 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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241105 268f45cc-cd09-0410-ab3c-d52691b4dbfc
32 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContact.https-expected.txt
LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContact.https.html
LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https-expected.txt
LayoutTests/http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https.html
LayoutTests/http/tests/ssl/applepay/PaymentRequest.https-expected.txt
LayoutTests/http/tests/ssl/applepay/PaymentRequest.https.html
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/applepay/ApplePayPaymentRequest.h
Source/WebCore/Modules/applepay/ApplePayPaymentRequest.idl
Source/WebCore/Modules/applepay/ApplePayRequestBase.cpp
Source/WebCore/Modules/applepay/ApplePayRequestBase.h
Source/WebCore/Modules/applepay/ApplePayRequestBase.idl
Source/WebCore/Modules/applepay/ApplePaySession.cpp
Source/WebCore/Modules/applepay/PaymentCoordinatorClient.cpp [new file with mode: 0644]
Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h
Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp
Source/WebCore/SourcesCocoa.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/loader/EmptyClients.cpp
Source/WebCore/testing/MockPaymentContactFields.h [new file with mode: 0644]
Source/WebCore/testing/MockPaymentContactFields.idl [new file with mode: 0644]
Source/WebCore/testing/MockPaymentCoordinator.cpp
Source/WebCore/testing/MockPaymentCoordinator.h
Source/WebCore/testing/MockPaymentCoordinator.idl
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp
Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.h
Source/WebKitLegacy/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm