$post_address = "https://safe.sandbox-cresecure.net/securepayments/a1/cc_collection.php"; } $msg = fn_get_lang_var('text_cc_processor_connection'); $msg = str_replace('[processor]', 'CRE Secure', $msg); $post = array(); $post['total_amt'] = sprintf('%.2f', $order_info['total']); $post['return_url'] = Registry::get('config.https_location') . "/{$index_script}?dispatch=payment_notification.return&payment=cresecure&order_id={$order_id}"; $post['content_template_url'] = Registry::get('config.https_location') . "/payments/cresecure_template.php?order_id={$order_id}"; $post['b_country'] = db_get_field('SELECT a.code_A3 FROM ?:countries as a WHERE a.code = ?s', $order_info['b_country']); $post['s_country'] = db_get_field('SELECT a.code_A3 FROM ?:countries as a WHERE a.code = ?s', $order_info['s_country']); $post['customer_address'] = $order_info['b_address'] . (!empty($order_info['b_address_2']) ? ' ' . $order_info['b_address_2'] : ''); $post['delivery_address'] = $order_info['s_address'] . (!empty($order_info['s_address_2']) ? ' ' . $order_info['s_address_2'] : ''); $post['customer_phone'] = !empty($order_info['b_phone']) ? $order_info['b_phone'] : ''; $post['delivery_phone'] = !empty($order_info['s_phone']) ? $order_info['s_phone'] : ''; $post['allowed_types'] = !empty($processor_data['params']['allowed_types']) ? join('|', $processor_data['params']['allowed_types']) : 'Visa|MasterCard'; $post['sess_id'] = SESSION::get_id(); $post['sess_name'] = SESS_NAME; $post['order_id'] = $order_info['order_id']; $post['currency'] = $processor_data['params']['currency']; echo <<<EOT t<html> t<body onLoad="document.process.submit();"> t<form action="{$post_address}" method="POST" name="process"> t\t<input type="hidden" name="CRESecureID" value="{$processor_data['params']['cresecureid']}" /> t\t<input type="hidden" name="CRESecureAPIToken" value="{$processor_data['params']['cresecureapitoken']}" /> t\t<input type="hidden" name="total_amt" value="{$post['total_amt']}" /> t\t<input type="hidden" name="return_url" value="{$post['return_url']}" /> t\t<input type="hidden" name="content_template_url" value="{$post['content_template_url']}" /> t\t<input type="hidden" name="order_id" value="{$post['order_id']}" /> t\t<input type="hidden" name="customer_id" value="{$order_info['user_id']}" /> t\t<input type="hidden" name="currency_code" value="{$post['currency']}" />