public static function hostedOrderForm($order, $params = array())
    {
        $orderFormUrl = OpenPayU_Configuration::getServiceUrl() . 'orders';

        $formFieldValuesAsArray = array();
        $htmlFormFields = OpenPayU_Util::convertArrayToHtmlForm($order, '', $formFieldValuesAsArray);

        $signature = OpenPayU_Util::generateSignData(
            $formFieldValuesAsArray,
            OpenPayU_Configuration::getHashAlgorithm(),
            OpenPayU_Configuration::getMerchantPosId(),
            OpenPayU_Configuration::getSignatureKey()
        );

        $formParams = array_merge(self::$defaultFormParams, $params);

        $htmlOutput = sprintf("<form method=\"POST\" action=\"%s\" id=\"%s\" class=\"%s\">\n", $orderFormUrl, $formParams['formId'], $formParams['formClass']);
        $htmlOutput .= $htmlFormFields;
        $htmlOutput .= sprintf("<input type=\"hidden\" name=\"OpenPayu-Signature\" value=\"%s\" />", $signature);
        $htmlOutput .= sprintf("<button type=\"submit\" formtarget=\"%s\" id=\"%s\" class=\"%s\">%s</button>", $formParams['submitTarget'], $formParams['submitId'], $formParams['submitClass'], $formParams['submitContent']);
        $htmlOutput .= "</form>\n";

        return $htmlOutput;
    }
public static function hostedOrderForm($order, $params = array())
    {
        $orderFormUrl = OpenPayU_Configuration::getServiceUrl() . 'orders';

        $formFieldValuesAsArray = array();
        $htmlFormFields = OpenPayU_Util::convertArrayToHtmlForm($order, '', $formFieldValuesAsArray);

        $signature = OpenPayU_Util::generateSignData(
            $formFieldValuesAsArray,
            OpenPayU_Configuration::getHashAlgorithm(),
            OpenPayU_Configuration::getMerchantPosId(),
            OpenPayU_Configuration::getSignatureKey()
        );

        $formParams = array_merge(self::$defaultFormParams, $params);

        $htmlOutput = sprintf("<form method=\"POST\" action=\"%s\" id=\"%s\" class=\"%s\">\n", $orderFormUrl, $formParams['formId'], $formParams['formClass']);
        $htmlOutput .= $htmlFormFields;
        $htmlOutput .= sprintf("<input type=\"hidden\" name=\"OpenPayu-Signature\" value=\"%s\" />", $signature);
        $htmlOutput .= sprintf("<button type=\"submit\" formtarget=\"%s\" id=\"%s\" class=\"%s\">%s</button>", $formParams['submitTarget'], $formParams['submitId'], $formParams['submitClass'], $formParams['submitContent']);
        $htmlOutput .= "</form>\n";

        return $htmlOutput;
    }
public static function hostedOrderForm ( $ order , $ params = array ( ) ) { $ orderFormUrl = OpenPayU_Configuration :: getServiceUrl ( ) . 'orders' ; $ formFieldValuesAsArray = array ( ) ; $ htmlFormFields = OpenPayU_Util :: convertArrayToHtmlForm ( $ order , '' , $ formFieldValuesAsArray ) ; $ signature = OpenPayU_Util :: generateSignData ( $ formFieldValuesAsArray , OpenPayU_Configuration :: getHashAlgorithm ( ) , OpenPayU_Configuration :: getMerchantPosId ( ) , OpenPayU_Configuration :: getSignatureKey ( ) ) ; $ formParams = array_merge ( self :: $ defaultFormParams , $ params ) ; $ htmlOutput = sprintf ( "<form method=\"POST\" action=\"%s\" id=\"%s\" class=\"%s\">\n" , $ orderFormUrl , $ formParams [ 'formId' ] , $ formParams [ 'formClass' ] ) ; $ htmlOutput .= $ htmlFormFields ; $ htmlOutput .= sprintf ( "<input type=\"hidden\" name=\"OpenPayu-Signature\" value=\"%s\" />" , $ signature ) ; $ htmlOutput .= sprintf ( "<button type=\"submit\" formtarget=\"%s\" id=\"%s\" class=\"%s\">%s</button>" , $ formParams [ 'submitTarget' ] , $ formParams [ 'submitId' ] , $ formParams [ 'submitClass' ] , $ formParams [ 'submitContent' ] ) ; $ htmlOutput .= "</form>\n" ; return $ htmlOutput ; }
Generate a form body for hosted order

@access public
@param array $order an array containing full Order
@param array $params an optional array with form elements' params
@return string Response html form
@throws OpenPayU_Exception_Configuration
Generate a form body for hosted order