Array('Name' => 'Paybox.com', 'ClassName' => 'kPayboxGW', 'ClassFile' => 'paybox.php', 'RequireCCFields' => 0), 'ConfigFields' => Array( 'binary' => Array('Name' => 'API Executable', 'Type' => 'text', 'ValueList' => '', 'Default' => ''), 'params_file' => Array('Name' => 'OPT Params File', 'Type' => 'text', 'ValueList' => '', 'Default' => ''), 'site_number' => Array('Name' => 'Site Number', 'Type' => 'text', 'ValueList' => '', 'Default' => ''), 'rank_number' => Array('Name' => 'Rank Number', 'Type' => 'text', 'ValueList' => '', 'Default' => ''), 'identity_number' => Array('Name' => 'Identity Number', 'Type' => 'text', 'ValueList' => '', 'Default' => ''), 'currency_code' => Array('Name' => 'Currency Code', 'Type' => 'text', 'ValueList' => '', 'Default' => '978'), 'shipping_control' => Array('Name' => 'Shipping Control', 'Type' => 'select', 'ValueList' => '3=la_CreditDirect,4=la_CreditPreAuthorize', 'Default' => '3'), ) ); return $data; } /** * Returns payment form submit url * * @param Array $gw_params gateway params from payment type config * @return string */ function getFormAction($gw_params) { return $gw_params['submit_url']; } /** * Processed input data and convets it to fields understandable by gateway * * @param Array $item_data * @param Array $tag_params additional params for gateway passed through tag * @param Array $gw_params gateway params from payment type config * @return Array */ function getHiddenFields($item_data, $tag_params, $gw_params) { $params['PBX_MODE'] = $gw_params['params_file'] ? '34' : '4'; $params['PBX_OUTPUT'] = 'B'; $params['PBX_SITE'] = $gw_params['site_number']; $params['PBX_RANG'] = $gw_params['rank_number']; $params['PBX_IDENTIFIANT'] = $gw_params['identity_number']; $params['PBX_OPT'] = $gw_params['params_file']; $params['PBX_DEVISE'] = $gw_params['currency_code']; // 978 for the euro. 840 for the US dollar. $params['PBX_RETOUR'] = 'amount:M;reference:R;trans:T;autorization:A;subscription:B;payment:P;card:C;trans_id:S;country:Y;error:E;expiration:D'; $params['PBX_EFFECTUE'] = $this->Application->HREF($tag_params['return_template'],'',Array('pass'=>'m')); $params['PBX_REFUSE'] = $this->Application->HREF($tag_params['cancel_template'],'',Array('pass'=>'m')); $txt_amount = sprintf("%.2f", $item_data['TotalAmount']); $params['PBX_TOTAL'] = str_replace( Array('.', ','), '', $txt_amount); $params['PBX_CMD'] = $this->Application->GetSID().','.MD5($item_data['OrderId']); /*$params['order_id'] = $item_data['OrderId']; $params['customer_ip_address'] = $this->Application->getClientIp(); $params['customer_id'] = $item_data['PortalUserId'];*/ $billing_email = $item_data['BillingEmail']; if (!$billing_email) { $billing_email = $this->Conn->GetOne(' SELECT Email FROM '.$this->Application->getUnitOption('u', 'TableName').' WHERE PortalUserId = '.$this->Application->RecallVar('user_id')); } $params['PBX_PORTEUR'] = $billing_email; $params_str = ''; foreach ($params as $key => $val) { $params_str .= ' '.$key . '="'.$val.'"'; } $run_line = $gw_params['binary'].' '.$params_str; // $run_line = escapeshellcmd($run_line); // echo escapeshellcmd($run_line); exec ($run_line, $rets); $ret = implode("\n", $rets); $ret = preg_replace('/^(.*)!!/is', '', $ret); $ret = rtrim($ret, '!'); return ''.$ret.'