Array('Name' => 'Atos Origin', 'ClassName' => 'kAtosOriginGW', 'ClassFile' => 'atosorigin.php', 'RequireCCFields' => 0), 'ConfigFields' => Array( 'request_binary' => Array('Name' => 'API Request Executable', 'Type' => 'text', 'ValueList' => '', 'Default' => ''), 'response_binary' => Array('Name' => 'API Response Executable', 'Type' => 'text', 'ValueList' => '', 'Default' => ''), 'pathfile' => Array('Name' => 'Pathfile', 'Type' => 'text', 'ValueList' => '', 'Default' => ''), 'merchant_id' => Array('Name' => 'Merchant ID', 'Type' => 'text', 'ValueList' => '', 'Default' => ''), 'merchant_country' => Array('Name' => 'Merchant Country Code', '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['pathfile'] = $gw_params['pathfile']; $params['merchant_id'] = $gw_params['merchant_id']; $params['merchant_country'] = $gw_params['merchant_country']; $params['currency_code'] = $gw_params['currency_code']; $params['currency_code'] = $gw_params['currency_code']; $params['normal_return_url'] = $this->Application->HREF($tag_params['return_template'],'',Array('pass'=>'m')); $params['cancel_return_url'] = $this->Application->HREF($tag_params['cancel_template'],'',Array('pass'=>'m')); $params['automatic_response_url'] = $this->Application->BaseURL('/in-commerce/units/gateways/gw_classes/notify_scripts').'atosorigin_notify.php'; $txt_amount = sprintf("%.2f", $item_data['TotalAmount']); $params['amount'] = str_replace( Array('.', ','), '', $txt_amount); $params['caddie'] = $this->Application->GetSID() . ',' . MD5($item_data['OrderId']); $params['order_id'] = $item_data['OrderId']; $params['customer_ip_address'] = $_SERVER['REMOTE_ADDR']; $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['customer_email'] = $billing_email; $params_str = ''; foreach ($params as $key => $val) { $params_str .= ' '.$key . '="'.$val.'"'; } $run_line = $gw_params['request_binary'].' '.$params_str; // $run_line = escapeshellcmd($run_line); // echo $run_line; exec ($run_line, $rets); $ret = $rets[0]; $ret = preg_replace('/^(.*)!!/is', '', $ret); $ret = rtrim($ret, '!'); return ''.$ret.'