Why is still trying to contact sandbox?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have pushed my code to the production server. In my first attempt to pay, the response is returning the following:
{"name":"MALFORMED_REQUEST","message":"Incoming JSON request does not map to API request","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#MALFORMED_REQUEST","debug_id":"16216e721b6e9"}
The previous screen shot shows that sandbox is still the target, but I have changed the following to point to production:
paypalConfig = { env: "sandbox", client: { sandbox: "sandbox-key", production: "prod-key" }, const payPalSrvcCloned = req.clone({ headers: req.headers.set( "Authorization", "Bearer " + this.payPalSrvc.getToken() ) });
The first snippet has actual keys in the code, but I am displaying them here and the second snippet returns the secret for production in the header.
On top of that question, there is an error of the following:
Error: Request to post https://www.sandbox.paypal.com/v1/payments/payment failed with 400 error. Correlation id: 16216e721b6e9, 16216e721b6e9 { "name": "MALFORMED_REQUEST", "message": "Incoming JSON request does not map to API request", "information_link": "https://developer.paypal.com/webapps/developer/docs/api/#MALFORMED_REQUEST", "debug_id": "16216e721b6e9" }
Am I receiving this error because it is posting to sandbox and, if so, how do I change it to point to production? I thought that all I needed was to provide the production client id and send Authorization and Bearer in the header. Am i mistaken? If so, then please tell me what I am missing, because this Angular 6 app was working perfectly in the dev environment? But then again, in dev, I had everything pointing to the sandbox credentials.
Thanks in advance,
- Labels:
-
Express Checkout

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- where does paypal payments go to if there is no linked phone or email to the seller ? in PayPal Payments Standard
- No way to contact company and I want a refund! Please help. in PayPal Reporting
- Sandbox account collect billing and shipping address in Sandbox Environment
- "System error. Please try again later" when connecting to paypal sandbox account with my android app in Sandbox Environment
- Why do my contacts bring up a PayPal instead of texting them in PayPal Upgrade Community