PaymentMethodChangeEvent

Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers .

PaymentMethodChangeEvent interface of the 支付请求 API describes the paymentmethodchange event which is fired by some payment handlers when the user switches payment instruments (e.g., a user selects a "store" card to make a purchase while using Apple Pay).

构造函数

PaymentMethodChangeEvent()
Creates and returns a new PaymentMethodChangeEvent object, optionally initialized with values taken from a given PaymentMethodChangeEventInit dictionary.

特性

In addition to the properties below, this interface includes properties inherited from PaymentRequestUpdateEvent .

methodDetails 只读 Secure context
An object containing payment method-specific data useful when handling a payment method change. If no such information is available, this value is null .
methodName 只读 Secure context
A DOMString containing the payment method identifier, a string which uniquely identifies a particular payment method. This identifier is usually a URL used during the payment process, but may be a standardized non-URL string as well, such as basic-card . The default value is the empty string, "" .

方法

This interface includes methods inherited from PaymentRequestUpdateEvent .

规范

规范 状态 Comment
支付请求 API
The definition of 'PaymentMethodChangeEvent' in that specification.
候选推荐 初始定义。

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
PaymentMethodChangeEvent Chrome 不支持 No Edge 不支持 No Firefox 63
注意事项 Disabled
63
注意事项 Disabled
Available only in nightly builds.
Disabled From version 63: this feature is behind the dom.payments.request.enabled preference (needs to be set to true ) and the dom.payments.request.supportedRegions preference (needs to be set to A comma-delineated list of one or more 2-character ISO country codes indicating the countries in which to support payments (for example, US,CA . ). To change preferences in Firefox, visit about:config.
IE 不支持 No Opera 不支持 No Safari ? WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 63
注意事项 Disabled
63
注意事项 Disabled
Available only in nightly builds.
Disabled From version 63: this feature is behind the dom.payments.request.enabled preference (needs to be set to true ) and the dom.payments.request.supportedRegions preference (needs to be set to A comma-delineated list of one or more 2-character ISO country codes indicating the countries in which to support payments (for example, US,CA . ). To change preferences in Firefox, visit about:config.
Opera Android 不支持 No Safari iOS ? Samsung Internet Android 不支持 No
methodDetails Chrome 不支持 No Edge 不支持 No Firefox 63
注意事项 Disabled
63
注意事项 Disabled
Available only in nightly builds.
Disabled From version 63: this feature is behind the dom.payments.request.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE 不支持 No Opera 不支持 No Safari ? WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 63
注意事项 Disabled
63
注意事项 Disabled
Available only in nightly builds.
Disabled From version 63: this feature is behind the dom.payments.request.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android 不支持 No Safari iOS ? Samsung Internet Android 不支持 No
methodName Chrome 不支持 No Edge 不支持 No Firefox 63
注意事项 Disabled
63
注意事项 Disabled
Available only in nightly builds.
Disabled From version 63: this feature is behind the dom.payments.request.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE 不支持 No Opera 不支持 No Safari ? WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 63
注意事项 Disabled
63
注意事项 Disabled
Available only in nightly builds.
Disabled From version 63: this feature is behind the dom.payments.request.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android 不支持 No Safari iOS ? Samsung Internet Android 不支持 No

图例

完整支持
完整支持
不支持
不支持
兼容性未知
兼容性未知
见实现注意事项。
用户必须明确启用此特征。
用户必须明确启用此特征。