[Apple Pay] Add "carteBancaire" as a supported payment network
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Jul 2017 01:03:29 +0000 (01:03 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Jul 2017 01:03:29 +0000 (01:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=174841
<rdar://problem/31935596>

Reviewed by Alex Christensen.

Source/WebCore:

Tests: http/tests/ssl/applepay/ApplePaySession.html
       http/tests/ssl/applepay/ApplePaySessionV3.html

* Modules/applepay/PaymentRequest.cpp:
(WebCore::PaymentRequest::isValidSupportedNetwork):

Source/WebKit:

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toSupportedNetwork):

LayoutTests:

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

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

LayoutTests/ChangeLog
LayoutTests/http/tests/ssl/applepay/ApplePaySession-expected.txt
LayoutTests/http/tests/ssl/applepay/ApplePaySession.html
LayoutTests/http/tests/ssl/applepay/ApplePaySessionV3.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/applepay/PaymentRequest.cpp
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm

index e4dc3a0..936c940 100644 (file)
@@ -1,3 +1,15 @@
+2017-07-25  Andy Estes  <aestes@apple.com>
+
+        [Apple Pay] Add "carteBancaire" as a supported payment network
+        https://bugs.webkit.org/show_bug.cgi?id=174841
+        <rdar://problem/31935596>
+
+        Reviewed by Alex Christensen.
+
+        * http/tests/ssl/applepay/ApplePaySession-expected.txt:
+        * http/tests/ssl/applepay/ApplePaySession.html:
+        * http/tests/ssl/applepay/ApplePaySessionV3.html:
+
 2017-07-25  Matt Lewis  <jlewis3@apple.com>
 
         Marked multiple fast/ tests as crashing on High Sierra WK1.
index bbaccd9..15e7b61 100644 (file)
@@ -76,6 +76,9 @@ PASS new ApplePaySession(2, request) threw exception TypeError: "invalidNetwork"
 SETUP: request = validRequest(); request.supportedNetworks = ['invalidNetwork', 'visa'];
 PASS new ApplePaySession(2, request) threw exception TypeError: "invalidNetwork" is not a valid payment network..
 
+SETUP: request = validRequest(); request.supportedNetworks = ['carteBancaire'];
+PASS new ApplePaySession(2, request) threw exception TypeError: "carteBancaire" is not a valid payment network..
+
 SETUP: request = validRequest(); request.supportedNetworks = ['visa', 'visa'];
 PASS new ApplePaySession(2, request) did not throw exception.
 
index f344c20..7be3840 100644 (file)
@@ -72,6 +72,7 @@ function go() {
     logAndShouldThrow("request = validRequest(); request.supportedNetworks = [];", "new ApplePaySession(2, request)")
     logAndShouldThrow("request = validRequest(); request.supportedNetworks = ['invalidNetwork'];", "new ApplePaySession(2, request)")
     logAndShouldThrow("request = validRequest(); request.supportedNetworks = ['invalidNetwork', 'visa'];", "new ApplePaySession(2, request)")
+    logAndShouldThrow("request = validRequest(); request.supportedNetworks = ['carteBancaire'];", "new ApplePaySession(2, request)")
     // FIXME: Should duplicate supportedNetworks be allowed?
     logAndShouldNotThrow("request = validRequest(); request.supportedNetworks = ['visa', 'visa'];", "new ApplePaySession(2, request)")
     
index 01549ea..0dc6b1b 100644 (file)
@@ -15,7 +15,7 @@ function validRequest() {
     return {
           countryCode: 'US',
           currencyCode: 'USD',
-          supportedNetworks: ['visa', 'masterCard'],
+          supportedNetworks: ['visa', 'masterCard', 'carteBancaire'],
           merchantCapabilities: ['supports3DS'],
           total: { label: 'Your Label', amount: '10.00' },
     }
index 5f9fe4b..5d72be8 100644 (file)
@@ -1,3 +1,17 @@
+2017-07-25  Andy Estes  <aestes@apple.com>
+
+        [Apple Pay] Add "carteBancaire" as a supported payment network
+        https://bugs.webkit.org/show_bug.cgi?id=174841
+        <rdar://problem/31935596>
+
+        Reviewed by Alex Christensen.
+
+        Tests: http/tests/ssl/applepay/ApplePaySession.html
+               http/tests/ssl/applepay/ApplePaySessionV3.html
+
+        * Modules/applepay/PaymentRequest.cpp:
+        (WebCore::PaymentRequest::isValidSupportedNetwork):
+
 2017-07-25  Daniel Bates  <dabates@apple.com>
 
         Make StyleResolver::isValid{Cue, Region}StyleProperty() static, inline, non-member functions
index 8dd9425..39ee93c 100644 (file)
@@ -59,6 +59,8 @@ bool PaymentRequest::isValidSupportedNetwork(unsigned version, const String& sup
         return true;
     if (version >= 2 && supportedNetwork == "jcb")
         return true;
+    if (version >= 3 && supportedNetwork == "carteBancaire")
+        return true;
 
     return false;
 }
index 3e42bef..d021812 100644 (file)
@@ -1,3 +1,14 @@
+2017-07-25  Andy Estes  <aestes@apple.com>
+
+        [Apple Pay] Add "carteBancaire" as a supported payment network
+        https://bugs.webkit.org/show_bug.cgi?id=174841
+        <rdar://problem/31935596>
+
+        Reviewed by Alex Christensen.
+
+        * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
+        (WebKit::toSupportedNetwork):
+
 2017-07-25  Brian Burg  <bburg@apple.com>
 
         Use SandboxExtension::HandleArray when sending extensions for file uploads to the web process
index 8a43ceb..28e8926 100644 (file)
@@ -51,6 +51,7 @@ 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, PKPaymentNetworkCarteBancaire, NSString *);
 SOFT_LINK_CONSTANT(PassKit, PKPaymentNetworkChinaUnionPay, NSString *);
 SOFT_LINK_CONSTANT(PassKit, PKPaymentNetworkDiscover, NSString *);
 SOFT_LINK_CONSTANT(PassKit, PKPaymentNetworkInterac, NSString *);
@@ -436,6 +437,8 @@ static NSString *toSupportedNetwork(const String& supportedNetwork)
 {
     if (supportedNetwork == "amex")
         return getPKPaymentNetworkAmex();
+    if (supportedNetwork == "carteBancaire")
+        return getPKPaymentNetworkCarteBancaire();
     if (supportedNetwork == "chinaUnionPay")
         return getPKPaymentNetworkChinaUnionPay();
     if (supportedNetwork == "discover")