<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

/**
 * Smarty {egopayhash} function plugin
 *
 * Type:     function<br>
 * Name:     egopayhash<br>
 * Purpose:  egopay hash encoder<br>
 *       (Smarty online manual)
 * @param array
 * @param Smarty
 */
function smarty_function_egopayhash($params, &$smarty)
{

    if (!isset($params['amount'])) {
        $smarty->trigger_error("egopayhash: missing 'amount' parameter");
        return;
    }
    if (!isset($params['currency'])) {
        $smarty->trigger_error("egopayhash: missing 'currency' parameter");
        return;
    }
    if (!isset($params['description'])) {
        $smarty->trigger_error("egopayhash: missing 'description' parameter");
        return;
    }

    return egopayhash($params);
}

/* vim: set expandtab: */

?>
