草案
此页面不完整。
email
property is included in a
PayerErrors
object if the
PaymentResponse.payerEmail
property failed validation; in this case, the property should contain a string describing how to correct the problem. If the payer's email address passed validation, this property is not included in the
PayerErrors
对象。
payerEmail = payerErrors.email;
If validation of the payer's email address (
PaymentResponse.payerEmail
) found problems, this property should be set to a
DOMString
that explains the validation problem and how to correct it. If the email address is valid, this property should be omitted from the
PayerErrors
对象。
function validatePayment(response) {
const correctionPromises
let paymentErrors = {};
let payerErrors = {};
// Check payer details
if (!validEmail(response.payerEmail)) {
payerErrors.email = "Please make sure you enter a valid email address."
}
if (!validName(response.payerName)) {
payerErrors.email = "Please enter a valid name, using only <appropriate characters>."
}
if (!validPhone(response.payerPhone)) {
payerErrors.phone = "Please enter a valid phone number in the form ###-###-####."
}
// Check everything else too...
//
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
支付请求 API
The definition of 'PayerErrors.email' in that specification. |
候选推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
email
|
Chrome
71
Disabled
|
Edge
≤79
Disabled
|
Firefox
64
注意事项
|
IE 不支持 No | Opera 不支持 No | Safari ? | WebView Android 不支持 No |
Chrome Android
71
Disabled
|
Firefox Android
64
注意事项
|
Opera Android 不支持 No | Safari iOS ? | Samsung Internet Android 不支持 No |
完整支持
不支持
兼容性未知
实验。期望将来行为有所改变。
见实现注意事项。
用户必须明确启用此特征。
使用非标名称。
PayerErrors