PayPal rest service request to update plan

This forum contains topics that were moved from Get Satisfaction
Alvi
Posts: 0
Joined: Thu Apr 23, 2015 6:22 pm

PayPal rest service request to update plan

Post by Alvi »

I am not able to get billing plan update , getting error

===================================================
{"name":"MALFORMED_REQUEST","message":"Incoming JSON request does not map to API request","information_link":"https://developer.paypal.com/webapps/..."}
===================================================
I believe I have right request setting, can you please see what might be wrong.
Attaching screen shot from developer console and service settings
(does it have anything to do with the -k/-X variables required for this call ?).

curl -v -k -X PATCH 'https://api.sandbox.paypal.com/v1/pay...' \
-H "Content-Type: application/json" \
-H "Authorization: Bearer " \
-d '[
{
"path": "/",
"value": {
"state": "ACTIVE"
},
"op": "replace"
}
]'
Image Image Image

Alvi
Posts: 0
Joined: Thu Apr 23, 2015 6:22 pm

PayPal rest service request to update plan

Post by Alvi »

I think the Request Payload is going as an object where as it should be an array , have tried different changes in request part but not able to send it as array.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

PayPal rest service request to update plan

Post by Alena Prykhodko »

Hello Alvi,

We are working on it and reply as soon as have updates.

Alvi
Posts: 0
Joined: Thu Apr 23, 2015 6:22 pm

PayPal rest service request to update plan

Post by Alvi »

Waiting on your findings. Thanks.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

PayPal rest service request to update plan

Post by Evgene Karachevtsev »

Hello Alvi,

Could you please try to send request from POSTMAN to understand whether there is an issue with Appery.io or with the request?

Alvi
Posts: 0
Joined: Thu Apr 23, 2015 6:22 pm

PayPal rest service request to update plan

Post by Alvi »

I will try that out, however why is the payload going as an object instead of array - that should have nothing to do with the service ?

Also where can we add options (-k -X etc ).
curl -v -k -X PATCH.

Alvi
Posts: 0
Joined: Thu Apr 23, 2015 6:22 pm

PayPal rest service request to update plan

Post by Alvi »

For testing, I created a simple request , please see setting etc , however same result.
payload is not an array with object inside.
Image Image Image

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

PayPal rest service request to update plan

Post by Yurii Orishchuk »

Hi Alvi,

Unfortunatly it seem's to be a bug.

I've posted it to our developers. We will send you an update as soon as it will be fixed.

Thanks.

Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

PayPal rest service request to update plan

Post by Deon »

Hi
Has this been fixed yet?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

PayPal rest service request to update plan

Post by Evgene Karachevtsev »

Hello Deon,

We are still working on this bug, but as a workaround you may try the following approach:
please find 328th string in the file appery.js, it starts with pre__fillRequestSettingsWithData: function (settings){ /pre
please change whole this function to
precode __fillRequestSettingsWithData: function (settings) {
if (this.service instanceof Apperyio.RestService) {
settings.headers = _.extend({}, this.request.headers {}, settings.headers {});
settings.parameters = _.extend({}, this.request.parameters {}, settings.parameters {});
if (typeof FormData === "undefined" !(settings.body instanceof FormData)) {
if(this.request.body && settings.body) {
settings.body = _.extend({}, this.request.body
{}, settings.body {});
} else if(!settings.body) {
settings.body = this.request.body;
}
}
} else {
settings.data = _.extend({}, this.request.data
{}, settings.data || {});
}
}/code/pre

Post Reply