Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paypal gateway failing on version 1.8 #80

Open
guidoferreyra opened this issue May 29, 2024 · 1 comment
Open

Paypal gateway failing on version 1.8 #80

guidoferreyra opened this issue May 29, 2024 · 1 comment

Comments

@guidoferreyra
Copy link

I just updated merx from 1.7.x to 1.8.1 and when using Paypal gateway I get the following error:

The payment could not be initialized."
--
key | "error.merx.initializePayment"
file | ".../site/plugins/merx/src/Merx.php"
line | 256
details | Object { message: 'Undefined array key "id"', code: 2, file: ".../site/plugins/merx/src/Gateways.php", … }
message | 'Undefined array key "id"'
code | 2
file | ".../site/plugins/merx/src/Gateways.php"
line | 56
code | 500

Let me know how can I help you to debug this.

@tobiasfabian
Copy link
Member

Hi @guidoferreyra,

thanks for your report.

This must be an error from the PayPal API. I have added error handling for such PayPal API errors to the develop branch. (0601716)
You can download and install the latest commit and check the error message for further details.

The error response will look something like this:

{
    "status": "error",
    "message": "PayPal error",
    "code": 400,
    "key": "error.merx.paypalError",
    "details": {
        "paypalResponse": {
            "name": "INVALID_REQUEST",
            "message": "Request is not well-formed, syntactically incorrect, or violates schema.",
            "debug_id": "8314d1585f68e",
            "details": [
                {
                    "field": "/purchase_units/@reference_id=='default'/amount/currency_code",
                    "value": "",
                    "location": "body",
                    "issue": "MISSING_REQUIRED_PARAMETER",
                    "description": "A required field / parameter is missing."
                }
            ],
            "links": [
                {
                    "href": "https://developer.paypal.com/docs/api/orders/v2/#error-MISSING_REQUIRED_PARAMETER",
                    "rel": "information_link",
                    "encType": "application/json"
                }
            ]
        }
    }
}

Let me know if this solves your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants