安全上下文
此特征只可用于 安全上下文 (HTTPS),在某些或所有 支持浏览器 .

这是 实验性技术
检查 浏览器兼容性表格 要小心谨慎在生产中使用这之前。

expiryMonth 特性为 BasicCardResponse dictionary contains the expiry month of the card used to make the payment.

句法

"expiryMonth" : "number"
					

A DOMString representing the card expiry month as a two-digit number in the range 01 to 12.

范例

Let's look at a sample payment request:

var request = new PaymentRequest(supportedInstruments, details, options);
// Call show() to trigger the browser's payment flow.
request.show().then(function(instrumentResponse) {
  // Do something with the response from the UI.
  console.log(instrumentResponse.details);
})
.catch(function(err) {
  // Do something with the error from request.show().
});
					

Once the payment flow has been triggered using PaymentRequest.show() and the promise resolves successfully, the PaymentResponse object available inside the fulfilled promise ( instrumentResponse above) will have a PaymentResponse.details property that will contain response details. This has to conform to the structure defined by the BasicCardResponse dictionary, and may look something like this:

{
  "cardNumber' : '9999999999999999",
  "cardholderName' : 'Mr. Dick Straw",
  "cardSecurityCode" : "999",
  "expiryMonth" : "07",
  "expiryYear" : "2021",
  "billingAddress" : {
    "country" : "GB",
    // etc. billing address is a PaymentAddress object
  }
}
					

规范

规范 状态 注释
Basic Card Payment
The definition of 'expiryMonth' in that specification.
工作草案 初始定义。

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
expiryMonth Chrome 不支持 No Edge 不支持 ≤18 — 79 Firefox 56 注意事项 Disabled
56 注意事项 Disabled
Available only in nightly builds.
Disabled ). To change preferences in Firefox, visit about:config.
IE 不支持 No Opera 不支持 No Safari ? WebView Android 不支持 No Chrome Android 57 Firefox Android 56 注意事项 Disabled
56 注意事项 Disabled
Available only in nightly builds.
Disabled ). To change preferences in Firefox, visit about:config.
Opera Android 不支持 No Safari iOS ? Samsung Internet Android 7.0

图例

完整支持

完整支持

不支持

不支持

兼容性未知 ?

兼容性未知

见实现注意事项。

用户必须明确启用此特征。

用户必须明确启用此特征。

元数据

  • 最后修改: