安全上下文
此特征只可用于
安全上下文
(HTTPS),在某些或所有
支持浏览器
.
methodName
只读特性在
PaymentResponse
interface returns a string uniquely identifying the payment handler selected by the user.
This string may be either one of the standardized payment method identifiers or a URL used by the payment handler to process payments.
var methodName = PaymentResponse.methodName;
A
DOMString
uniquely identifying the payment handler being used to process the payment. This may be either a standardized identifier, or a URL used by the payment processor to handle payments. See
Merchant validation
in
Payment processing concepts
了解更多信息。
The following example extracts the method name from the
PaymentResponse
object to the promise returned from
PaymentRequest.show()
. In a real-world implementation this data would then be sent to a payment server.
payment.show().then(paymentResponse => {
var paymentData = {
// payment method string
method: paymentResponse.methodName,
// payment details as you requested
details: paymentResponse.details,
// shipping address information
address: toDict(paymentResponse.shippingAddress)
};
// Send information to the server
});
| 规范 | 状态 | 注释 |
|---|---|---|
| 支付请求 API | 候选推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
methodName
|
Chrome 61 | Edge 15 |
Firefox
56
注意事项
Disabled
|
IE 不支持 No | Opera 不支持 No | Safari Yes | WebView Android 不支持 No | Chrome Android 56 |
Firefox Android
56
注意事项
Disabled
|
Opera Android 不支持 No | Safari iOS Yes | Samsung Internet Android 6.0 |
完整支持
不支持
见实现注意事项。
用户必须明确启用此特征。
PaymentResponse