Hi team,
We wanted to see if there’s any interest in reviving the functionality described in issue #871. For context, our PayPal SDK exposes onError and onCancel callbacks, which allow merchants to respond differentially to checkout failures caused by uncaught errors during the processing of a transaction, and those caused by the buyer intentionally abandoning the transaction (e.g. by closing the payment window.) Currently, this requires us to distinguish between AbortErrors based on error.message:
#handlePaymentError(
error,
) {
if (
[
"Request cancelled", // used by Chrome <= 76, Opera 63
"User closed the Payment Request UI.", // Chrome 77+, Edge 79+, Opera 64+
].includes(
error.message,
)
) {
this.paymentFlowOptions.onCancel?.();
} else {
this.paymentFlowOptions.onError?.(error);
}
}
This works but we’d prefer to have a solution that isn’t dependent on vendor-specific error messages which might change in the future.
Hi team,
We wanted to see if there’s any interest in reviving the functionality described in issue #871. For context, our PayPal SDK exposes onError and onCancel callbacks, which allow merchants to respond differentially to checkout failures caused by uncaught errors during the processing of a transaction, and those caused by the buyer intentionally abandoning the transaction (e.g. by closing the payment window.) Currently, this requires us to distinguish between
AbortErrors based onerror.message:This works but we’d prefer to have a solution that isn’t dependent on vendor-specific error messages which might change in the future.