Skip to content

[Bug] Error on submit credit card payment not logged by callbacks #596

@subvertallchris

Description

@subvertallchris

Library used

react-paypal-js

🐞 Describe the Bug

We are receiving intermittent reports from multiple users (including myself and another team member) of card rejections when using the "Debit or Credit Card" form in our checkout page. This presents as a generic error in the UI and offers no steps for recovery beyond trying a different card. We don't see this in our logs and the error callback is not triggered. As a result, we are losing an indeterminate number of sales and it is very disturbing.

We have reason to believe this is a restriction of the Guest Checkout feature. I'll post snippets of GraphQL logs from the browser below.

🔬 Minimal Reproduction

We are unable to reproduce this in our Sandbox environment! We see it frequently in prod.

This seems to happen more consistently with Mobile Safari on iOS.

😕 Actual Behavior

The user who is ready to pay presses the "Debit or Credit Card" option on the checkout page.
They enter their billing information.
In the background, the iframe makes a GraphQL query and gets a response like this:

{
    "errors": [
        {
            "data": [
                {
                    "field": "cardNumber",
                    "code": "CARD_GENERIC_ERROR"
                }
            ],
            "message": "R_ERROR",
            "path": [
                "approveGuestPaymentWithCreditCard"
            ],
            "extensions": {
                "class": "ERROR"
            },
            "checkpoints": [
                "addCard"
            ],
            "meta": {},
            "contingency": true,
            "statusCode": 200
        }
    ],
    "data": {
        "approveGuestPaymentWithCreditCard": null
    },
    "extensions": {
        "tracing": {
            "version": 1,
            "startTime": "2024-12-18T16:45:00.542Z",
            "endTime": "2024-12-18T16:45:01.916Z",
            "duration": 1373662639,
            "execution": {
                "resolvers": [
                    {
                        "path": [
                            "approveGuestPaymentWithCreditCard"
                        ],
                        "parentType": "Mutation",
                        "fieldName": "approveGuestPaymentWithCreditCard",
                        "returnType": "CheckoutSession",
                        "startOffset": 1367156,
                        "duration": 1372079809
                    }
                ]
            }
        },
        "correlationId": "REDACTED"
    }
}

They see this error on the page:

IMG_2421

The error is inside of the payment information iframe. It's in a nondescript div, the only identifying information is a class of the error Icon, css-d8qyhy-ErrorSVGContainer e1m1vp830 -- that ErrorSVGContainer hints at it.

🤔 Expected Behavior

We'd expect a number of things:

  • Ideally the error doesn't occur (seems beyond the responsibilities of this library)
  • If it is a Guest Checkout limitation, it should identify itself as such and tell them to use a different payment method. It looks like many (all?) of the retryable card errors are capable of opening a Checkout modal that provides a different path.
  • If it can't open its own modal that prompts for a retry, it should trigger our application's error handling callback so we can try to trigger the restart() method.
  • If we can't force it to retry via different path we must be able to log errors so we have some insight into how many sales we are losing over this.

🌍 Environment

  • Node.js/npm: - 20.10.0
  • OS: - All
  • Browser: - Chrome (Mac OS) and Mobile Safari iOS 17+

➕ Additional Context

We use the Multiparty/Commerce Platform APIs. I can provide a partner ID if it helps.

This is extremely high priority for us, our merchants are losing sales and we are very concerned about our inability to record and respond to these.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions