entityMap = crmAPIRequest.toMap().get("record");
sum = 0;
direct_billing = entityMap.get("direct_billing_details");
response = Map();
for each i in direct_billing
{
if(i.get("type") == "Product")
{
soma = sum + i.get("amount");
}
}
if(sum == 100)
{
response.put('status','success');
}
else
{
response.put('status','error');
response.put('message','The sum is not 100');
}
return response;