安全上下文
此特征只可用于
安全上下文
(HTTPS),在某些或所有
支持浏览器
.
这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
details
只读特性在
PaymentResponse
interface returns a JSON-serializable object that provides a payment method specific message used by the merchant to process the transaction and determine a successful funds transfer.
This data is returned by the payment app that satisfies the payment request, and must conform to the structure defined in the
BasicCardResponse
字典。
var detailsObject = PaymentResponse.details;
The following example extracts the details 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 | 候选推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
details
|
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