Response: {
"error": "formula
// bounces
$pay_id = trigger.data.validate;
if (!(var[$pay_id||"_account"]))
bounce ("Payment ID "||$pay_id||" do not exist!");
$validator_waited_for = var[$pay_id||"_waiting_for"];
if (var[$validator_waited_for]!=trigger.address)
bounce ("Waiting first for validation by "||$validator_waited_for);
$account = var[$pay_id||"_account"];
if (!(var[$list][$account||"_"||trigger.address]))
bounce ("You are not party of "||$account);
// need more validation?
$last_validator_num = var[$list][$account||"_count"];
$last_validator = var[$list][$account||"_"||$last_validator_num];
if (trigger.address == $last_validator)
$payment_complete_validated = true;
else
{
$next_validator_num = (var[$list][$account||"_"||$validator_waited_for]) +1 ;
$next_validator = var[$list][$account||"_"||$next_validator_num];
}
// creation of messages
$amount = var[$pay_id||"_amount"];
$address = var[$pay_id||"_address"];
if ($payment_complete_validated)
{ // lets do the payment
$next_address = $address;
$next_amount = $amount;
$next_message = "Payment of "||$next_amount||" done to "||$next_address||" from account "||$account;
}
else
{ // prepare message for next valisator
$next_address = $next_validator;
$next_amount = 33;
$next_message = "JAAAWS: Your approval is required for a payment from the account '"||$account||" to pay "||$amount||" to "||$address||", please validate or cancel it by send me back 'validate = payment_id_xx...xx' or 'cancel = payment_id_xx...xx'.";
}
failed: booleans cannot be compared with other types"
}