|
521 | 521 | function validateAddress(shippingAddress) {
|
522 | 522 | const error = "Can't ship to this address.";
|
523 | 523 | const shippingAddressErrors = {
|
524 |
| - cityError: "FarmVille is not a real place.", |
525 |
| - postalCodeError: "Unknown postal code for your country.", |
| 524 | + city: "FarmVille is not a real place.", |
| 525 | + postalCode: "Unknown postal code for your country.", |
526 | 526 | };
|
527 | 527 | // Empty shippingOptions implies that we can't ship
|
528 | 528 | // to this address.
|
|
2795 | 2795 | h2>
|
2796 | 2796 | <pre class="idl">
|
2797 | 2797 | dictionary AddressErrorFields {
|
2798 |
| - DOMString addressLineError; |
2799 |
| - DOMString cityError; |
2800 |
| - DOMString countryError; |
2801 |
| - DOMString dependentLocalityError; |
2802 |
| - DOMString languageCodeError; |
2803 |
| - DOMString organizationError; |
2804 |
| - DOMString phoneError; |
2805 |
| - DOMString postalCodeError; |
2806 |
| - DOMString recipientError; |
2807 |
| - DOMString regionError; |
2808 |
| - DOMString regionCodeError; |
2809 |
| - DOMString sortingCodeError; |
| 2798 | + DOMString addressLine; |
| 2799 | + DOMString city; |
| 2800 | + DOMString country; |
| 2801 | + DOMString dependentLocality; |
| 2802 | + DOMString languageCode; |
| 2803 | + DOMString organization; |
| 2804 | + DOMString phone; |
| 2805 | + DOMString postalCode; |
| 2806 | + DOMString recipient; |
| 2807 | + DOMString region; |
| 2808 | + DOMString regionCode; |
| 2809 | + DOMString sortingCode; |
2810 | 2810 | };
|
2811 | 2811 | pre>
|
2812 | 2812 | <p>
|
|
2822 | 2822 | Developers need to be aware that users might not have the ability to
|
2823 | 2823 | fix certain parts of an address. As such, they need to be mindful to
|
2824 | 2824 | not to ask the user to fix things they might not have control over
|
2825 |
| - (e.g., <a>languageCodeErrora>). |
| 2825 | + (e.g., <a>languageCodea>). |
2826 | 2826 | p>
|
2827 | 2827 | <dl>
|
2828 | 2828 | <dt>
|
2829 |
| - <dfn>addressLineErrordfn> member |
| 2829 | + <dfn>addressLinedfn> member |
2830 | 2830 | dt>
|
2831 | 2831 | <dd>
|
2832 | 2832 | Denotes that the <a>address linea> has a validation error. In the
|
|
2835 | 2835 | "PaymentAddress">addressLinea> attribute's value.
|
2836 | 2836 | dd>
|
2837 | 2837 | <dt>
|
2838 |
| - <dfn>cityErrordfn> member |
| 2838 | + <dfn>citydfn> member |
2839 | 2839 | dt>
|
2840 | 2840 | <dd>
|
2841 | 2841 | Denotes that the <a>citya> has a validation error. In the user
|
|
2844 | 2844 | "PaymentAddress">citya> attribute's value.
|
2845 | 2845 | dd>
|
2846 | 2846 | <dt>
|
2847 |
| - <dfn>countryErrordfn> member |
| 2847 | + <dfn>countrydfn> member |
2848 | 2848 | dt>
|
2849 | 2849 | <dd>
|
2850 | 2850 | Denotes that the <a>countrya> has a validation error. In the user
|
|
2853 | 2853 | "PaymentAddress">countrya> attribute's value.
|
2854 | 2854 | dd>
|
2855 | 2855 | <dt>
|
2856 |
| - <dfn>dependentLocalityErrordfn> member |
| 2856 | + <dfn>dependentLocalitydfn> member |
2857 | 2857 | dt>
|
2858 | 2858 | <dd>
|
2859 | 2859 | Denotes that the <a>dependent localitya> has a validation error.
|
|
2862 | 2862 | "PaymentAddress">dependentLocalitya> attribute's value.
|
2863 | 2863 | dd>
|
2864 | 2864 | <dt>
|
2865 |
| - <dfn>languageCodeErrordfn> member |
| 2865 | + <dfn>languageCodedfn> member |
2866 | 2866 | dt>
|
2867 | 2867 | <dd>
|
2868 | 2868 | Denotes that the <a>language codea> has a validation error. In
|
|
2871 | 2871 | "PaymentAddress">languageCodea> attribute's value.
|
2872 | 2872 | dd>
|
2873 | 2873 | <dt>
|
2874 |
| - <dfn>organizationErrordfn> member |
| 2874 | + <dfn>organizationdfn> member |
2875 | 2875 | dt>
|
2876 | 2876 | <dd>
|
2877 | 2877 | Denotes that the <a>organizationa> has a validation error. In the
|
|
2880 | 2880 | "PaymentAddress">organizationa> attribute's value.
|
2881 | 2881 | dd>
|
2882 | 2882 | <dt>
|
2883 |
| - <dfn>phoneErrordfn> member |
| 2883 | + <dfn>phonedfn> member |
2884 | 2884 | dt>
|
2885 | 2885 | <dd>
|
2886 | 2886 | Denotes that the <a>phone numbera> has a validation error. In the
|
|
2889 | 2889 | "PaymentAddress">phonea> attribute's value.
|
2890 | 2890 | dd>
|
2891 | 2891 | <dt>
|
2892 |
| - <dfn>postalCodeErrordfn> member |
| 2892 | + <dfn>postalCodedfn> member |
2893 | 2893 | dt>
|
2894 | 2894 | <dd>
|
2895 | 2895 | Denotes that the <a>postal codea> has a validation error. In the
|
|
2898 | 2898 | "PaymentAddress">postalCodea> attribute's value.
|
2899 | 2899 | dd>
|
2900 | 2900 | <dt>
|
2901 |
| - <dfn>recipientErrordfn> member |
| 2901 | + <dfn>recipientdfn> member |
2902 | 2902 | dt>
|
2903 | 2903 | <dd>
|
2904 | 2904 | Denotes that the <a>recipienta> has a validation error. In the
|
|
2907 | 2907 | "PaymentAddress">addressLinea> attribute's value.
|
2908 | 2908 | dd>
|
2909 | 2909 | <dt>
|
2910 |
| - <dfn>regionErrordfn> member |
| 2910 | + <dfn>regiondfn> member |
2911 | 2911 | dt>
|
2912 | 2912 | <dd>
|
2913 | 2913 | Denotes that the <a>regiona> has a validation error. In the user
|
|
2916 | 2916 | "PaymentAddress">regiona> attribute's value.
|
2917 | 2917 | dd>
|
2918 | 2918 | <dt>
|
2919 |
| - <dfn>regionCodeErrordfn> member |
| 2919 | + <dfn>regionCodedfn> member |
2920 | 2920 | dt>
|
2921 | 2921 | <dd>
|
2922 | 2922 | Denotes that the region code representation of the <a>regiona>
|
|
2926 | 2926 | "PaymentAddress">regionCodea> attribute's value.
|
2927 | 2927 | dd>
|
2928 | 2928 | <dt>
|
2929 |
| - <dfn>sortingCodeErrordfn> member |
| 2929 | + <dfn>sortingCodedfn> member |
2930 | 2930 | dt>
|
2931 | 2931 | <dd>
|
2932 | 2932 | The <a>sorting codea> has a validation error. In the user agent's
|
|
3255 | 3255 | h3>
|
3256 | 3256 | <pre class="idl">
|
3257 | 3257 | dictionary PaymentValidationErrors {
|
3258 |
| - PayerErrorFields payerErrors; |
3259 |
| - AddressErrorFields shippingAddressErrors; |
| 3258 | + PayerErrorFields payer; |
| 3259 | + AddressErrorFields shippingAddress; |
3260 | 3260 | };
|
3261 | 3261 | pre>
|
3262 | 3262 | <dl>
|
3263 | 3263 | <dt>
|
3264 |
| - <dfn>payerErrorsdfn> member |
| 3264 | + <dfn>payerdfn> member |
3265 | 3265 | dt>
|
3266 | 3266 | <dd>
|
3267 | 3267 | Validation errors related to the <a>payer detailsa>.
|
3268 | 3268 | dd>
|
3269 | 3269 | <dt>
|
3270 |
| - <dfn>shippingAddressErrorsdfn> member |
| 3270 | + <dfn>shippingAddressdfn> member |
3271 | 3271 | dt>
|
3272 | 3272 | <dd data-link-for="PaymentResponse">
|
3273 | 3273 | Represents validation errors with the <a>PaymentResponsea>'s
|
|
3282 | 3282 | h3>
|
3283 | 3283 | <pre class="idl">
|
3284 | 3284 | dictionary PayerErrorFields {
|
3285 |
| - DOMString payerEmailError; |
3286 |
| - DOMString payerNameError; |
3287 |
| - DOMString payerPhoneError; |
| 3285 | + DOMString email; |
| 3286 | + DOMString name; |
| 3287 | + DOMString phone; |
3288 | 3288 | };
|
3289 | 3289 | pre>
|
3290 | 3290 | <p>
|
|
3297 | 3297 | p>
|
3298 | 3298 | <dl data-link-for="PaymentResponse">
|
3299 | 3299 | <dt>
|
3300 |
| - <dfn>payerEmailErrordfn> member |
| 3300 | + <dfn>emaildfn> member |
3301 | 3301 | dt>
|
3302 | 3302 | <dd>
|
3303 | 3303 | Denotes that the payer's email suffers from a validation error.
|
|
3306 | 3306 | <a>payerEmaila> attribute's value.
|
3307 | 3307 | dd>
|
3308 | 3308 | <dt>
|
3309 |
| - <dfn>payerNameErrordfn> member |
| 3309 | + <dfn>namedfn> member |
3310 | 3310 | dt>
|
3311 | 3311 | <dd>
|
3312 | 3312 | Denotes that the payer's name suffers from a validation error. In
|
|
3315 | 3315 | attribute's value.
|
3316 | 3316 | dd>
|
3317 | 3317 | <dt>
|
3318 |
| - <dfn>payerPhoneErrordfn> member |
| 3318 | + <dfn>phonedfn> member |
3319 | 3319 | dt>
|
3320 | 3320 | <dd>
|
3321 | 3321 | Denotes that the payer's phone number suffers from a validation
|
|
3325 | 3325 | dd>
|
3326 | 3326 | dl>
|
3327 | 3327 | <pre class="example js" title="Payer-related validation errors">
|
3328 |
| - const payerErrors = { |
3329 |
| - payerEmailError: "The domain is invalid.", |
3330 |
| - payerPhoneError: "Unknown country code.", |
3331 |
| - payerNameError: "Not in database", |
| 3328 | + const payer = { |
| 3329 | + email: "The domain is invalid.", |
| 3330 | + phone: "Unknown country code.", |
| 3331 | + name: "Not in database.", |
3332 | 3332 | };
|
3333 |
| - await response.retry({ payerErrors }); |
| 3333 | + await response.retry({ payer }); |
3334 | 3334 | pre>
|
3335 | 3335 | section>
|
3336 | 3336 | section>
|
|
0 commit comments