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."; // +-- // | 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. // +-- // | Variables. // +-- $url_relay = $this->globals('core.url_ssl') . '/utilities/ecomrelay.php'; $shasign = 'AMOUNT=' . ($order['order']['ordertotal'] * 100) . $order['gateway']['transkey']; $shasign .= 'CURRENCY=' . $this->globals('core_settings.core.basecurrency') . $order['gateway']['transkey']; $shasign .= 'LANGUAGE=en_US' . $order['gateway']['transkey']; $shasign .= 'ORDERID=' . $order['order']['id'] . $order['gateway']['transkey']; $shasign .= 'PSPID=' . $order['gateway']['userid'] . $order['gateway']['transkey']; if ($extension == 'hash') { $shasign = @hash_hmac('sha1',$shasign,$order['gateway']['transkey']); $shasign = @strtoupper($shasign); } else { $shasign = @mhash(MHASH_SHA1,$shasign,$order['gateway']['transkey']); $shasign = @bin2hex($shasign); $shasign = @strtoupper($shasign); } // End of if statement. $homeurl = $this->link_namespace('cms','display',array('ref'=>'splash')); $catalogurl = $this->link_namespace('ecom','splash',array()); // +-- // | Set up the olpform array. // +-- $olpform = array('url' => 'https://payments.epdq.co.uk/ncol/prod/orderstandard.asp', 'button' => 'Continue', 'fields' => array()); // +-- // | Create the HIDDEN fields for the form. // +-- $olpform['fields']['HIDDEN'][] = array('name' => 'PSPID', 'value' => $order['gateway']['userid']); $olpform['fields']['HIDDEN'][] = array('name' => 'ORDERID', 'value' => $order['order']['id']); $olpform['fields']['HIDDEN'][] = array('name' => 'AMOUNT', 'value' => $order['order']['ordertotal'] * 100); $olpform['fields']['HIDDEN'][] = array('name' => 'CURRENCY', 'value' => $this->globals('core_settings.core.basecurrency')); $olpform['fields']['HIDDEN'][] = array('name' => 'LANGUAGE', 'value' => 'en_US'); $olpform['fields']['HIDDEN'][] = array('name' => 'COM', 'value' => 'Online Order'); $olpform['fields']['HIDDEN'][] = array('name' => 'CN', 'value' => $order['order']['fname'] . ' ' . $order['order']['lname']); $olpform['fields']['HIDDEN'][] = array('name' => 'EMAIL', 'value' => $order['order']['email']); $olpform['fields']['HIDDEN'][] = array('name' => 'OWNERZIP', 'value' => $order['order']['postalcode']); $olpform['fields']['HIDDEN'][] = array('name' => 'OWNERCITY', 'value' => $order['order']['city']); $olpform['fields']['HIDDEN'][] = array('name' => 'OWNERTELNO', 'value' => $order['order']['phone']); $olpform['fields']['HIDDEN'][] = array('name' => 'SHASIGN', 'value' => $shasign); $olpform['fields']['HIDDEN'][] = array('name' => 'HOMEURL', 'value' => $homeurl); $olpform['fields']['HIDDEN'][] = array('name' => 'CATALOGURL', 'value' => $catalogurl); $olpform['fields']['HIDDEN'][] = array('name' => 'ACCEPTURL', 'value' => $url_relay); $olpform['fields']['HIDDEN'][] = array('name' => 'DECLINEURL', 'value' => $url_relay); $olpform['fields']['HIDDEN'][] = array('name' => 'EXCEPTIONURL', 'value' => $url_relay); $olpform['fields']['HIDDEN'][] = array('name' => 'CANCELURL', 'value' => $url_relay); $olpform['fields']['HIDDEN'][] = array('name' => 'OPERATION', 'value' => 'SAL'); // +-- // | 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); ?>