|
3165 | 3165 | readonly attribute DOMString? payerPhone;
|
3166 | 3166 |
|
3167 | 3167 | Promise<void> complete(optional PaymentComplete result = "unknown");
|
3168 |
| - Promise<void> retry(); |
| 3168 | + Promise<void> retry(PaymentValidationErrors errorFields); |
3169 | 3169 | };
|
3170 | 3170 | pre>
|
3171 | 3171 | <p class="note">
|
|
3177 | 3177 | <dfn>retry()dfn> method
|
3178 | 3178 | h2>
|
3179 | 3179 | <p data-tests="payment-response/retry-method-manual.https.html">
|
3180 |
| - The <a>retry()a> method MUST act as follows: |
| 3180 | + The <code>retry(<var>errorFieldsvar>)code> method MUST act as |
| 3181 | + follows: |
3181 | 3182 | p>
|
3182 | 3183 | <ol class="algorithm">
|
3183 | 3184 | <li>Let <var>responsevar> be the <a>context objecta>.
|
|
3210 | 3211 | <li>Set <var>responsevar>.<a>[[\retryPromise]]a> to
|
3211 | 3212 | <var>retryPromisevar>.
|
3212 | 3213 | li>
|
3213 |
| - <li>In the payments UI, indicate to the end-user that something is |
3214 |
| - wrong with the user-provided data of the payment response. |
| 3214 | + <li>By matching the members of <var>errorFieldsvar> to input fields |
| 3215 | + in the user agent's UI, indicate to the end-user that something is |
| 3216 | + wrong with the data of the payment response. For example, a user |
| 3217 | + agent might draw the user's attention to the erroneous |
| 3218 | + <var>errorFieldsvar> in the browser's UI and display the value of |
| 3219 | + each field in a manner that helps the user fix each error. |
3215 | 3220 | li>
|
3216 | 3221 | <li data-tests=
|
3217 | 3222 | "payment-request/payment-response/rejects_if_not_active-manual.https.html">
|
|
3241 | 3246 | p>
|
3242 | 3247 | li>
|
3243 | 3248 | ol>
|
| 3249 | + <section data-dfn-for="PaymentValidationErrors" data-link-for= |
| 3250 | + "PaymentValidationErrors"> |
| 3251 | + <h3> |
| 3252 | + <dfn>PaymentValidationErrorsdfn> dictionary |
| 3253 | + h3> |
| 3254 | + <pre class="idl"> |
| 3255 | + dictionary PaymentValidationErrors { |
| 3256 | + PayerErrorFields payerErrors; |
| 3257 | + AddressErrorFields shippingAddressErrors; |
| 3258 | + }; |
| 3259 | + pre> |
| 3260 | + <dl> |
| 3261 | + <dt> |
| 3262 | + <dfn>payerErrorsdfn> member |
| 3263 | + dt> |
| 3264 | + <dd> |
| 3265 | + Validation errors related to the <a>payer detailsa>. |
| 3266 | + dd> |
| 3267 | + <dt> |
| 3268 | + <dfn>shippingAddressErrorsdfn> member |
| 3269 | + dt> |
| 3270 | + <dd data-link-for="PaymentResponse"> |
| 3271 | + Represents validation errors with the <a>PaymentResponsea>'s |
| 3272 | + <a>shippingAddressa>. |
| 3273 | + dd> |
| 3274 | + dl> |
| 3275 | + section> |
| 3276 | + <section data-dfn-for="PayerErrorFields" data-link-for= |
| 3277 | + "PayerErrorFields"> |
| 3278 | + <h3> |
| 3279 | + <dfn>PayerErrorFieldsdfn> dictionary |
| 3280 | + h3> |
| 3281 | + <pre class="idl"> |
| 3282 | + dictionary PayerErrorFields { |
| 3283 | + DOMString payerEmailError; |
| 3284 | + DOMString payerNameError; |
| 3285 | + DOMString payerPhoneError; |
| 3286 | + }; |
| 3287 | + pre> |
| 3288 | + <p> |
| 3289 | + The <a>PayerErrorFieldsa> is used to represent validation errors |
| 3290 | + with one or more <a>payer detailsa>. |
| 3291 | + p> |
| 3292 | + <p> |
| 3293 | + <dfn>Payer detailsdfn> are any of the payer's name, payer's phone |
| 3294 | + number, and payer's email. |
| 3295 | + p> |
| 3296 | + <dl data-link-for="PaymentResponse"> |
| 3297 | + <dt> |
| 3298 | + <dfn>payerEmailErrordfn> member |
| 3299 | + dt> |
| 3300 | + <dd> |
| 3301 | + Denotes that the payer's email suffers from a validation error. |
| 3302 | + In the user agent's UI, this member corresponds to the input |
| 3303 | + field that provided the <a>PaymentResponsea>'s |
| 3304 | + <a>payerEmaila> attribute's value. |
| 3305 | + dd> |
| 3306 | + <dt> |
| 3307 | + <dfn>payerNameErrordfn> member |
| 3308 | + dt> |
| 3309 | + <dd> |
| 3310 | + Denotes that the payer's name suffers from a validation error. In |
| 3311 | + the user agent's UI, this member corresponds to the input field |
| 3312 | + that provided the <a>PaymentResponsea>'s <a>payerNamea> |
| 3313 | + attribute's value. |
| 3314 | + dd> |
| 3315 | + <dt> |
| 3316 | + <dfn>payerPhoneErrordfn> member |
| 3317 | + dt> |
| 3318 | + <dd> |
| 3319 | + Denotes that the payer's phone number suffers from a validation |
| 3320 | + error. In the user agent's UI, this member corresponds to the |
| 3321 | + input field that provided the <a>PaymentResponsea>'s |
| 3322 | + <a>payerPhonea> attribute's value. |
| 3323 | + dd> |
| 3324 | + dl> |
| 3325 | + <pre class="example js" title="Payer-related validation errors"> |
| 3326 | + const payerErrors = { |
| 3327 | + payerEmailError: "The domain is invalid.", |
| 3328 | + payerPhoneError: "Unknown country code.", |
| 3329 | + payerNameError: "Not in database", |
| 3330 | + }; |
| 3331 | + await response.retry({ payerErrors }); |
| 3332 | + pre> |
| 3333 | + section> |
3244 | 3334 | section>
|
3245 | 3335 | <section>
|
3246 | 3336 | <h2>
|
|
0 commit comments