the return we are receiving is not in a format that is supported by default. Do you have any recommendations to pull information from it? i am using the itmgrs log in.
below is an example of a return we are receiving.
UMversion=2.9&UMstatus=Approved&UMauthCode=018000&UMrefNum=1544346229&UMavsResult=No%20AVS%20response%20%28Typically%20no%20AVS%20data%20sent%20or%20swiped%20transaction%29&UMavsResultCode=0&UMcvv2Result=Match&UMcvv2ResultCode=M&UMresult=A&UMvpasResultCode=&UMerror=Approved&UMerrorcode=00000&UMcustnum=&UMbatch=76&UMbatchRefNum=45567481&UMisDuplicate=N&UMconvertedAmount=&UMconvertedAmountCurrency=840&UMconversionRate=&UMcustReceiptResult=No%20Receipt%20Sent&UMprocRefNum=387138680300913&UMcardLevelResult=B%20&UMauthAmount=&UMfiller=filled
We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics
Return is formatted as urlencoded
Re: Return is formatted as urlencoded
For the REST module, we support the following return types: JSON, CSV, XML, TEXT, or EMPTY
We advise you reformat your webservice return to be more easily parseable by Fuse+, the easiest being JSON.
We advise you reformat your webservice return to be more easily parseable by Fuse+, the easiest being JSON.
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com
-
- Posts: 15
- Joined: Wed May 10, 2017 12:07 pm
Re: Return is formatted as urlencoded
I came across a similar issue with a service that I don't actually have any control over. JSON is definitely best, if possible, but, if not, I got around this by setting the return type to TEXT and using this JS function to extract the values:
Run the values returned through parseUrl using the (+) button in the lower-right corner of the module (in the same module in which the function is defined) and you'll be able to set values using the same (+) button. A little bit of a pain (because editing JS in the module is a little difficult), but it does the job.
Code: Select all
function parseUrl(inputUrl)
{
var returnJson = {};
var urlArray = inputUrl.split('&');
var len = urlArray.length;
for (var i = 0; i < len; i++) {
dumArr = urlArray[i].split('=');
returnJson[dumArr[0]] = decodeURIComponent(dumArr[1]);
}
return returnJson;
}