Skip to content

Commit

Permalink
[Apple Pay] Support for PKDisbursementRequest on WebKit
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=267428
rdar://115776022

Reviewed by Alex Christensen.
Originally authored by Robin Malhotra.

This patch adds support for `PKDisbursementRequest` and associated
classes. Since `PKDisbursementPaymentRequest` is a subclass and not a
property, the code paths may sometimes diverge from convention.

* LayoutTests/http/tests/paymentrequest/ApplePayModifier-disbursementPaymentRequest.https-expected.txt: Added.
* LayoutTests/http/tests/paymentrequest/ApplePayModifier-disbursementPaymentRequest.https.html: Added.
* LayoutTests/platform/ios-wk2/TestExpectations:
* LayoutTests/platform/mac-wk2/TestExpectations:
* Source/WTF/wtf/PlatformEnableCocoa.h:
* Source/WebCore/DerivedSources-input.xcfilelist:
* Source/WebCore/DerivedSources-output.xcfilelist:
* Source/WebCore/DerivedSources.make:
* Source/WebCore/Modules/applepay/ApplePayDetailsUpdateBase.h:
* Source/WebCore/Modules/applepay/ApplePayDetailsUpdateBase.idl:
* Source/WebCore/Modules/applepay/ApplePayDisbursementPaymentRequest.h: Copied from Source/WebCore/Modules/applepay/ApplePayMerchantCapability.h.
* Source/WebCore/Modules/applepay/ApplePayDisbursementPaymentRequest.idl: Copied from Source/WebCore/Modules/applepay/ApplePayMerchantCapability.idl.
* Source/WebCore/Modules/applepay/ApplePayFeature.h:
* Source/WebCore/Modules/applepay/ApplePayFeature.idl:
* Source/WebCore/Modules/applepay/ApplePayLineItem.h:
* Source/WebCore/Modules/applepay/ApplePayLineItem.idl:
* Source/WebCore/Modules/applepay/ApplePayMerchantCapability.cpp:
(WebCore::convertAndValidate):
* Source/WebCore/Modules/applepay/ApplePayMerchantCapability.h:
* Source/WebCore/Modules/applepay/ApplePayMerchantCapability.idl:
* Source/WebCore/Modules/applepay/ApplePayPaymentRequest.h:
* Source/WebCore/Modules/applepay/ApplePayPaymentRequest.idl:
* Source/WebCore/Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
* Source/WebCore/Modules/applepay/ApplePaySessionPaymentRequest.h:
(WebCore::ApplePaySessionPaymentRequest::disbursementPaymentRequest const):
(WebCore::ApplePaySessionPaymentRequest::setDisbursementPaymentRequest):
* Source/WebCore/Modules/applepay/PaymentSummaryItems.h:
* Source/WebCore/Modules/applepay/cocoa/PaymentSummaryItemsCocoa.mm:
(WebCore::platformDisbursementSummaryItem):
(WebCore::platformInstantFundsOutFeeSummaryItem):
(WebCore::platformSummaryItem):
(WebCore::platformDisbursementSummaryItems):
* Source/WebCore/Modules/applepay/paymentrequest/ApplePayModifier.h:
* Source/WebCore/Modules/applepay/paymentrequest/ApplePayModifier.idl:
* Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::show):
(WebCore::ApplePayPaymentHandler::shippingAddressUpdated):
(WebCore::ApplePayPaymentHandler::shippingOptionUpdated):
(WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
* Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.h:
* Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.mm:
* Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h:
* Source/WebCore/SourcesCocoa.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::showPaymentUI):
(WebCore::MockPaymentCoordinator::completeShippingMethodSelection):
(WebCore::MockPaymentCoordinator::completeShippingContactSelection):
(WebCore::MockPaymentCoordinator::completePaymentMethodSelection):
* Source/WebCore/testing/MockPaymentCoordinator.h:
* Source/WebCore/testing/MockPaymentCoordinator.idl:
* Source/WebKit/Platform/cocoa/PaymentAuthorizationPresenter.mm:
(WebKit::PaymentAuthorizationPresenter::completePaymentMethodSelection):
(WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection):
* Source/WebKit/Shared/ApplePay/DisbursementPaymentRequest.h: Copied from Source/WebCore/Modules/applepay/ApplePayMerchantCapability.h.
* Source/WebKit/Shared/ApplePay/cocoa/DisbursementPaymentRequestCocoa.mm: Added.
(WebKit::platformDisbursementPaymentRequest):
* Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
* Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toPKMerchantCapabilities):
* Source/WebKit/Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
* Source/WebKit/Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/SourcesCocoa.txt:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:

Canonical link: https://commits.webkit.org/275146@main
  • Loading branch information
Robin Malhotra authored and aprotyas committed Feb 22, 2024
1 parent 7b9edce commit e7d3256
Show file tree
Hide file tree
Showing 46 changed files with 691 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

PASS Should have a feature for `disbursementPaymentRequest`.
PASS Should propagate all data as part of the request.

Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<!doctype html>
<meta charset="utf-8" />
<title>
Tests for providing `disbursementPaymentRequest` as part of
`ApplePayModifier`.
</title>
<script src="/js-test-resources/ui-helper.js"></script>
<script src="/resources/payment-request.js"></script>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
setup({ explicit_done: true, explicit_timeout: true });

test((test) => {
const method = validPaymentMethod();
method.data.features = ["paymentRequestDisbursements"];
new PaymentRequest([method], validPaymentDetails());
}, "Should have a feature for `disbursementPaymentRequest`.");

const RESOLVED_PROMISE = Promise.resolve({});

const lineItems = {
total: {
label: "Chime",
amount: "15.00",
},
ifo: {
label: "Instant Transfer Fee",
amount: "0.15",
disbursementLineItemType: "instantFundsOutFee",
},
disbursement: {
label: "Total Amount",
amount: "14.85",
disbursementLineItemType: "disbursement",
},
};

const validLineItems = [
lineItems.total,
lineItems.ifo,
lineItems.disbursement,
];

function modifiersWithData(data, lineItems) {
data.additionalLineItems = lineItems;
return [
{ supportedMethods: "https://apple.com/apple-pay", data: { ...data } },
];
}

function testValidDisbursementPaymentRequest(description, options) {
const {
initialDisbursementPaymentRequest,
expectedDisbursementPaymentRequest,
} = options;
user_activation_test(async (test) => {
const detailsInit = {
total: {
label: "Disbursement",
amount: {
value: "14.85",
currency: "USD",
},
},
};
if (initialDisbursementPaymentRequest !== undefined) {
detailsInit.modifiers = modifiersWithData(
{ disbursementPaymentRequest: initialDisbursementPaymentRequest },
validLineItems,
);
}

const request = new PaymentRequest([validPaymentMethod()], detailsInit);
request.addEventListener("merchantvalidation", (event) => {
event.complete(RESOLVED_PROMISE);
});

request.addEventListener("shippingaddresschange", (event) => {
event.updateWith({});
internals.mockPaymentCoordinator.changePaymentMethod({
type: "debit",
});
});

request.addEventListener("paymentmethodchange", (event) => {
event.updateWith(RESOLVED_PROMISE);
internals.mockPaymentCoordinator.acceptPayment();
});

const response = await request.show();

const { disbursementPaymentRequest } = internals.mockPaymentCoordinator;
const assert = disbursementPaymentRequest
? assert_object_equals
: assert_equals;
assert(
disbursementPaymentRequest,
expectedDisbursementPaymentRequest,
"check that the `DisbursementPaymentRequest` matches",
);
await response.compconste("success");
}, description + " as part of the request.");
}

testValidDisbursementPaymentRequest("Should propagate all data", {
initialDisbursementPaymentRequest: {},
expectedDisbursementPaymentRequest: {},
});

// We don't need invalidation tests since a disbursement request is an empty dictionary.

done();
</script>
</body>
1 change: 1 addition & 0 deletions LayoutTests/platform/ios-wk2/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ accessibility/ios-simulator/image-overlay-elements.html [ Pass ]
http/tests/ssl/applepay [ Pass ]
webkit.org/b/212975 http/tests/ssl/applepay/PaymentRequest.https.html [ Pass Timeout ]

http/tests/paymentrequest/ApplePayModifier-disbursementPaymentRequest.https.html [ Skip ]
http/tests/paymentrequest [ Pass ]
imported/w3c/web-platform-tests/payment-request [ Pass ]
webkit.org/b/175611 imported/w3c/web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-cross-origin-bc-containers.https.html [ Skip ]
Expand Down
1 change: 1 addition & 0 deletions LayoutTests/platform/mac-wk2/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html [ Pass ]

webkit.org/b/229423 [ BigSur Debug arm64 ] http/tests/paymentrequest/payment-response-reference-cycle-leak.https.html [ Pass Crash ]

http/tests/paymentrequest/ApplePayModifier-disbursementPaymentRequest.https.html [ Skip ]
http/tests/paymentrequest [ Pass ]
http/tests/inspector/paymentrequest [ Pass ]
imported/w3c/web-platform-tests/payment-request [ Pass ]
Expand Down
4 changes: 4 additions & 0 deletions Source/WTF/wtf/PlatformEnableCocoa.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@
#define ENABLE_APPLE_PAY_DEFERRED_PAYMENTS 1
#endif

#if !defined(ENABLE_APPLE_PAY_DISBURSEMENTS) && HAVE(PASSKIT_DISBURSEMENTS)
#define ENABLE_APPLE_PAY_DISBURSEMENTS 1
#endif

#if !PLATFORM(MAC) && !PLATFORM(MACCATALYST) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)

#if !defined(ENABLE_APPLE_PAY_REMOTE_UI)
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/DerivedSources-input.xcfilelist
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ $(PROJECT_DIR)/Modules/applepay/ApplePayCouponCodeUpdate.idl
$(PROJECT_DIR)/Modules/applepay/ApplePayDateComponents.idl
$(PROJECT_DIR)/Modules/applepay/ApplePayDateComponentsRange.idl
$(PROJECT_DIR)/Modules/applepay/ApplePayDeferredPaymentRequest.idl
$(PROJECT_DIR)/Modules/applepay/ApplePayDisbursementPaymentRequest.idl
$(PROJECT_DIR)/Modules/applepay/ApplePayDetailsUpdateBase.idl
$(PROJECT_DIR)/Modules/applepay/ApplePayError.idl
$(PROJECT_DIR)/Modules/applepay/ApplePayErrorCode.idl
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/DerivedSources-output.xcfilelist
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePayDeferredPaymentRequest.cp
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePayDeferredPaymentRequest.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePayDetailsUpdateBase.cpp
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePayDetailsUpdateBase.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePayDisbursementPaymentRequest.cpp
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePayDisbursementPaymentRequest.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePayError.cpp
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePayError.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePayErrorCode.cpp
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/DerivedSources.make
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ JS_BINDING_IDLS := \
$(WebCore)/Modules/applepay/ApplePayDateComponents.idl \
$(WebCore)/Modules/applepay/ApplePayDateComponentsRange.idl \
$(WebCore)/Modules/applepay/ApplePayDeferredPaymentRequest.idl \
$(WebCore)/Modules/applepay/ApplePayDisbursementPaymentRequest.idl \
$(WebCore)/Modules/applepay/ApplePayDetailsUpdateBase.idl \
$(WebCore)/Modules/applepay/ApplePayError.idl \
$(WebCore)/Modules/applepay/ApplePayErrorCode.idl \
Expand Down
5 changes: 5 additions & 0 deletions Source/WebCore/Modules/applepay/ApplePayDetailsUpdateBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include "ApplePayAutomaticReloadPaymentRequest.h"
#include "ApplePayDeferredPaymentRequest.h"
#include "ApplePayDisbursementPaymentRequest.h"
#include "ApplePayLineItem.h"
#include "ApplePayPaymentTokenContext.h"
#include "ApplePayRecurringPaymentRequest.h"
Expand All @@ -55,6 +56,10 @@ struct ApplePayDetailsUpdateBase {
#if ENABLE(APPLE_PAY_DEFERRED_PAYMENTS)
std::optional<ApplePayDeferredPaymentRequest> newDeferredPaymentRequest;
#endif

#if ENABLE(APPLE_PAY_DISBURSEMENTS)
std::optional<ApplePayDisbursementPaymentRequest> newDisbursementPaymentRequest;
#endif
};

} // namespace WebCore
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/Modules/applepay/ApplePayDetailsUpdateBase.idl
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@
[Conditional=APPLE_PAY_MULTI_MERCHANT_PAYMENTS] sequence<ApplePayPaymentTokenContext> newMultiTokenContexts;

[Conditional=APPLE_PAY_DEFERRED_PAYMENTS] ApplePayDeferredPaymentRequest newDeferredPaymentRequest;

[Conditional=APPLE_PAY_DISBURSEMENTS] ApplePayDisbursementPaymentRequest newDisbursementPaymentRequest;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (C) 2024 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_DISBURSEMENTS)

#include <WebCore/ApplePayLineItem.h>
#include <wtf/WallTime.h>
#include <wtf/text/WTFString.h>

namespace WebCore {

template<typename> class ExceptionOr;

struct ApplePayDisbursementPaymentRequest final {
ExceptionOr<void> validate() const;
ExceptionOr<ApplePayDisbursementPaymentRequest> convertAndValidate() &&;
};

} // namespace WebCore

#endif // ENABLE(APPLE_PAY_DISBURSEMENTS)
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (C) 2024 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_DISBURSEMENTS,
ExportMacro=WEBCORE_EXPORT,
JSGenerateToJSObject,
] dictionary ApplePayDisbursementPaymentRequest {
};
3 changes: 3 additions & 0 deletions Source/WebCore/Modules/applepay/ApplePayFeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ enum class ApplePayFeature : uint8_t {
#if ENABLE(APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE)
ShippingMethodDateComponentsRange,
#endif
#if ENABLE(APPLE_PAY_DISBURSEMENTS)
PaymentRequestDisbursements,
#endif
};

} // namespace WebCore
Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/Modules/applepay/ApplePayFeature.idl
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,7 @@
#if defined(ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE) && ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE
, "shippingMethodDateComponentsRange"
#endif
#if defined(ENABLE_APPLE_PAY_DISBURSEMENTS) && ENABLE_APPLE_PAY_DISBURSEMENTS
, "paymentRequestDisbursements"
#endif
};
12 changes: 12 additions & 0 deletions Source/WebCore/Modules/applepay/ApplePayLineItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ struct ApplePayLineItem final {
#if ENABLE(APPLE_PAY_AUTOMATIC_RELOAD_LINE_ITEM)
String automaticReloadPaymentThresholdAmount; /* required */
#endif

#if ENABLE(APPLE_PAY_DISBURSEMENTS)

enum class DisbursementLineItemType : uint8_t {
Disbursement,
InstantFundsOutFee,
};

std::optional<DisbursementLineItemType> disbursementLineItemType;

#endif

};

} // namespace WebCore
Expand Down
9 changes: 9 additions & 0 deletions Source/WebCore/Modules/applepay/ApplePayLineItem.idl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
"final"
};

[
Conditional=APPLE_PAY_DISBURSEMENTS,
] enum ApplePayDisbursementLineItemType {
"disbursement",
"instantFundsOutFee"
};

[
Conditional=APPLE_PAY,
ExportMacro=WEBCORE_EXPORT,
Expand All @@ -49,4 +56,6 @@
[Conditional=APPLE_PAY_DEFERRED_LINE_ITEM] Date deferredPaymentDate;

[Conditional=APPLE_PAY_AUTOMATIC_RELOAD_LINE_ITEM] DOMString automaticReloadPaymentThresholdAmount; // required

[Conditional=APPLE_PAY_DISBURSEMENTS] ApplePayDisbursementLineItemType disbursementLineItemType;
};
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ ExceptionOr<ApplePaySessionPaymentRequest::MerchantCapabilities> convertAndValid
case ApplePayMerchantCapability::SupportsDebit:
result.supportsDebit = true;
break;
#if ENABLE(APPLE_PAY_DISBURSEMENTS)
case ApplePayMerchantCapability::SupportsInstantFundsOut:
result.supportsInstantFundsOut = true;
break;
#endif
}
}

Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/Modules/applepay/ApplePayMerchantCapability.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ enum class ApplePayMerchantCapability {
SupportsEMV,
SupportsCredit,
SupportsDebit,
#if ENABLE(APPLE_PAY_DISBURSEMENTS)
SupportsInstantFundsOut
#endif
};

ExceptionOr<ApplePaySessionPaymentRequest::MerchantCapabilities> convertAndValidate(const Vector<ApplePayMerchantCapability>&);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@
"supports3DS",
"supportsEMV",
"supportsCredit",
"supportsDebit"
"supportsDebit",
#if defined(ENABLE_APPLE_PAY_DISBURSEMENTS) && ENABLE_APPLE_PAY_DISBURSEMENTS
"supportsInstantFundsOut"
#endif
};
5 changes: 5 additions & 0 deletions Source/WebCore/Modules/applepay/ApplePayPaymentRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include "ApplePayAutomaticReloadPaymentRequest.h"
#include "ApplePayDeferredPaymentRequest.h"
#include "ApplePayDisbursementPaymentRequest.h"
#include "ApplePayLineItem.h"
#include "ApplePayPaymentContact.h"
#include "ApplePayPaymentTokenContext.h"
Expand Down Expand Up @@ -65,6 +66,10 @@ struct ApplePayPaymentRequest : ApplePayRequestBase {
#if ENABLE(APPLE_PAY_DEFERRED_PAYMENTS)
std::optional<ApplePayDeferredPaymentRequest> deferredPaymentRequest;
#endif

#if ENABLE(APPLE_PAY_DISBURSEMENTS)
std::optional<ApplePayDisbursementPaymentRequest> disbursementPaymentRequest;
#endif
};

}
Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/Modules/applepay/ApplePayPaymentRequest.idl
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,7 @@
[Conditional=APPLE_PAY_MULTI_MERCHANT_PAYMENTS] sequence<ApplePayPaymentTokenContext> multiTokenContexts;

[Conditional=APPLE_PAY_DEFERRED_PAYMENTS] ApplePayDeferredPaymentRequest deferredPaymentRequest;

[Conditional=APPLE_PAY_DISBURSEMENTS] ApplePayDisbursementPaymentRequest disbursementPaymentRequest;

};
Loading

0 comments on commit e7d3256

Please sign in to comment.