paypal-checkout-components icon indicating copy to clipboard operation
paypal-checkout-components copied to clipboard

[Bug] Inline Credit Card errors don't call onError callback

Open j623415 opened this issue 3 years ago • 81 comments

🐞 Describe the Bug

When inline credit card processing fails, onError callback is not called. This prevents the app UI from handling failures and resetting the view.

🔬 Minimal Reproduction

Goto: https://developer.paypal.com/demo/checkout/#/pattern/client

OR

Setup as per: https://developer.paypal.com/demo/checkout/#/pattern/client Add:

            onError: function (err) {
              console.log('In onError', err)
            },

Click "Debit or Credit Card" Enter 1234567890123456 as card number (or any other test card number, but mistype a digit) Fill out other data Click "Pay Now"

😕 Actual Behavior

onError callback is not called Console logs: ppxo_inline_guest_unhandled_error

beaver-logger.js:237 ppxo_inline_guest_unhandled_error {handledErrors: Array(0), unhandledErrors: Array(1), inline_guest_version: "2.12.5", timestamp: 1614198337007, windowID: "267c87c4af", …}country: "US"env: "sandbox"handledErrors: []host: "www.sandbox.paypal.com"inline_guest_version: "2.12.5"lang: "en"pageID: "668875f566"path: "/smart/card-fields"referer: "www.sandbox.paypal.com"timestamp: 1614198337007uid: "ed2faa145e_mja6mji6ntc"unhandledErrors: [{…}]ver: "2.12.5"windowID: "267c87c4af"proto: Object s @ beaver-logger.js:237 u @ beaver-logger.js:396 p @ beaver-logger.js:443 error @ index.js:85 (anonymous) @ submitInlineGuestForm.js:339 value @ index.js:1 H @ submitInlineGuestForm.js:327 ...

UI Shows a message: Something went wrong. We'll take you back to checkout so you can try again.

🤔 Expected Behavior

onError callback should be called so that the application can manage UI state

🌍 Environment

Sandbox

Affected browsers

What browser(s) are affected?

  • Chrome
  • Firefox

Did not test on other browsers

j623415 avatar Feb 24 '21 21:02 j623415

I have the same problem :(

zaxap83 avatar Mar 02 '21 22:03 zaxap83

+1

kmute90 avatar Mar 03 '21 10:03 kmute90

+1

gititon avatar Mar 22 '21 09:03 gititon

+1

bruno-silva5 avatar Mar 30 '21 18:03 bruno-silva5

+1

jiangts avatar Apr 01 '21 23:04 jiangts

+1

@gregjopa Any luck with this? Or is there a workaround? I'm currently halfway through implementing this integration and i'm stuck with this! Thanks!

DimHD avatar Apr 28 '21 09:04 DimHD

Still the same (yes, its already May now), and on production too.

I am trying to workaround it by catching the aformentioned beaver-logger.js:237 ppxo_inline_guest_unhandled_error myself. With no luck yet.

Any ideas how to grab it from the console?

Overriding console.error does not work as they seem not to use that, but apply in a way to get the error message in the console.

GP

gabe777 avatar May 18 '21 09:05 gabe777

I'm having the same issue...

Koumi460 avatar May 26 '21 21:05 Koumi460

Same issue here

davidmcnee avatar Jun 07 '21 22:06 davidmcnee

We have been partnering via PayPal Commerce Platform for high-volume invoice payments processing, and this one causes a real issue for real customers on production systems.

It's kind of crazy that the issue is still here, considering the impact.

agoldis avatar Jul 13 '21 00:07 agoldis

Hi everyone, we discussed this issue internally and the onError callback is currently designed for non-recoverable errors. https://developer.paypal.com/docs/checkout/integration-features/handle-errors/

When the inline guest form fails, often there is a "Try Again" button for the buyer to click on to open the guest credit-card form in the popup so they can try again to complete the transaction. We consider this a recoverable error.

inline-guest-error-screenshot

If your goal is to log when this error happens, you could add a catch to the onApprove callback.

gregjopa avatar Jul 13 '21 19:07 gregjopa

@gregjopa thanks for providing more details.

I am not sure if https://github.com/paypal/paypal-js/issues/100#issue-942556427 is related, seems like it is, because it is very-very similar.

often there is a "Try Again" button for the buyer to click on...

That's the problem - "often" is not good enough, in our case it fails silently - i.e. buyer doesn't see any error message at all, neither "Try again" nor error message.

We could implement a workaround if onError would have been called, but it isn't.

Ideally you'd give some ways to interpret the checkout results.

We have been also trying to escalate this issue via integration representatives from PayPal, making the case by showing the $$ value of abandoned checkouts. It is greater than 0, for sure, and also triggers buyers complaints to our support teams.

agoldis avatar Jul 13 '21 23:07 agoldis

I am having this problem and it's very reproducible.

There is obviously some server side validation on last name where a name with the same character repeated 3 or more times fails, however the validation error is not displayed on the front end and the only indication the user has that the payment is failed is a console error log

beaver-logger.js:237 ppxo_inline_guest_unhandled_error 
[snip]
handledErrors: Array(1)
0: {contentKey: "fieldErrors.lastNameInvalid", field: "lastName"}
length: 1
[snip]

Steps to reproduce:

  1. Go to https://developer.paypal.com/docs/checkout/ and scroll down to "Try the buttons"
  2. Click on "Debit or Credit card"
  3. Enter the following details 3.1 Card number: 4111 1111 1111 1111 3.2 Expiry date: 12/23 3.3 CCV: 123 3.4 First name: john 3.5 Last name: dddoe 3.6 Any billing address and any email address
  4. Click "Pay Now"

Expected result: The user is returned to the form with a validation error displayed under the last name indicating that it did not pass validation OR an error message like "Something went wrong. We'll take you back to checkout so you can try again."

Actual result: The user is returned to the form with no indication of why the payment failed.

See screenshot from my checkout: Screenshot 2021-07-20 at 17 57 33

The error is not returned in the onError callback, the createOrder callback has already been run successfully and the onApprove callback is never reached. It does not seem possible to catch this error.

If anyone has any suggestions on how to catch this error please advise - otherwise I suggest there is a bug fix to the Paypal Javascript SDK.

Thanks in advance.

timler avatar Jul 20 '21 16:07 timler

Submitted in February an not still fixed in July, seriously? It's a big showstopper for too many, don't you care about it at all?

alexander-stoyan avatar Aug 02 '21 02:08 alexander-stoyan

up! any update with this issue?

kodigome avatar Aug 06 '21 15:08 kodigome

I have exactly the same issue when testing - using Paypal buttons. Handling createOrder, onApprove, onError

After createOrder I get this in the browser console:

ppxo_inline_guest_unhandled_error handledErrors[0]: [ { "contentKey": "fieldErrors.firstNameInvalid", "field": "firstName" } ]

In the PayPal button "Pay by Card" (not customer logged in via PayPal) I have "Firstname" set to "asdf"

This fails validation but does not fire onError handler. So fails silently with no information to retry in the Paypal UI.

DominicTurner avatar Aug 09 '21 20:08 DominicTurner

I've stumbled upon this issue after having trouble with debit card payments. Using a debit card for which 3D Secure hasn't been enabled will result in an unhandled error as described here.

I then proceeded and activated 3D Secure on the card and everything worked as expected, with the second step validation showing up in the PayPal form.

For testing purposes I disabled 3D Secure on the card and the error didn't occur, since PayPal now shows a message informing the user.

rolandoisidoro avatar Aug 17 '21 11:08 rolandoisidoro

+1

luxorwannabe avatar Aug 25 '21 02:08 luxorwannabe

+1

rucebee avatar Sep 08 '21 14:09 rucebee

+1

do-ift avatar Sep 20 '21 04:09 do-ift

It seems, there is a problem inside widget UI. Invalid fields intended to be highlighted in red but they are not. So, errors are treated as handled and are not propagated feather but paypal UI fails.

rucebee avatar Sep 21 '21 08:09 rucebee

production site +1

Jacob-Daniel avatar Oct 02 '21 14:10 Jacob-Daniel

+1

mrleolg avatar Dec 14 '21 10:12 mrleolg

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

github-actions[bot] avatar Mar 15 '22 00:03 github-actions[bot]

Same problem here

6ade15e09b2b0ef3168d3276dcb9da9e-png-1600×900-

marcopanichi avatar Mar 21 '22 09:03 marcopanichi

bump, same problem.

ZSabakh avatar Mar 30 '22 03:03 ZSabakh

Still have the same problem.

jitu-git avatar Mar 31 '22 09:03 jitu-git

bump, same problem

khweb avatar Apr 02 '22 08:04 khweb

Bump, noticed similar issue Screen Shot 2022-04-04 at 5 52 37 PM

saransh88 avatar Apr 04 '22 21:04 saransh88