Page 1 of 2

PayPal rest service request to update plan

Posted: Fri May 29, 2015 6:25 pm
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


PayPal rest service request to update plan

Posted: Fri May 29, 2015 6:35 pm
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.


PayPal rest service request to update plan

Posted: Sun May 31, 2015 5:35 am
by Alena Prykhodko

Hello Alvi,

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


PayPal rest service request to update plan

Posted: Tue Jun 02, 2015 1:25 am
by Alvi

Waiting on your findings. Thanks.


PayPal rest service request to update plan

Posted: Wed Jun 03, 2015 7:27 am
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?


PayPal rest service request to update plan

Posted: Wed Jun 03, 2015 1:11 pm
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.


PayPal rest service request to update plan

Posted: Wed Jun 03, 2015 5:43 pm
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


PayPal rest service request to update plan

Posted: Mon Jun 08, 2015 3:02 am
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.


PayPal rest service request to update plan

Posted: Thu Jul 09, 2015 1:56 am
by Deon

Hi
Has this been fixed yet?


PayPal rest service request to update plan

Posted: Thu Jul 09, 2015 4:05 pm
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