[Webkit-unassigned] [Bug 220563] New: Payment Request API - PaymentDetailsUpdate ignores “error” when “shippingOptions” is present

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 12 13:35:34 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=220563

            Bug ID: 220563
           Summary: Payment Request API - PaymentDetailsUpdate ignores
                    “error” when “shippingOptions” is present
           Product: WebKit
           Version: Safari 14
          Hardware: Mac (Intel)
                OS: macOS 10.15
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: nickgzzjr at gmail.com

Calling event.updateWith inside the onshippingaddresschange or onshippingoptionchange event handlers with a PaymentDetailsUpdate object that has “shippingOptions” will ignore “error”.  I expect “error” to take priority over “shippingOptions”. 

Example use case: A client might want to show an error informing the user the shipping address is incorrect, while updating or clearing the shipping options due to the address error.

Code Example:
request.onshippingaddresschange = event => {
    const paymentDetailsUpdate = {
    "total": {
        "label": "My Merchant",
        "amount": {
            "value": "27.50",
            "currency": "USD"
        }
    },
    "error": "Can't ship to this address.",
    "shippingOptions": [
        {
            "id": "ground",
            "label": "Ground Shipping",
            "amount": {
                "value": "5.00",
                "currency": "USD"
            }
        }
    ]
};
    event.updateWith(paymentDetailsUpdate);
};

The following code will not show the “error”, instead will update the shipping options. If the “shippingOptions” is removed then the error shows as expected. Note: “total” needs to be included in order to prevent other error, separate bug has been filed https://bugs.webkit.org/show_bug.cgi?id=220561.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210112/668de034/attachment.htm>


More information about the webkit-unassigned mailing list