• Rouslan Solomakhin's avatar
    [Web Payment] Improved error message for absence of instruments. · 40310ba0
    Rouslan Solomakhin authored
    Before this patch, invoking PaymentRequest.show() for secure payment
    confirmation on a device without credentials would reject with "User
    closed PaymentRequest UI" error message instead of the more correct
    "Payment method not supported", if show() was called after
    PaymentRequest.canMakePayment() returned. This is detrimental to
    measuring the success of the secure payment confirmation dialog.
    
    This patch changes the secure payment confirmation UI controller to not
    invoke PaymentRequest::UserCancelled() when PaymentRequestState has
    finished looking for credentials and found none. This allows
    payment_request.cc to correctly the no-apps state by rejecting
    PaymentRequest.show() with the correct error message.
    
    After this patch, a device without credentials always rejects
    PaymentRequest.show() with "Payment method not supported" without
    implying that the user interacted with the UI dialog and cancelled it.
    
    Bug: 1123082
    Change-Id: Idba82354f413c926c1f835ec34e50d3c29080bb5
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2383812
    Commit-Queue: Rouslan Solomakhin <rouslan@chromium.org>
    Reviewed-by: default avatarNick Burris <nburris@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#802955}
    40310ba0
secure_payment_confirmation_controller.cc 6.72 KB