Move URL from WebCore to WTF
[WebKit-https.git] / Source / WebKitLegacy / mac / WebCoreSupport / WebPaymentCoordinatorClient.mm
1 /*
2  * Copyright (C) 2015-2018 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #import "WebPaymentCoordinatorClient.h"
27
28 #if ENABLE(APPLE_PAY)
29
30 #import <wtf/MainThread.h>
31 #import <wtf/URL.h>
32
33 WebPaymentCoordinatorClient::WebPaymentCoordinatorClient()
34 {
35 }
36
37 WebPaymentCoordinatorClient::~WebPaymentCoordinatorClient()
38 {
39 }
40
41 bool WebPaymentCoordinatorClient::supportsVersion(unsigned)
42 {
43     return false;
44 }
45
46 std::optional<String> WebPaymentCoordinatorClient::validatedPaymentNetwork(const String&)
47 {
48     return std::nullopt;
49 }
50
51 bool WebPaymentCoordinatorClient::canMakePayments()
52 {
53     return false;
54 }
55
56 void WebPaymentCoordinatorClient::canMakePaymentsWithActiveCard(const String&, const String&, WTF::Function<void (bool)>&& completionHandler)
57 {
58     callOnMainThread([completionHandler = WTFMove(completionHandler)] {
59         completionHandler(false);
60     });
61 }
62
63 void WebPaymentCoordinatorClient::openPaymentSetup(const String&, const String&, WTF::Function<void (bool)>&& completionHandler)
64 {
65     callOnMainThread([completionHandler = WTFMove(completionHandler)] {
66         completionHandler(false);
67     });
68 }
69
70 bool WebPaymentCoordinatorClient::showPaymentUI(const URL&, const Vector<URL>&, const WebCore::ApplePaySessionPaymentRequest&)
71 {
72     return false;
73 }
74
75 void WebPaymentCoordinatorClient::completeMerchantValidation(const WebCore::PaymentMerchantSession&)
76 {
77 }
78
79 void WebPaymentCoordinatorClient::completeShippingMethodSelection(std::optional<WebCore::ShippingMethodUpdate>&&)
80 {
81 }
82
83 void WebPaymentCoordinatorClient::completeShippingContactSelection(std::optional<WebCore::ShippingContactUpdate>&&)
84 {
85 }
86
87 void WebPaymentCoordinatorClient::completePaymentMethodSelection(std::optional<WebCore::PaymentMethodUpdate>&&)
88 {
89 }
90
91 void WebPaymentCoordinatorClient::completePaymentSession(std::optional<WebCore::PaymentAuthorizationResult>&&)
92 {
93 }
94
95 void WebPaymentCoordinatorClient::abortPaymentSession()
96 {
97 }
98
99 void WebPaymentCoordinatorClient::cancelPaymentSession()
100 {
101 }
102
103 void WebPaymentCoordinatorClient::paymentCoordinatorDestroyed()
104 {
105     delete this;
106 }
107
108 #endif