In the "Zip / postal code" field in Shipping Settings, we had an extra space after the postal code numbers. This caused the Paypal to throw the exception. "9524 " instead of "9524"
Maybe the plugin should do a TRIM on the fields that are sensitive to validation by PayPal?
Nop.Core.NopException: Failed request (BadRequest): Request is not well-formed, syntactically incorrect, or violates schema. { "name": "INVALID_REQUEST", "message": "Request is not well-formed, syntactically incorrect, or violates schema.", "debug_id": "fe255adebac0a", "details": [ { "field": "/purchase_units/@reference_id=='default'/supplementary_data/card/level3/ships_from_postal_code", "value": "9524 ", "location": "body", "issue": "must match \"^[a-zA-Z0-9_'.-]*$\"", "description": null } ], "links": [ { "title": null, "href": "https://developer.paypal.com/docs/api/orders/v2/#error-must match \"^[a-zA-Z0-9_'.-]*$\"", "method": null, "rel": "information_link", "encType": "application/json", "mediaType": null } ] }
Check the log for error details. "Expected an order id to be passed" is the common error text returned by PayPal. And it's worth opening a new topic describing your problem.
Hey, NopCommerce team! Yesterday I faced the same Paypal API issue as described, but related to image_url. I use NopCommerce 4.80.4, and checkouts used to pass with PaypalCommerce plugin. Now any attempt to checkout gives "invalid request" error. I verified Paypal documentation and it says that image_url should be absolute URL, not relative. However, the plugin provides relative image URLs. I patched the plugin to get absolute image URLs and tested - it solved the problem. Is it possible that Paypal tightened their requirements for image_url recently?
Actually, PayPal always required an absolute path for images and for the plugin to work correctly, it was necessary to enable setting MediaSettings.UseAbsoluteImagePath in the store. Maybe you changed it recently? Also, check this forum topic.
Nop.Core.NopException: Failed request (BadRequest): Request is not well-formed, syntactically incorrect, or violates schema. { "name": "INVALID_REQUEST", "message": "Request is not well-formed, syntactically incorrect, or violates schema.", "debug_id": "f9813197001b2", "details": [ { "field": "/purchase_units/@reference_id=='default'/payee/merchant_id", "value": "4831907276355701123", "location": "body", "issue": "INVALID_STRING_LENGTH", "description": "The value of a field is either too short or too long." }, { "field": "/purchase_units/@reference_id=='default'/payee/merchant_id", "value": "4831907276355701123", "location": "body", "issue": "INVALID_PARAMETER_SYNTAX", "description": "The value of a field does not conform to the expected format." }, { "field": "/purchase_units/@reference_id=='default'/supplementary_data/card/level3/ships_from_postal_code", "value": "DE14 1TR", "location": "body", "issue": "must match \"^[a-zA-Z0-9_'.-]*$\"", "description": null } ], "links": [ { "title": null, "href": "https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_PARAMETER_SYNTAX", "method": null, "rel": "information_link", "encType": "application/json", "mediaType": null }, { "title": null, "href": "https://developer.paypal.com/docs/api/orders/v2/#error-must match \"^[a-zA-Z0-9_'.-]*$\"", "method": null, "rel": "information_link", "encType": "application/json", "mediaType": null }, { "title": null, "href": "https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_STRING_LENGTH", "method": null, "rel": "information_link", "encType": "application/json", "mediaType": null } ] }
ships_from_postal_code contains space, while regex doesn't allow that. I couldn't find reference to this regex in paypal documentation, however. Merchant_id is longer than 13 symbols. https://developer.paypal.com/docs/api/payments/v2/