Hi I am facing issue while using Object.values(properti) I believe Object.values() is available for Apigee JS code. I am getting error as shown in below image.
// get the version from request header + URI
var targetUrl = context.getVariable("target.url");
var pathSuffix = context.getVariable('proxy.pathsuffix');
var reqVersion = "EC-Version";
function orders() {
return pathSuffix.includes("/order");
}
function payments() {
return pathSuffix.includes("/pay");
}
var conditions = [
{ condition: orders, value: "orders" },
{ condition: payments, value: "payments.ecommerce" }
];
var matchingCondition = conditions.find(cond => cond.condition());
var requestPath = matchingCondition && matchingCondition.value || null;
reqVersion = "ecommerce.redirect."+ requestPath +'.'+ reqVersion;
print(" \n"+ Object.values(properties));
context.setVariable("redirect.version", JSON.stringify(properties[reqVersion]));
context.setVariable("request.path", requestPath);
Is there anything I am missing here. @dchiesa1 @omidt
[native code for Object.Object, arity=1]
also not sure about the meaning of above line.
Solved! Go to Solution.
Hi, I think you asked this question under a different topic, and you posted your solution. so I think this one is resolved. Let me know if that is not true.
Hi, I think you asked this question under a different topic, and you posted your solution. so I think this one is resolved. Let me know if that is not true.
Yes, thank you for your response. It appears that the answers to the two questions are same.