globals('core.eol'); $order = $this->globals('ecom.order_summary'); // +-- // | Printable form instructions. // +-- $instructions = "After verifying your order information and clicking the 'Continue' button, you will be directed to our online processing partner's secure site to enter your payment information. Once your payment information is entered and verified, you will be directed back to this web site for your order confirmation."; // +-- // | Create the SIM fingerprint. This requires the use of the // | hash extension to PHP. Make sure your host has enabled // | that extension. // +-- // +-- // | Make sure that the hash extension is loaded. // +-- $extension = 'hash'; $extension_load = $this->load_extension($extension); if ($this->IsError($extension_load)) { $extension = 'mhash'; $extension_load = $this->load_extension($extension); } // End of if statement. if ($this->IsError($extension_load)) { $message = 'The hash and mhash PHP extensions could not be loaded. This '; $message .= 'processing module requires either the hash or mhash PHP '; $message .= 'extensions to be loaded in order to function. This script '; $message .= 'attempted to load these extensions at runtime, however the current '; $message .= 'server configuration did not permit the script to make this '; $message .= 'runtime change. Contact your server administrator and request '; $message .= 'that either the hash or mhahs PHP extensions be loaded at run time.'; print '

' . $this->xhtml_encode($message) . '

' . $eol . $eol; return false; } // End of if statement. // +-- // | Create the SIM fingerprint. // +-- $x_fp_sequence = $order['order']['id']; $x_fp_sequence = preg_replace('/[^\d]/','',$x_fp_sequence); $x_fp_timestamp = $this->globals('core_datetime.epoch'); $x_fp_hash = $order['gateway']['userid'] . '^'; $x_fp_hash .= $x_fp_sequence . '^'; $x_fp_hash .= $x_fp_timestamp . '^'; $x_fp_hash .= $order['order']['ordertotal'] . '^'; if ($extension == 'hash') { $x_fp_hash = @hash_hmac('md5',$x_fp_hash,$order['gateway']['transkey']); } else { $x_fp_hash = @mhash(MHASH_MD5,$x_fp_hash,$order['gateway']['transkey']); $x_fp_hash = @bin2hex($x_fp_hash); } // End of if statement. // +-- // | Create our relay URL. // +-- $url_relay = $this->globals('core.url_ssl') . '/utilities/ecomrelay.php'; // +-- // | Set up the olpform array. // +-- $olpform = array('url' => 'https://secure.authorize.net/gateway/transact.dll', 'button' => 'Continue', 'fields' => array()); // +-- // | Create the HIDDEN fields for the form. // +-- $olpform['fields']['HIDDEN'][] = array('name' => 'x_login', 'value' => $order['gateway']['userid']); $olpform['fields']['HIDDEN'][] = array('name' => 'x_invoice_num', 'value' => $order['order']['id']); $olpform['fields']['HIDDEN'][] = array('name' => 'x_cust_id', 'value' => $this->globals('core_session.sid')); $olpform['fields']['HIDDEN'][] = array('name' => 'x_amount', 'value' => $order['order']['ordertotal']); $olpform['fields']['HIDDEN'][] = array('name' => 'x_first_name', 'value' => $order['order']['fname']); $olpform['fields']['HIDDEN'][] = array('name' => 'x_last_name', 'value' => $order['order']['lname']); $olpform['fields']['HIDDEN'][] = array('name' => 'x_company', 'value' => $order['order']['company']); $olpform['fields']['HIDDEN'][] = array('name' => 'x_address', 'value' => $order['order']['addone'] . ' ' . $order['order']['addtwo']); $olpform['fields']['HIDDEN'][] = array('name' => 'x_city', 'value' => $order['order']['city']); $olpform['fields']['HIDDEN'][] = array('name' => 'x_state', 'value' => $order['order']['stateprov']); $olpform['fields']['HIDDEN'][] = array('name' => 'x_country', 'value' => $order['order']['country']); $olpform['fields']['HIDDEN'][] = array('name' => 'x_zip', 'value' => $order['order']['postalcode']); $olpform['fields']['HIDDEN'][] = array('name' => 'x_phone', 'value' => $order['order']['phone']); $olpform['fields']['HIDDEN'][] = array('name' => 'x_email', 'value' => $order['order']['email']); $olpform['fields']['HIDDEN'][] = array('name' => 'x_show_form', 'value' => 'PAYMENT_FORM'); $olpform['fields']['HIDDEN'][] = array('name' => 'x_method', 'value' => 'CC'); $olpform['fields']['HIDDEN'][] = array('name' => 'x_type', 'value' => 'AUTH_CAPTURE'); $olpform['fields']['HIDDEN'][] = array('name' => 'x_version', 'value' => '3.1'); $olpform['fields']['HIDDEN'][] = array('name' => 'x_relay_response', 'value' => 'TRUE'); $olpform['fields']['HIDDEN'][] = array('name' => 'x_relay_url', 'value' => $url_relay); $olpform['fields']['HIDDEN'][] = array('name' => 'x_receipt_link_method', 'value' => 'POST'); $olpform['fields']['HIDDEN'][] = array('name' => 'x_header_html_payment_form', 'value' => 'Please complete the payment information below and click the Submit Transaction button to place your online order.'); $olpform['fields']['HIDDEN'][] = array('name' => 'x_footer_html_payment_form', 'value' => 'After placing your online order, you will be presented with a printable receipt.'); $olpform['fields']['HIDDEN'][] = array('name' => 'x_email_customer', 'value' => 'FALSE'); $olpform['fields']['HIDDEN'][] = array('name' => 'x_fp_hash', 'value' => $x_fp_hash); $olpform['fields']['HIDDEN'][] = array('name' => 'x_fp_sequence', 'value' => $x_fp_sequence); $olpform['fields']['HIDDEN'][] = array('name' => 'x_fp_timestamp', 'value' => $x_fp_timestamp); // +-- // | Create the DISPLAY fields for the form. // +-- $olpform['fields']['DISPLAY'][] = array('type' => 'PAYFORMCONTINUE', 'params' => array('name' => 'ecom_continue', 'required' => 1, 'display' => 'Payment Information', 'desc' => $instructions, 'option' => 'Enter Payment Information')); // +-- // | Globalize the $olpform array and return. // +-- $this->globals('ecom.olpform',$olpform); ?>