haikuwebkit/Source/WebCore/testing/MockPaymentAddress.idl

39 lines
1.6 KiB
Plaintext
Raw Permalink Normal View History

[Payment Request] Resolve PaymentRequest.show()'s accept promise when a payment is authorized https://bugs.webkit.org/show_bug.cgi?id=178609 <rdar://problem/33542813> Reviewed by Alex Christensen. Source/WebCore: This patch implements the logic for resolving PaymentRequest.show()'s accept promise when the user authorizes a payment, and implements PaymentResponse.complete(). Tests: http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html http/tests/paymentrequest/payment-response-complete-method.https.html http/tests/paymentrequest/payment-response-methodName-attribute.https.html http/tests/paymentrequest/payment-response-payerEmail-attribute.https.html http/tests/paymentrequest/payment-response-payerName-attribute.https.html http/tests/paymentrequest/payment-response-payerPhone-attribute.https.html * DerivedSources.make: * Modules/applepay/ApplePayPaymentContact.h: * Modules/applepay/Payment.h: (WebCore::Payment::Payment): Deleted. (WebCore::Payment::pkPayment const): Deleted. * Modules/applepay/PaymentContact.h: (WebCore::PaymentContact::PaymentContact): Deleted. (WebCore::PaymentContact::pkContact const): Deleted. * Modules/applepay/cocoa/PaymentContactCocoa.mm: (WebCore::convert): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::hasActiveSession): (WebCore::ApplePayPaymentHandler::ApplePayPaymentHandler): (WebCore::ApplePayPaymentHandler::document): (WebCore::ApplePayPaymentHandler::paymentCoordinator): (WebCore::ApplePayPaymentHandler::convertData): (WebCore::ApplePayPaymentHandler::show): (WebCore::ApplePayPaymentHandler::hide): (WebCore::ApplePayPaymentHandler::canMakePayment): (WebCore::ApplePayPaymentHandler::complete): (WebCore::convert): (WebCore::ApplePayPaymentHandler::didAuthorizePayment): (WebCore::ApplePayPaymentHandler::didSelectShippingMethod): (WebCore::ApplePayPaymentHandler::didSelectShippingContact): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: * Modules/paymentrequest/PaymentAddress.h: * Modules/paymentrequest/PaymentAddress.idl: * Modules/paymentrequest/PaymentHandler.cpp: (WebCore::PaymentHandler::create): * Modules/paymentrequest/PaymentHandler.h: * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::show): (WebCore::PaymentRequest::stop): (WebCore::PaymentRequest::canMakePayment): (WebCore::PaymentRequest::canSuspendForDocumentSuspension const): (WebCore::PaymentRequest::shippingAddressChanged): (WebCore::PaymentRequest::shippingOptionChanged): (WebCore::PaymentRequest::accept): (WebCore::PaymentRequest::complete): * Modules/paymentrequest/PaymentRequest.h: * Modules/paymentrequest/PaymentResponse.cpp: (WebCore::PaymentResponse::PaymentResponse): (WebCore::PaymentResponse::complete): * Modules/paymentrequest/PaymentResponse.h: * WebCore.xcodeproj/project.pbxproj: * testing/Internals.cpp: (WebCore::Internals::Internals): (WebCore::Internals::mockPaymentCoordinator const): * testing/Internals.h: * testing/Internals.idl: * testing/MockPayment.h: Added. * testing/MockPaymentAddress.h: Added. * testing/MockPaymentAddress.idl: Added. * testing/MockPaymentContact.h: Added. * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard): (WebCore::MockPaymentCoordinator::openPaymentSetup): (WebCore::dispatchIfShowing): (WebCore::MockPaymentCoordinator::showPaymentUI): (WebCore::MockPaymentCoordinator::completeMerchantValidation): (WebCore::MockPaymentCoordinator::completePaymentSession): (WebCore::MockPaymentCoordinator::abortPaymentSession): (WebCore::MockPaymentCoordinator::cancelPaymentSession): (WebCore::MockPaymentCoordinator::paymentCoordinatorDestroyed): * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.idl: Added. LayoutTests: * http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https-expected.txt: Added. * http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html: Copied from imported/w3c/web-platform-tests/payment-request/PaymentAddress/attributes-and-toJSON-method-manual.https.html. * http/tests/paymentrequest/payment-response-complete-method.https-expected.txt: Added. * http/tests/paymentrequest/payment-response-complete-method.https.html: Copied from imported/w3c/web-platform-tests/payment-request/payment-response/complete-method-manual.https.html. * http/tests/paymentrequest/payment-response-methodName-attribute.https-expected.txt: Added. * http/tests/paymentrequest/payment-response-methodName-attribute.https.html: Copied from imported/w3c/web-platform-tests/payment-request/payment-response/methodName-attribute-manual.https.html. * http/tests/paymentrequest/payment-response-payerEmail-attribute.https-expected.txt: Added. * http/tests/paymentrequest/payment-response-payerEmail-attribute.https.html: Copied from imported/w3c/web-platform-tests/payment-request/payment-response/payerEmail-attribute-manual.https.html. * http/tests/paymentrequest/payment-response-payerName-attribute.https-expected.txt: Added. * http/tests/paymentrequest/payment-response-payerName-attribute.https.html: Copied from imported/w3c/web-platform-tests/payment-request/payment-response/payerName-attribute-manual.https.html. * http/tests/paymentrequest/payment-response-payerPhone-attribute.https-expected.txt: Added. * http/tests/paymentrequest/payment-response-payerPhone-attribute.https.html: Copied from imported/w3c/web-platform-tests/payment-request/payment-response/payerPhone-attribute-manual.https.html. * http/tests/paymentrequest/resources/helpers.js: Copied from imported/w3c/web-platform-tests/payment-request/payment-response/helpers.js. (test): (async.getPaymentResponse): (async.getPaymentRequestResponse): (async.runTest): Canonical link: https://commits.webkit.org/194851@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223855 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-23 21:00:45 +00:00
/*
* 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
] dictionary MockPaymentAddress {
DOMString countryCode;
FrozenArray<DOMString> addressLines;
DOMString administrativeArea;
DOMString locality;
DOMString subLocality;
DOMString postalCode;
DOMString localizedName;
DOMString phoneNumber;
DOMString emailAddress;
};