[Apple Pay] Add support for phonetic contact names
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Aug 2017 22:03:56 +0000 (22:03 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Aug 2017 22:03:56 +0000 (22:03 +0000)
commit844cea10901bfb51b24c2252b605f9f8bec9813c
treedf95d6d848d1c23269718ce06b14d78b41ccc624
parentde5b222e7df28795b4f2f1ffddd65e0243fc3229
[Apple Pay] Add support for phonetic contact names
https://bugs.webkit.org/show_bug.cgi?id=175537
<rdar://problem/32002644>

Reviewed by Tim Horton.

Source/WebCore:

* Modules/applepay/ApplePayError.idl: Defined "phoneticName" in ApplePayErrorContactField.
* Modules/applepay/ApplePayPaymentContact.h: Defined phoneticGivenName and phoneticFamilyName
in ApplePayPaymentContact.
* Modules/applepay/ApplePayPaymentContact.idl: Ditto.
* Modules/applepay/ApplePayPaymentRequest.h: Defined PhoneticName in
ApplePayPaymentRequest::ContactField.
* Modules/applepay/ApplePayPaymentRequest.idl: Defined "phoneticName" in ApplePayContactField.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate): Added a version parameter. Added code to convert
ContactField::PhoneticName, throwing an exception if version is less than 3.
* Modules/applepay/PaymentContact.h: Added a version parameter to fromApplePayPaymentContact().
* Modules/applepay/PaymentRequest.h: Defined phoneticName in PaymentRequest::ContactFields
and defined PhoneticName in PaymentError::ContactField.
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::convert): Added a version parameter. Set a phoneticRepresentation on the
PKContact's name if there are non-empty phonetic names and version is 3 or greater.
(WebCore::PaymentContact::fromApplePayPaymentContact): Passed version to convert().

Source/WebKit:

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Soft-linked PKContactFieldPhoneticName.
(WebKit::toPKContactFields): Added code to append PKContactFieldPhoneticName to result if
contactFields.phoneticName is true.
(WebKit::toNSError): Specified PKContactFieldPhoneticName as the contact field for
PaymentError::ContactField::PhoneticName.

LayoutTests:

* http/tests/ssl/applepay/ApplePayError-expected.txt:
* http/tests/ssl/applepay/ApplePayError.html:
* http/tests/ssl/applepay/ApplePaySession-expected.txt:
* http/tests/ssl/applepay/ApplePaySession.html:
* http/tests/ssl/applepay/ApplePaySessionV3-expected.txt:
* http/tests/ssl/applepay/ApplePaySessionV3.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220718 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/ssl/applepay/ApplePayError-expected.txt
LayoutTests/http/tests/ssl/applepay/ApplePayError.html
LayoutTests/http/tests/ssl/applepay/ApplePaySession-expected.txt
LayoutTests/http/tests/ssl/applepay/ApplePaySession.html
LayoutTests/http/tests/ssl/applepay/ApplePaySessionV3-expected.txt
LayoutTests/http/tests/ssl/applepay/ApplePaySessionV3.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/applepay/ApplePayError.idl
Source/WebCore/Modules/applepay/ApplePayPaymentContact.h
Source/WebCore/Modules/applepay/ApplePayPaymentContact.idl
Source/WebCore/Modules/applepay/ApplePayPaymentRequest.h
Source/WebCore/Modules/applepay/ApplePayPaymentRequest.idl
Source/WebCore/Modules/applepay/ApplePaySession.cpp
Source/WebCore/Modules/applepay/PaymentContact.h
Source/WebCore/Modules/applepay/PaymentRequest.h
Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm