I have written the below code in Config.Transform.Functions (response-transformer-advanced plugin) I hard coded for element ( data.statements[1])…how can I make dynamic ( data.statements JSON array. Loop through all cardnum in data.statements[ 1…n ]). I tried put lua script loop but the above Kong plugin is not accepting the script. Please help me with looping of the below program which need to executed in Kong.
return function (data)
local s= data.statements[1].cardnum
local x= s:sub(10 )
data.statements[1].cardnum= “********”…x
return data end