Diff
Modified: trunk/LayoutTests/ChangeLog (225848 => 225849)
--- trunk/LayoutTests/ChangeLog 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/LayoutTests/ChangeLog 2017-12-13 18:02:28 UTC (rev 225849)
@@ -1,3 +1,16 @@
+2017-12-13 Andy Estes <[email protected]>
+
+ [Payment Request] Remove ApplePayPaymentMethodUpdateEvent and use PaymentDetailsModifiers instead
+ https://bugs.webkit.org/show_bug.cgi?id=180737
+ <rdar://problem/36013152>
+
+ Reviewed by Brady Eidson.
+
+ * http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https-expected.txt: Added.
+ * http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https.html: Added.
+ * http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https-expected.txt: Removed.
+ * http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https.html: Removed.
+
2017-12-13 Matt Lewis <[email protected]>
Added missing expectation file for fast/text/user-installed-fonts/shadow-postscript-family.html
Added: trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https-expected.txt (0 => 225849)
--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https-expected.txt 2017-12-13 18:02:28 UTC (rev 225849)
@@ -0,0 +1,34 @@
+Test PaymentDetailsModifier with Apple Pay.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Testing PaymentDetailsModifier after selecting a 'credit' payment method type.
+PASS internals.mockPaymentCoordinator.total.label is 'Credit total override'
+PASS internals.mockPaymentCoordinator.total.amount is '15.00'
+PASS internals.mockPaymentCoordinator.lineItems.length is 2
+PASS internals.mockPaymentCoordinator.lineItems[0].label is 'Item'
+PASS internals.mockPaymentCoordinator.lineItems[0].amount is '10.00'
+PASS internals.mockPaymentCoordinator.lineItems[1].label is 'Credit surcharge'
+PASS internals.mockPaymentCoordinator.lineItems[1].amount is '5.00'
+
+Testing PaymentDetailsModifier after selecting a 'debit' payment method type.
+PASS internals.mockPaymentCoordinator.total.label is 'Debit total override'
+PASS internals.mockPaymentCoordinator.total.amount is '13.00'
+PASS internals.mockPaymentCoordinator.lineItems.length is 2
+PASS internals.mockPaymentCoordinator.lineItems[0].label is 'Item'
+PASS internals.mockPaymentCoordinator.lineItems[0].amount is '10.00'
+PASS internals.mockPaymentCoordinator.lineItems[1].label is 'Debit surcharge'
+PASS internals.mockPaymentCoordinator.lineItems[1].amount is '3.00'
+
+Testing PaymentDetailsModifier after selecting an unmodified payment method type.
+PASS internals.mockPaymentCoordinator.total.label is 'Total'
+PASS internals.mockPaymentCoordinator.total.amount is '10.00'
+PASS internals.mockPaymentCoordinator.lineItems.length is 1
+PASS internals.mockPaymentCoordinator.lineItems[0].label is 'Item'
+PASS internals.mockPaymentCoordinator.lineItems[0].amount is '10.00'
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https.html (0 => 225849)
--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https.html (rev 0)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https.html 2017-12-13 18:02:28 UTC (rev 225849)
@@ -0,0 +1,184 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<script>
+
+description("Test PaymentDetailsModifier with Apple Pay.");
+
+window.jsTestIsAsync = true;
+
+function validPaymentMethod() {
+ return {
+ supportedMethods: 'https://apple.com/apple-pay',
+ data: {
+ version: 2,
+ merchantIdentifier: '',
+ countryCode: 'US',
+ supportedNetworks: ['visa', 'masterCard'],
+ merchantCapabilities: ['supports3DS'],
+ },
+ }
+}
+
+function validPaymentDetails() {
+ return {
+ total: {
+ label: 'Total',
+ amount: {
+ currency: 'USD',
+ value: '10.00',
+ },
+ },
+ displayItems: [{
+ label: 'Item',
+ amount: {
+ currency: 'USD',
+ value: '10.00',
+ },
+ }],
+ modifiers: [{
+ supportedMethods: 'https://apple.com/apple-pay',
+ total: {
+ label: 'Credit total override',
+ amount: {
+ currency: 'USD',
+ value: '15.00',
+ },
+ },
+ additionalDisplayItems: [{
+ label: 'Credit surcharge',
+ amount: {
+ currency: 'USD',
+ value: '5.00',
+ },
+ }],
+ data: {
+ paymentMethodType: 'credit',
+ },
+ }, {
+ supportedMethods: 'https://apple.com/apple-pay',
+ total: {
+ label: 'Duplicate credit total override',
+ amount: {
+ currency: 'USD',
+ value: '17.00',
+ },
+ },
+ additionalDisplayItems: [{
+ label: 'Duplicate credit surcharge',
+ amount: {
+ currency: 'USD',
+ value: '7.00',
+ },
+ }],
+ data: {
+ paymentMethodType: 'credit',
+ },
+ }, {
+ supportedMethods: 'https://apple.com/apple-pay',
+ total: {
+ label: 'Debit total override',
+ amount: {
+ currency: 'USD',
+ value: '13.00',
+ },
+ },
+ additionalDisplayItems: [{
+ label: 'Debit surcharge',
+ amount: {
+ currency: 'USD',
+ value: '3.00',
+ },
+ }],
+ data: {
+ paymentMethodType: 'debit',
+ },
+ }],
+ }
+}
+
+async function runTests() {
+ await new Promise((resolve, reject) => {
+ debug("Testing PaymentDetailsModifier after selecting a 'credit' payment method type.");
+
+ var paymentRequest = new PaymentRequest([validPaymentMethod()], validPaymentDetails());
+
+ activateThen(() => {
+ paymentRequest.show().then((response) => {
+ shouldBe("internals.mockPaymentCoordinator.total.label", "'Credit total override'");
+ shouldBe("internals.mockPaymentCoordinator.total.amount", "'15.00'");
+ shouldBe("internals.mockPaymentCoordinator.lineItems.length", "2");
+ shouldBe("internals.mockPaymentCoordinator.lineItems[0].label", "'Item'");
+ shouldBe("internals.mockPaymentCoordinator.lineItems[0].amount", "'10.00'");
+ shouldBe("internals.mockPaymentCoordinator.lineItems[1].label", "'Credit surcharge'");
+ shouldBe("internals.mockPaymentCoordinator.lineItems[1].amount", "'5.00'");
+ response.complete("success");
+ resolve();
+ });
+
+ internals.mockPaymentCoordinator.changePaymentMethod({ type: 'credit' });
+ internals.mockPaymentCoordinator.acceptPayment();
+ });
+ });
+ debug("");
+
+ await new Promise((resolve, reject) => {
+ debug("Testing PaymentDetailsModifier after selecting a 'debit' payment method type.");
+
+ var paymentRequest = new PaymentRequest([validPaymentMethod()], validPaymentDetails());
+
+ activateThen(() => {
+ paymentRequest.show().then((response) => {
+ shouldBe("internals.mockPaymentCoordinator.total.label", "'Debit total override'");
+ shouldBe("internals.mockPaymentCoordinator.total.amount", "'13.00'");
+ shouldBe("internals.mockPaymentCoordinator.lineItems.length", "2");
+ shouldBe("internals.mockPaymentCoordinator.lineItems[0].label", "'Item'");
+ shouldBe("internals.mockPaymentCoordinator.lineItems[0].amount", "'10.00'");
+ shouldBe("internals.mockPaymentCoordinator.lineItems[1].label", "'Debit surcharge'");
+ shouldBe("internals.mockPaymentCoordinator.lineItems[1].amount", "'3.00'");
+ response.complete("success");
+ resolve();
+ });
+
+ internals.mockPaymentCoordinator.changePaymentMethod({ type: 'debit' });
+ internals.mockPaymentCoordinator.acceptPayment();
+ });
+ });
+ debug("");
+
+ await new Promise((resolve, reject) => {
+ debug("Testing PaymentDetailsModifier after selecting an unmodified payment method type.");
+
+ var paymentRequest = new PaymentRequest([validPaymentMethod()], validPaymentDetails());
+
+ activateThen(() => {
+ paymentRequest.show().then((response) => {
+ shouldBe("internals.mockPaymentCoordinator.total.label", "'Total'");
+ shouldBe("internals.mockPaymentCoordinator.total.amount", "'10.00'");
+ shouldBe("internals.mockPaymentCoordinator.lineItems.length", "1");
+ shouldBe("internals.mockPaymentCoordinator.lineItems[0].label", "'Item'");
+ shouldBe("internals.mockPaymentCoordinator.lineItems[0].amount", "'10.00'");
+ response.complete("success");
+ resolve();
+ });
+
+ internals.mockPaymentCoordinator.changePaymentMethod({ type: 'prepaid' });
+ internals.mockPaymentCoordinator.acceptPayment();
+ });
+ });
+ debug("");
+
+ finishJSTest();
+}
+
+runTests();
+</script>
+<script src=""
+</body>
+</html>
Deleted: trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https-expected.txt (225848 => 225849)
--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https-expected.txt 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https-expected.txt 2017-12-13 18:02:28 UTC (rev 225849)
@@ -1,19 +0,0 @@
-Test the applepaypaymentmethodchanged event.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Testing ApplePayMerchantValidationEvent
-
-PASS event.paymentMethod.displayName is expectedPaymentMethod.displayName
-PASS event.paymentMethod.network is expectedPaymentMethod.network
-PASS event.paymentMethod.type is expectedPaymentMethod.type
-PASS event.paymentMethod.paymentPass.primaryAccountIdentifier is expectedPaymentMethod.paymentPass.primaryAccountIdentifier
-PASS event.paymentMethod.paymentPass.primaryAccountNumberSuffix is expectedPaymentMethod.paymentPass.primaryAccountNumberSuffix
-PASS event.paymentMethod.paymentPass.deviceAccountIdentifier is expectedPaymentMethod.paymentPass.deviceAccountIdentifier
-PASS event.paymentMethod.paymentPass.deviceAccountNumberSuffix is expectedPaymentMethod.paymentPass.deviceAccountNumberSuffix
-PASS event.paymentMethod.paymentPass.activationState is expectedPaymentMethod.paymentPass.activationState
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https.html (225848 => 225849)
--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https.html 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https.html 2017-12-13 18:02:28 UTC (rev 225849)
@@ -1,84 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<script src=""
-<script src=""
-<script src=""
-</head>
-<body>
-<script>
-
-description("Test the applepaypaymentmethodchanged event.");
-
-window.jsTestIsAsync = true;
-
-function validPaymentMethod() {
- return {
- supportedMethods: 'https://apple.com/apple-pay',
- data: {
- version: 2,
- merchantIdentifier: '',
- countryCode: 'US',
- supportedNetworks: ['visa', 'masterCard'],
- merchantCapabilities: ['supports3DS'],
- },
- }
-}
-
-function validPaymentDetails() {
- return {
- total: { label: 'Your label', amount: { currency: 'USD', value: '10.00' } },
- }
-}
-
-async function go() {
- debug("Testing ApplePayMerchantValidationEvent");
- debug("");
-
- expectedPaymentMethod = {
- displayName: 'test',
- network: 'test',
- type: 'prepaid',
- paymentPass: {
- primaryAccountIdentifier: 'test',
- primaryAccountNumberSuffix: 'test',
- deviceAccountIdentifier: 'test',
- deviceAccountNumberSuffix: 'test',
- activationState: 'requiresActivation',
- },
- };
-
- var paymentRequest = new PaymentRequest([validPaymentMethod()], validPaymentDetails());
- paymentRequest._onapplepaypaymentmethodchanged_ = (event) => {
- shouldBe("event.paymentMethod.displayName", "expectedPaymentMethod.displayName");
- shouldBe("event.paymentMethod.network", "expectedPaymentMethod.network");
- shouldBe("event.paymentMethod.type", "expectedPaymentMethod.type");
- shouldBe("event.paymentMethod.paymentPass.primaryAccountIdentifier", "expectedPaymentMethod.paymentPass.primaryAccountIdentifier");
- shouldBe("event.paymentMethod.paymentPass.primaryAccountNumberSuffix", "expectedPaymentMethod.paymentPass.primaryAccountNumberSuffix");
- shouldBe("event.paymentMethod.paymentPass.deviceAccountIdentifier", "expectedPaymentMethod.paymentPass.deviceAccountIdentifier");
- shouldBe("event.paymentMethod.paymentPass.deviceAccountNumberSuffix", "expectedPaymentMethod.paymentPass.deviceAccountNumberSuffix");
- shouldBe("event.paymentMethod.paymentPass.activationState", "expectedPaymentMethod.paymentPass.activationState");
-
- document.querySelector("button").remove();
- finishJSTest();
- };
-
- activateThen(() => {
- paymentRequest.show();
- internals.mockPaymentCoordinator.changePaymentMethod(expectedPaymentMethod);
- });
-}
-
-window._onload_ = function() {
- var button = document.querySelector("button");
- let x = button.offsetLeft + 2;
- let y = button.offsetTop + 2;
- UIHelper.activateAt(x, y);
-}
-
-</script>
-<button _onclick_='go()'>Go</button>
-<script src=""
-</body>
-</html>
Modified: trunk/Source/WebCore/ChangeLog (225848 => 225849)
--- trunk/Source/WebCore/ChangeLog 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/ChangeLog 2017-12-13 18:02:28 UTC (rev 225849)
@@ -1,3 +1,51 @@
+2017-12-13 Andy Estes <[email protected]>
+
+ [Payment Request] Remove ApplePayPaymentMethodUpdateEvent and use PaymentDetailsModifiers instead
+ https://bugs.webkit.org/show_bug.cgi?id=180737
+ <rdar://problem/36013152>
+
+ Reviewed by Brady Eidson.
+
+ Instead of firing a non-standard "applepaypaymentmethodupdate" event when the payment method
+ changes, use the PaymentDetailsModifier mechanism to allow the merchant to specify override
+ totals and additional display items per payment method type.
+
+ Test: http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https.html
+
+ * DerivedSources.make:
+ * Modules/applepay/ApplePayLineItem.idl:
+ * Modules/applepay/ApplePayPaymentMethod.h:
+ * Modules/applepay/ApplePayPaymentMethod.idl:
+ * Modules/applepay/ApplePayPaymentMethodType.h: Added.
+ * Modules/applepay/ApplePayPaymentMethodType.idl: Added.
+ * Modules/applepay/cocoa/PaymentMethodCocoa.mm:
+ * Modules/applepay/paymentrequest/ApplePayModifier.h: Added.
+ * Modules/applepay/paymentrequest/ApplePayModifier.idl: Added.
+ * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
+ (WebCore::ApplePayPaymentHandler::show):
+ (WebCore::ApplePayPaymentHandler::computeTotalAndLineItems):
+ (WebCore::ApplePayPaymentHandler::detailsUpdated):
+ (WebCore::ApplePayPaymentHandler::shippingAddressUpdated):
+ (WebCore::ApplePayPaymentHandler::shippingOptionUpdated):
+ (WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
+ (WebCore::ApplePayPaymentHandler::didSelectPaymentMethod):
+ * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
+ * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.cpp: Removed.
+ * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.h: Removed.
+ * Modules/paymentrequest/PaymentRequest.h:
+ * Modules/paymentrequest/PaymentRequest.idl:
+ * WebCore.xcodeproj/project.pbxproj:
+ * dom/EventNames.h:
+ * dom/EventNames.in:
+ * testing/MockPaymentCoordinator.cpp:
+ (WebCore::convert):
+ (WebCore::MockPaymentCoordinator::updateTotalAndLineItems):
+ (WebCore::MockPaymentCoordinator::completeShippingMethodSelection):
+ (WebCore::MockPaymentCoordinator::completeShippingContactSelection):
+ (WebCore::MockPaymentCoordinator::completePaymentMethodSelection):
+ * testing/MockPaymentCoordinator.h:
+ * testing/MockPaymentCoordinator.idl:
+
2017-12-12 Zalan Bujtas <[email protected]>
is<HTMLTextFormControlElement> reports the input type.
Modified: trunk/Source/WebCore/DerivedSources.make (225848 => 225849)
--- trunk/Source/WebCore/DerivedSources.make 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/DerivedSources.make 2017-12-13 18:02:28 UTC (rev 225849)
@@ -97,6 +97,7 @@
$(WebCore)/Modules/applepay/ApplePayPaymentContact.idl \
$(WebCore)/Modules/applepay/ApplePayPaymentMethod.idl \
$(WebCore)/Modules/applepay/ApplePayPaymentMethodSelectedEvent.idl \
+ $(WebCore)/Modules/applepay/ApplePayPaymentMethodType.idl \
$(WebCore)/Modules/applepay/ApplePayPaymentMethodUpdate.idl \
$(WebCore)/Modules/applepay/ApplePayPaymentPass.idl \
$(WebCore)/Modules/applepay/ApplePayPaymentRequest.idl \
@@ -109,7 +110,7 @@
$(WebCore)/Modules/applepay/ApplePayShippingMethodUpdate.idl \
$(WebCore)/Modules/applepay/ApplePayValidateMerchantEvent.idl \
$(WebCore)/Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.idl \
- $(WebCore)/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl \
+ $(WebCore)/Modules/applepay/paymentrequest/ApplePayModifier.idl \
$(WebCore)/Modules/applepay/paymentrequest/ApplePayRequest.idl \
$(WebCore)/Modules/beacon/NavigatorBeacon.idl \
$(WebCore)/Modules/cache/DOMWindowCaches.idl \
Modified: trunk/Source/WebCore/Modules/applepay/ApplePayLineItem.idl (225848 => 225849)
--- trunk/Source/WebCore/Modules/applepay/ApplePayLineItem.idl 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayLineItem.idl 2017-12-13 18:02:28 UTC (rev 225849)
@@ -32,6 +32,8 @@
[
Conditional=APPLE_PAY,
+ ExportMacro=WEBCORE_EXPORT,
+ JSGenerateToJSObject,
] dictionary ApplePayLineItem {
ApplePayLineItemType type = "final";
DOMString label;
Modified: trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.h (225848 => 225849)
--- trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.h 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.h 2017-12-13 18:02:28 UTC (rev 225849)
@@ -32,7 +32,7 @@
namespace WebCore {
-enum class ApplePayPaymentMethodType { Debit, Credit, Prepaid, Store };
+enum class ApplePayPaymentMethodType;
struct ApplePayPaymentMethod {
using Type = ApplePayPaymentMethodType;
Modified: trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.idl (225848 => 225849)
--- trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.idl 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.idl 2017-12-13 18:02:28 UTC (rev 225849)
@@ -25,15 +25,6 @@
[
Conditional=APPLE_PAY,
-] enum ApplePayPaymentMethodType {
- "debit",
- "credit",
- "prepaid",
- "store"
-};
-
-[
- Conditional=APPLE_PAY,
ExportMacro=WEBCORE_EXPORT,
JSGenerateToJSObject
] dictionary ApplePayPaymentMethod {
Copied: trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodType.h (from rev 225848, trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl) (0 => 225849)
--- trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodType.h (rev 0)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodType.h 2017-12-13 18:02:28 UTC (rev 225849)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2017 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)
+
+namespace WebCore {
+
+enum class ApplePayPaymentMethodType {
+ Debit,
+ Credit,
+ Prepaid,
+ Store,
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(APPLE_PAY)
Copied: trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodType.idl (from rev 225848, trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl) (0 => 225849)
--- trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodType.idl (rev 0)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodType.idl 2017-12-13 18:02:28 UTC (rev 225849)
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2017 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,
+] enum ApplePayPaymentMethodType {
+ "debit",
+ "credit",
+ "prepaid",
+ "store"
+};
Modified: trunk/Source/WebCore/Modules/applepay/cocoa/PaymentMethodCocoa.mm (225848 => 225849)
--- trunk/Source/WebCore/Modules/applepay/cocoa/PaymentMethodCocoa.mm 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/applepay/cocoa/PaymentMethodCocoa.mm 2017-12-13 18:02:28 UTC (rev 225849)
@@ -29,6 +29,7 @@
#if ENABLE(APPLE_PAY)
#import "ApplePayPaymentMethod.h"
+#import "ApplePayPaymentMethodType.h"
#import <pal/spi/cocoa/PassKitSPI.h>
namespace WebCore {
Copied: trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayModifier.h (from rev 225848, trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl) (0 => 225849)
--- trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayModifier.h (rev 0)
+++ trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayModifier.h 2017-12-13 18:02:28 UTC (rev 225849)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2017 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) && ENABLE(PAYMENT_REQUEST)
+
+#include "ApplePayPaymentMethodType.h"
+
+namespace WebCore {
+
+struct ApplePayModifier {
+ ApplePayPaymentMethodType paymentMethodType;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(APPLE_PAY) && ENABLE(PAYMENT_REQUEST)
Copied: trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayModifier.idl (from rev 225848, trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl) (0 => 225849)
--- trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayModifier.idl (rev 0)
+++ trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayModifier.idl 2017-12-13 18:02:28 UTC (rev 225849)
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2017 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&PAYMENT_REQUEST,
+] dictionary ApplePayModifier {
+ required ApplePayPaymentMethodType paymentMethodType;
+};
Modified: trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp (225848 => 225849)
--- trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp 2017-12-13 18:02:28 UTC (rev 225849)
@@ -31,8 +31,8 @@
#include "ApplePayContactField.h"
#include "ApplePayMerchantCapability.h"
#include "ApplePayMerchantValidationEvent.h"
+#include "ApplePayModifier.h"
#include "ApplePayPayment.h"
-#include "ApplePayPaymentMethodUpdateEvent.h"
#include "ApplePaySessionPaymentRequest.h"
#include "Document.h"
#include "EventNames.h"
@@ -190,21 +190,8 @@
auto convertedLineItems = convertAndValidate(m_paymentRequest->paymentDetails().displayItems, expectedCurrency);
if (convertedLineItems.hasException())
return convertedLineItems.releaseException();
+ request.setLineItems(convertedLineItems.releaseReturnValue());
- auto lineItems = convertedLineItems.releaseReturnValue();
- for (auto& modifier : m_paymentRequest->paymentDetails().modifiers) {
- auto convertedIdentifier = convertAndValidatePaymentMethodIdentifier(modifier.supportedMethods);
- if (!convertedIdentifier || !handlesIdentifier(*convertedIdentifier))
- continue;
-
- auto additionalDisplayItems = convertAndValidate(modifier.additionalDisplayItems, expectedCurrency);
- if (additionalDisplayItems.hasException())
- return additionalDisplayItems.releaseException();
-
- lineItems.appendVector(additionalDisplayItems.releaseReturnValue());
- }
- request.setLineItems(lineItems);
-
request.setRequiredShippingContactFields(convert(m_paymentRequest->paymentOptions()));
if (m_paymentRequest->paymentOptions().requestShipping)
request.setShippingType(convert(m_paymentRequest->paymentOptions().shippingType));
@@ -255,18 +242,67 @@
paymentCoordinator().canMakePaymentsWithActiveCard(m_applePayRequest->merchantIdentifier, document().domain(), WTFMove(completionHandler));
}
-static ExceptionOr<ApplePaySessionPaymentRequest::TotalAndLineItems> convertAndValidate(const PaymentDetailsInit& details)
+ExceptionOr<ApplePaySessionPaymentRequest::TotalAndLineItems> ApplePayPaymentHandler::computeTotalAndLineItems()
{
+ auto& details = m_paymentRequest->paymentDetails();
String currency = details.total.amount.currency;
- auto total = convertAndValidate(details.total, currency);
- if (total.hasException())
- return total.releaseException();
- auto lineItems = convertAndValidate(details.displayItems, currency);
- if (lineItems.hasException())
- return lineItems.releaseException();
+ auto convertedTotal = convertAndValidate(details.total, currency);
+ if (convertedTotal.hasException())
+ return convertedTotal.releaseException();
+ auto total = convertedTotal.releaseReturnValue();
- return ApplePaySessionPaymentRequest::TotalAndLineItems { total.releaseReturnValue(), lineItems.releaseReturnValue() };
+ auto convertedLineItems = convertAndValidate(details.displayItems, currency);
+ if (convertedLineItems.hasException())
+ return convertedLineItems.releaseException();
+ auto lineItems = convertedLineItems.releaseReturnValue();
+
+ if (!m_selectedPaymentMethodType)
+ return ApplePaySessionPaymentRequest::TotalAndLineItems { WTFMove(total), WTFMove(lineItems) };
+
+ auto& modifiers = details.modifiers;
+ auto& serializedModifierData = m_paymentRequest->serializedModifierData();
+ ASSERT(modifiers.size() == serializedModifierData.size());
+ for (size_t i = 0; i < modifiers.size(); ++i) {
+ auto convertedIdentifier = convertAndValidatePaymentMethodIdentifier(modifiers[i].supportedMethods);
+ if (!convertedIdentifier || !handlesIdentifier(*convertedIdentifier))
+ continue;
+
+ if (serializedModifierData[i].isEmpty())
+ continue;
+
+ auto& execState = *document().execState();
+ auto scope = DECLARE_THROW_SCOPE(execState.vm());
+ JSC::JSValue data;
+ {
+ auto lock = JSC::JSLockHolder { &execState };
+ data = "" serializedModifierData[i]);
+ if (scope.exception())
+ return Exception { ExistingExceptionError };
+ }
+
+ auto applePayModifier = convertDictionary<ApplePayModifier>(execState, WTFMove(data));
+ if (scope.exception())
+ return Exception { ExistingExceptionError };
+
+ if (applePayModifier.paymentMethodType != *m_selectedPaymentMethodType)
+ continue;
+
+ if (modifiers[i].total) {
+ auto totalOverride = convertAndValidate(*modifiers[i].total, currency);
+ if (totalOverride.hasException())
+ return totalOverride.releaseException();
+ total = totalOverride.releaseReturnValue();
+ }
+
+ auto additionalDisplayItems = convertAndValidate(modifiers[i].additionalDisplayItems, currency);
+ if (additionalDisplayItems.hasException())
+ return additionalDisplayItems.releaseException();
+ lineItems.appendVector(additionalDisplayItems.releaseReturnValue());
+ break;
+ }
+
+ return ApplePaySessionPaymentRequest::TotalAndLineItems { WTFMove(total), WTFMove(lineItems) };
}
ExceptionOr<void> ApplePayPaymentHandler::detailsUpdated(const AtomicString& eventType, const String& error)
@@ -277,9 +313,6 @@
if (eventType == eventNames().shippingoptionchangeEvent)
return shippingOptionUpdated();
- if (eventType == eventNames().applepaypaymentmethodchangedEvent)
- return paymentMethodUpdated();
-
ASSERT_NOT_REACHED();
return { };
}
@@ -295,7 +328,7 @@
update.errors.append(WTFMove(paymentError));
}
- auto newTotalAndLineItems = convertAndValidate(m_paymentRequest->paymentDetails());
+ auto newTotalAndLineItems = computeTotalAndLineItems();
if (newTotalAndLineItems.hasException())
return newTotalAndLineItems.releaseException();
update.newTotalAndLineItems = newTotalAndLineItems.releaseReturnValue();
@@ -308,7 +341,7 @@
{
ShippingMethodUpdate update;
- auto newTotalAndLineItems = convertAndValidate(m_paymentRequest->paymentDetails());
+ auto newTotalAndLineItems = computeTotalAndLineItems();
if (newTotalAndLineItems.hasException())
return newTotalAndLineItems.releaseException();
update.newTotalAndLineItems = newTotalAndLineItems.releaseReturnValue();
@@ -321,7 +354,7 @@
{
PaymentMethodUpdate update;
- auto newTotalAndLineItems = convertAndValidate(m_paymentRequest->paymentDetails());
+ auto newTotalAndLineItems = computeTotalAndLineItems();
if (newTotalAndLineItems.hasException())
return newTotalAndLineItems.releaseException();
update.newTotalAndLineItems = newTotalAndLineItems.releaseReturnValue();
@@ -385,8 +418,8 @@
void ApplePayPaymentHandler::didSelectPaymentMethod(const PaymentMethod& paymentMethod)
{
- auto event = ApplePayPaymentMethodUpdateEvent::create(eventNames().applepaypaymentmethodchangedEvent, paymentMethod.toApplePayPaymentMethod(), m_paymentRequest.get());
- m_paymentRequest->dispatchEvent(event.get());
+ m_selectedPaymentMethodType = paymentMethod.toApplePayPaymentMethod().type;
+ paymentMethodUpdated();
}
void ApplePayPaymentHandler::didCancelPaymentSession()
Modified: trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.h (225848 => 225849)
--- trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.h 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.h 2017-12-13 18:02:28 UTC (rev 225849)
@@ -27,6 +27,7 @@
#if ENABLE(APPLE_PAY) && ENABLE(PAYMENT_REQUEST)
+#include "ApplePayPaymentMethodType.h"
#include "ApplePayRequest.h"
#include "ContextDestructionObserver.h"
#include "PaymentHandler.h"
@@ -51,6 +52,8 @@
Document& document();
PaymentCoordinator& paymentCoordinator();
+ ExceptionOr<ApplePaySessionPaymentRequest::TotalAndLineItems> computeTotalAndLineItems();
+
ExceptionOr<void> shippingAddressUpdated(const String& error);
ExceptionOr<void> shippingOptionUpdated();
ExceptionOr<void> paymentMethodUpdated();
@@ -74,6 +77,7 @@
PaymentRequest::MethodIdentifier m_identifier;
Ref<PaymentRequest> m_paymentRequest;
std::optional<ApplePayRequest> m_applePayRequest;
+ std::optional<ApplePayPaymentMethodType> m_selectedPaymentMethodType;
};
} // namespace WebCore
Deleted: trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.cpp (225848 => 225849)
--- trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.cpp 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.cpp 2017-12-13 18:02:28 UTC (rev 225849)
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2017 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 "ApplePayPaymentMethodUpdateEvent.h"
-
-#if ENABLE(APPLE_PAY) && ENABLE(PAYMENT_REQUEST)
-
-#include "PaymentRequest.h"
-
-namespace WebCore {
-
-ApplePayPaymentMethodUpdateEvent::ApplePayPaymentMethodUpdateEvent(const AtomicString& type, const ApplePayPaymentMethod& paymentMethod, PaymentRequest& paymentRequest)
- : PaymentRequestUpdateEvent { type, paymentRequest }
- , m_paymentMethod { paymentMethod }
-{
-}
-
-EventInterface ApplePayPaymentMethodUpdateEvent::eventInterface() const
-{
- return ApplePayPaymentMethodUpdateEventInterfaceType;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(APPLE_PAY) && ENABLE(PAYMENT_REQUEST)
Deleted: trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.h (225848 => 225849)
--- trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.h 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.h 2017-12-13 18:02:28 UTC (rev 225849)
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2017 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) && ENABLE(PAYMENT_REQUEST)
-
-#include "ApplePayPaymentMethod.h"
-#include "PaymentRequestUpdateEvent.h"
-
-namespace WebCore {
-
-class ApplePayPaymentMethodUpdateEvent final : public PaymentRequestUpdateEvent {
-public:
- template <typename... Args> static Ref<ApplePayPaymentMethodUpdateEvent> create(Args&&... args)
- {
- return adoptRef(*new ApplePayPaymentMethodUpdateEvent(std::forward<Args>(args)...));
- }
-
- const ApplePayPaymentMethod& paymentMethod() const { return m_paymentMethod; }
-
-private:
- ApplePayPaymentMethodUpdateEvent(const AtomicString& type, const ApplePayPaymentMethod&, PaymentRequest&);
-
- // Event
- EventInterface eventInterface() const final;
-
- const ApplePayPaymentMethod m_paymentMethod;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(APPLE_PAY) && ENABLE(PAYMENT_REQUEST)
Deleted: trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl (225848 => 225849)
--- trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl 2017-12-13 18:02:28 UTC (rev 225849)
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2017 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&PAYMENT_REQUEST,
- NoInterfaceObject,
-] interface ApplePayPaymentMethodUpdateEvent : PaymentRequestUpdateEvent {
- [CachedAttribute] readonly attribute ApplePayPaymentMethod paymentMethod;
-};
Modified: trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.h (225848 => 225849)
--- trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.h 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.h 2017-12-13 18:02:28 UTC (rev 225849)
@@ -75,6 +75,7 @@
const PaymentOptions& paymentOptions() const { return m_options; }
const PaymentDetailsInit& paymentDetails() const { return m_details; }
+ const Vector<String>& serializedModifierData() const { return m_serializedModifierData; }
void shippingAddressChanged(Ref<PaymentAddress>&&);
void shippingOptionChanged(const String& shippingOption);
Modified: trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.idl (225848 => 225849)
--- trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.idl 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.idl 2017-12-13 18:02:28 UTC (rev 225849)
@@ -45,5 +45,4 @@
attribute EventHandler onshippingoptionchange;
[Conditional=APPLE_PAY] attribute EventHandler onapplepayvalidatemerchant;
- [Conditional=APPLE_PAY] attribute EventHandler onapplepaypaymentmethodchanged;
};
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (225848 => 225849)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-12-13 18:02:28 UTC (rev 225849)
@@ -2730,10 +2730,6 @@
A1BF6B831AA96C7D00AF4A8A /* MockContentFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A1BF6B811AA96C7D00AF4A8A /* MockContentFilter.h */; };
A1C1507A1E3F2B3E0032C98C /* PreviewConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = A1C150781E3F2B3E0032C98C /* PreviewConverter.h */; };
A1C2C5761FA2851600BA46FA /* PaymentSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1C2C5751FA2851600BA46FA /* PaymentSession.cpp */; };
- A1CBEF531F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A1CBEF501F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.h */; };
- A1CBEF541F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1CBEF511F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.cpp */; };
- A1CBEF611F9F09040028DE7C /* JSApplePayPaymentMethodUpdateEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1CBEF5F1F9F09020028DE7C /* JSApplePayPaymentMethodUpdateEvent.cpp */; };
- A1CBEF621F9F09040028DE7C /* JSApplePayPaymentMethodUpdateEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A1CBEF601F9F09020028DE7C /* JSApplePayPaymentMethodUpdateEvent.h */; };
A1CBEF641F9F11290028DE7C /* MockPaymentMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = A1CBEF631F9F11290028DE7C /* MockPaymentMethod.h */; };
A1CC56671F46147A00A4555B /* JSPaymentAddress.h in Headers */ = {isa = PBXBuildFile; fileRef = A1CC56651F46146800A4555B /* JSPaymentAddress.h */; };
A1CC56691F46148000A4555B /* JSPaymentComplete.h in Headers */ = {isa = PBXBuildFile; fileRef = A1CC564E1F46145200A4555B /* JSPaymentComplete.h */; };
@@ -2766,6 +2762,12 @@
A1F600561F4765050077E83F /* JSPaymentRequestUpdateEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F600501F4764FE0077E83F /* JSPaymentRequestUpdateEventInit.h */; };
A1F600581F4765050077E83F /* JSPaymentRequestUpdateEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F600521F4765010077E83F /* JSPaymentRequestUpdateEvent.h */; };
A1F6005A1F4765050077E83F /* JSPaymentDetailsUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F600541F4765040077E83F /* JSPaymentDetailsUpdate.h */; };
+ A1F6CFFF1FE096210018078C /* ApplePayModifier.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F6CFFC1FE096210018078C /* ApplePayModifier.h */; };
+ A1F6D0061FE096F60018078C /* ApplePayPaymentMethodType.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F6D0031FE096F60018078C /* ApplePayPaymentMethodType.h */; };
+ A1F6D00F1FE099940018078C /* JSApplePayPaymentMethodType.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F6D00E1FE099640018078C /* JSApplePayPaymentMethodType.h */; };
+ A1F6D0101FE099960018078C /* JSApplePayPaymentMethodType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1F6D00D1FE099640018078C /* JSApplePayPaymentMethodType.cpp */; };
+ A1F6D0111FE099B20018078C /* JSApplePayModifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1F6D00A1FE099210018078C /* JSApplePayModifier.cpp */; };
+ A1F6D0121FE099B40018078C /* JSApplePayModifier.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F6D00C1FE099220018078C /* JSApplePayModifier.h */; };
A1F76B131F44C2450014C318 /* PaymentRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F76B101F44C2450014C318 /* PaymentRequest.h */; };
A1F76B191F44C3900014C318 /* PaymentMethodData.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F76B161F44C3900014C318 /* PaymentMethodData.h */; };
A1F76B1F1F44C3FE0014C318 /* PaymentDetailsBase.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F76B1C1F44C3FE0014C318 /* PaymentDetailsBase.h */; };
@@ -10554,11 +10556,6 @@
A1C150781E3F2B3E0032C98C /* PreviewConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreviewConverter.h; sourceTree = "<group>"; };
A1C2C5751FA2851600BA46FA /* PaymentSession.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PaymentSession.cpp; sourceTree = "<group>"; };
A1C7FAA1133A5D3500D6732D /* JSXPathResultCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSXPathResultCustom.cpp; sourceTree = "<group>"; };
- A1CBEF501F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ApplePayPaymentMethodUpdateEvent.h; sourceTree = "<group>"; };
- A1CBEF511F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ApplePayPaymentMethodUpdateEvent.cpp; sourceTree = "<group>"; };
- A1CBEF521F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ApplePayPaymentMethodUpdateEvent.idl; sourceTree = "<group>"; };
- A1CBEF5F1F9F09020028DE7C /* JSApplePayPaymentMethodUpdateEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSApplePayPaymentMethodUpdateEvent.cpp; sourceTree = "<group>"; };
- A1CBEF601F9F09020028DE7C /* JSApplePayPaymentMethodUpdateEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSApplePayPaymentMethodUpdateEvent.h; sourceTree = "<group>"; };
A1CBEF631F9F11290028DE7C /* MockPaymentMethod.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MockPaymentMethod.h; sourceTree = "<group>"; };
A1CC11621E493D0100EFA69C /* FileSystemMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FileSystemMac.mm; sourceTree = "<group>"; };
A1CC564C1F46145000A4555B /* JSPaymentMethodData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPaymentMethodData.h; sourceTree = "<group>"; };
@@ -10632,6 +10629,14 @@
A1F600521F4765010077E83F /* JSPaymentRequestUpdateEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPaymentRequestUpdateEvent.h; sourceTree = "<group>"; };
A1F600531F4765020077E83F /* JSPaymentRequestUpdateEventInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPaymentRequestUpdateEventInit.cpp; sourceTree = "<group>"; };
A1F600541F4765040077E83F /* JSPaymentDetailsUpdate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPaymentDetailsUpdate.h; sourceTree = "<group>"; };
+ A1F6CFFC1FE096210018078C /* ApplePayModifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ApplePayModifier.h; sourceTree = "<group>"; };
+ A1F6CFFE1FE096210018078C /* ApplePayModifier.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ApplePayModifier.idl; sourceTree = "<group>"; };
+ A1F6D0031FE096F60018078C /* ApplePayPaymentMethodType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ApplePayPaymentMethodType.h; sourceTree = "<group>"; };
+ A1F6D0051FE096F60018078C /* ApplePayPaymentMethodType.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ApplePayPaymentMethodType.idl; sourceTree = "<group>"; };
+ A1F6D00A1FE099210018078C /* JSApplePayModifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSApplePayModifier.cpp; sourceTree = "<group>"; };
+ A1F6D00C1FE099220018078C /* JSApplePayModifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSApplePayModifier.h; sourceTree = "<group>"; };
+ A1F6D00D1FE099640018078C /* JSApplePayPaymentMethodType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSApplePayPaymentMethodType.cpp; sourceTree = "<group>"; };
+ A1F6D00E1FE099640018078C /* JSApplePayPaymentMethodType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSApplePayPaymentMethodType.h; sourceTree = "<group>"; };
A1F76B101F44C2450014C318 /* PaymentRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaymentRequest.h; sourceTree = "<group>"; };
A1F76B111F44C2450014C318 /* PaymentRequest.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PaymentRequest.cpp; sourceTree = "<group>"; };
A1F76B121F44C2450014C318 /* PaymentRequest.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = PaymentRequest.idl; sourceTree = "<group>"; };
@@ -15353,6 +15358,8 @@
1A8A64401D19FCFB00D0E00F /* ApplePayPaymentMethodSelectedEvent.cpp */,
1A8A64421D19FCFB00D0E00F /* ApplePayPaymentMethodSelectedEvent.h */,
1A8A64431D19FCFB00D0E00F /* ApplePayPaymentMethodSelectedEvent.idl */,
+ A1F6D0031FE096F60018078C /* ApplePayPaymentMethodType.h */,
+ A1F6D0051FE096F60018078C /* ApplePayPaymentMethodType.idl */,
1ADFDFDA1E71D8DF008F5D34 /* ApplePayPaymentMethodUpdate.h */,
1ADFDFDB1E71D8DF008F5D34 /* ApplePayPaymentMethodUpdate.idl */,
7C6522F21E00A51700677F22 /* ApplePayPaymentPass.h */,
@@ -15509,6 +15516,8 @@
A1DF5A8A1F7EC0000058A477 /* JSApplePayMerchantCapability.h */,
A1F9296D1F8D9F5A00523AF3 /* JSApplePayMerchantValidationEvent.cpp */,
A1F9296E1F8D9F5B00523AF3 /* JSApplePayMerchantValidationEvent.h */,
+ A1F6D00A1FE099210018078C /* JSApplePayModifier.cpp */,
+ A1F6D00C1FE099220018078C /* JSApplePayModifier.h */,
7C65231D1E018B5A00677F22 /* JSApplePayPayment.cpp */,
7C65230A1E00DBB400677F22 /* JSApplePayPayment.h */,
1ADFDFE31E71DCA0008F5D34 /* JSApplePayPaymentAuthorizationResult.cpp */,
@@ -15521,10 +15530,10 @@
7C65230E1E00DBB400677F22 /* JSApplePayPaymentMethod.h */,
1AE96A7C1D1A0A8000B86768 /* JSApplePayPaymentMethodSelectedEvent.cpp */,
1AE96A7D1D1A0A8000B86768 /* JSApplePayPaymentMethodSelectedEvent.h */,
+ A1F6D00D1FE099640018078C /* JSApplePayPaymentMethodType.cpp */,
+ A1F6D00E1FE099640018078C /* JSApplePayPaymentMethodType.h */,
1ADFDFE51E71DCA0008F5D34 /* JSApplePayPaymentMethodUpdate.cpp */,
1ADFDFE61E71DCA0008F5D34 /* JSApplePayPaymentMethodUpdate.h */,
- A1CBEF5F1F9F09020028DE7C /* JSApplePayPaymentMethodUpdateEvent.cpp */,
- A1CBEF601F9F09020028DE7C /* JSApplePayPaymentMethodUpdateEvent.h */,
7C65230F1E00DBB400677F22 /* JSApplePayPaymentPass.cpp */,
7C6523101E00DBB400677F22 /* JSApplePayPaymentPass.h */,
7C6579EB1E00856600E3A27A /* JSApplePayPaymentRequest.cpp */,
@@ -20459,11 +20468,10 @@
A1F929671F8D9CDB00523AF3 /* ApplePayMerchantValidationEvent.cpp */,
A1F929661F8D9CDB00523AF3 /* ApplePayMerchantValidationEvent.h */,
A1F929681F8D9CDB00523AF3 /* ApplePayMerchantValidationEvent.idl */,
+ A1F6CFFC1FE096210018078C /* ApplePayModifier.h */,
+ A1F6CFFE1FE096210018078C /* ApplePayModifier.idl */,
A1DF5AA11F7EE1130058A477 /* ApplePayPaymentHandler.cpp */,
A1DF5AA01F7EE1130058A477 /* ApplePayPaymentHandler.h */,
- A1CBEF511F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.cpp */,
- A1CBEF501F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.h */,
- A1CBEF521F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.idl */,
A1DF5A7C1F7EBD0B0058A477 /* ApplePayRequest.h */,
A1DF5A7E1F7EBD0B0058A477 /* ApplePayRequest.idl */,
);
@@ -26078,6 +26086,7 @@
7C6579E31E00827000E3A27A /* ApplePayLineItem.h in Headers */,
A1DF5A861F7EBDF20058A477 /* ApplePayMerchantCapability.h in Headers */,
A1F929691F8D9CDB00523AF3 /* ApplePayMerchantValidationEvent.h in Headers */,
+ A1F6CFFF1FE096210018078C /* ApplePayModifier.h in Headers */,
7C6523011E00D03400677F22 /* ApplePayPayment.h in Headers */,
1A8A64521D19FCFB00D0E00F /* ApplePayPaymentAuthorizedEvent.h in Headers */,
7C6522FB1E00C90900677F22 /* ApplePayPaymentContact.h in Headers */,
@@ -26084,7 +26093,7 @@
A1DF5AA21F7EE1130058A477 /* ApplePayPaymentHandler.h in Headers */,
7C6522EF1E00A4C700677F22 /* ApplePayPaymentMethod.h in Headers */,
1A8A64561D19FCFC00D0E00F /* ApplePayPaymentMethodSelectedEvent.h in Headers */,
- A1CBEF531F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.h in Headers */,
+ A1F6D0061FE096F60018078C /* ApplePayPaymentMethodType.h in Headers */,
7C6522F51E00A51700677F22 /* ApplePayPaymentPass.h in Headers */,
7C6579E01E0079F900E3A27A /* ApplePayPaymentRequest.h in Headers */,
A1DF5A7F1F7EBD0B0058A477 /* ApplePayRequest.h in Headers */,
@@ -27357,12 +27366,13 @@
7C6579F01E00856600E3A27A /* JSApplePayLineItem.h in Headers */,
A1DF5A8E1F7EC0020058A477 /* JSApplePayMerchantCapability.h in Headers */,
A1F929701F8D9F5B00523AF3 /* JSApplePayMerchantValidationEvent.h in Headers */,
+ A1F6D0121FE099B40018078C /* JSApplePayModifier.h in Headers */,
7C6523141E00DBB400677F22 /* JSApplePayPayment.h in Headers */,
1AE96A8B1D1A0DDD00B86768 /* JSApplePayPaymentAuthorizedEvent.h in Headers */,
7C6523161E00DBB500677F22 /* JSApplePayPaymentContact.h in Headers */,
7C6523181E00DBB500677F22 /* JSApplePayPaymentMethod.h in Headers */,
1AE96A8D1D1A0DDD00B86768 /* JSApplePayPaymentMethodSelectedEvent.h in Headers */,
- A1CBEF621F9F09040028DE7C /* JSApplePayPaymentMethodUpdateEvent.h in Headers */,
+ A1F6D00F1FE099940018078C /* JSApplePayPaymentMethodType.h in Headers */,
7C65231A1E00DBB500677F22 /* JSApplePayPaymentPass.h in Headers */,
7C6579F21E00856600E3A27A /* JSApplePayPaymentRequest.h in Headers */,
A1DF5A8F1F7EC0020058A477 /* JSApplePayRequest.h in Headers */,
@@ -30289,7 +30299,6 @@
files = (
A9787CB41F5F5C6600C551C6 /* AccessibilityMediaObject.cpp in Sources */,
A1F9296A1F8D9CDB00523AF3 /* ApplePayMerchantValidationEvent.cpp in Sources */,
- A1CBEF541F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.cpp in Sources */,
CD0EEE0E14743F39003EAFA2 /* AudioDestinationIOS.cpp in Sources */,
CD5596911475B678001D0BD0 /* AudioFileReaderIOS.cpp in Sources */,
CDA79827170A279100D45C55 /* AudioSessionIOS.mm in Sources */,
@@ -30354,7 +30363,8 @@
CD063F821E23FA8900812BE3 /* InitDataRegistry.cpp in Sources */,
6A72798C1F16C29C003F39B8 /* InspectorShaderProgram.cpp in Sources */,
A1F9296F1F8D9F5B00523AF3 /* JSApplePayMerchantValidationEvent.cpp in Sources */,
- A1CBEF611F9F09040028DE7C /* JSApplePayPaymentMethodUpdateEvent.cpp in Sources */,
+ A1F6D0111FE099B20018078C /* JSApplePayModifier.cpp in Sources */,
+ A1F6D0101FE099960018078C /* JSApplePayPaymentMethodType.cpp in Sources */,
538EC93E1F99BF5A004D22A8 /* JSQuickTimePluginReplacement.cpp in Sources */,
935C477009AC4D7300A6AAB4 /* KeyEventMac.mm in Sources */,
CDA98E0B1603CD6000FEA3B1 /* LegacyCDM.cpp in Sources */,
Modified: trunk/Source/WebCore/dom/EventNames.h (225848 => 225849)
--- trunk/Source/WebCore/dom/EventNames.h 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/dom/EventNames.h 2017-12-13 18:02:28 UTC (rev 225849)
@@ -53,7 +53,6 @@
macro(animationend) \
macro(animationiteration) \
macro(animationstart) \
- macro(applepaypaymentmethodchanged) \
macro(applepayvalidatemerchant) \
macro(audioend) \
macro(audioprocess) \
Modified: trunk/Source/WebCore/dom/EventNames.in (225848 => 225849)
--- trunk/Source/WebCore/dom/EventNames.in 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/dom/EventNames.in 2017-12-13 18:02:28 UTC (rev 225849)
@@ -42,7 +42,6 @@
ApplePayMerchantValidationEvent conditional=APPLE_PAY
ApplePayPaymentAuthorizedEvent conditional=APPLE_PAY
ApplePayPaymentMethodSelectedEvent conditional=APPLE_PAY
-ApplePayPaymentMethodUpdateEvent conditional=APPLE_PAY
ApplePayShippingContactSelectedEvent conditional=APPLE_PAY
ApplePayShippingMethodSelectedEvent conditional=APPLE_PAY
ApplePayValidateMerchantEvent conditional=APPLE_PAY
Modified: trunk/Source/WebCore/testing/MockPaymentCoordinator.cpp (225848 => 225849)
--- trunk/Source/WebCore/testing/MockPaymentCoordinator.cpp 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/testing/MockPaymentCoordinator.cpp 2017-12-13 18:02:28 UTC (rev 225849)
@@ -105,6 +105,41 @@
});
}
+static ApplePayLineItem convert(const ApplePaySessionPaymentRequest::LineItem& lineItem)
+{
+ ApplePayLineItem result;
+ result.type = lineItem.type;
+ result.label = lineItem.label;
+ result.amount = lineItem.amount;
+ return result;
+}
+
+void MockPaymentCoordinator::updateTotalAndLineItems(const ApplePaySessionPaymentRequest::TotalAndLineItems& totalAndLineItems)
+{
+ m_total = convert(totalAndLineItems.total);
+ m_lineItems.clear();
+ for (auto& lineItem : totalAndLineItems.lineItems)
+ m_lineItems.append(convert(lineItem));
+}
+
+void MockPaymentCoordinator::completeShippingMethodSelection(std::optional<ShippingMethodUpdate>&& shippingMethodUpdate)
+{
+ if (shippingMethodUpdate)
+ updateTotalAndLineItems(shippingMethodUpdate->newTotalAndLineItems);
+}
+
+void MockPaymentCoordinator::completeShippingContactSelection(std::optional<ShippingContactUpdate>&& shippingContactUpdate)
+{
+ if (shippingContactUpdate)
+ updateTotalAndLineItems(shippingContactUpdate->newTotalAndLineItems);
+}
+
+void MockPaymentCoordinator::completePaymentMethodSelection(std::optional<PaymentMethodUpdate>&& paymentMethodUpdate)
+{
+ if (paymentMethodUpdate)
+ updateTotalAndLineItems(paymentMethodUpdate->newTotalAndLineItems);
+}
+
void MockPaymentCoordinator::changeShippingOption(String&& shippingOption)
{
dispatchIfShowing([mainFrame = makeRef(m_mainFrame), shippingOption = WTFMove(shippingOption)]() mutable {
Modified: trunk/Source/WebCore/testing/MockPaymentCoordinator.h (225848 => 225849)
--- trunk/Source/WebCore/testing/MockPaymentCoordinator.h 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/testing/MockPaymentCoordinator.h 2017-12-13 18:02:28 UTC (rev 225849)
@@ -27,6 +27,7 @@
#if ENABLE(APPLE_PAY)
+#include "ApplePayLineItem.h"
#include "MockPaymentAddress.h"
#include "PaymentCoordinatorClient.h"
@@ -45,6 +46,9 @@
void acceptPayment();
void cancelPayment();
+ const ApplePayLineItem& total() const { return m_total; }
+ const Vector<ApplePayLineItem>& lineItems() const { return m_lineItems; }
+
void ref() const { }
void deref() const { }
@@ -55,16 +59,20 @@
void openPaymentSetup(const String&, const String&, WTF::Function<void(bool)>&&);
bool showPaymentUI(const URL&, const Vector<URL>&, const ApplePaySessionPaymentRequest&) final;
void completeMerchantValidation(const PaymentMerchantSession&) final;
- void completeShippingMethodSelection(std::optional<ShippingMethodUpdate>&&) final { }
- void completeShippingContactSelection(std::optional<ShippingContactUpdate>&&) final { }
- void completePaymentMethodSelection(std::optional<PaymentMethodUpdate>&&) final { }
+ void completeShippingMethodSelection(std::optional<ShippingMethodUpdate>&&) final;
+ void completeShippingContactSelection(std::optional<ShippingContactUpdate>&&) final;
+ void completePaymentMethodSelection(std::optional<PaymentMethodUpdate>&&) final;
void completePaymentSession(std::optional<PaymentAuthorizationResult>&&) final;
void abortPaymentSession() final;
void cancelPaymentSession() final;
void paymentCoordinatorDestroyed() final;
+ void updateTotalAndLineItems(const ApplePaySessionPaymentRequest::TotalAndLineItems&);
+
MainFrame& m_mainFrame;
MockPaymentAddress m_shippingAddress;
+ ApplePayLineItem m_total;
+ Vector<ApplePayLineItem> m_lineItems;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/testing/MockPaymentCoordinator.idl (225848 => 225849)
--- trunk/Source/WebCore/testing/MockPaymentCoordinator.idl 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/testing/MockPaymentCoordinator.idl 2017-12-13 18:02:28 UTC (rev 225849)
@@ -32,4 +32,7 @@
void changePaymentMethod(ApplePayPaymentMethod paymentMethod);
void acceptPayment();
void cancelPayment();
+
+ readonly attribute ApplePayLineItem total;
+ readonly attribute sequence<ApplePayLineItem> lineItems;
};