Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

One Page Checkout Support


Guest

Recommended Posts

I'm excited about this add-on but can't seem to get it to work. I'm installing it on an osCommerce 2.3.1 site that only has a couple other add-ons presently (SEO URLS 5 and Order Editor). I've uploaded everything and made all the necessary changes but I'm getting the following error:

 

Call to undefined method oscTemplate::getHeaderTags() in /******/checkout.php on line 285

 

I tried commenting out the line:

 

<?php echo $oscTemplate->getHeaderTags(); ?>

 

but doing so only returns a blank page when attempting to check out.

 

Any ideas? Also, I have an Authorize.Net AIM payment module I'm using, but there weren't any instructions for updating these files. Are any changes necessary to these files?

 

Thanks in advance for any help on this

try removing that line

 

Steve

Link to comment
Share on other sites

did some more testing, works fine when not using SSL, but when i turn it back on, and it goes to the shared ssl that the hosting provider uses, it fails at checking the email address.

insall your own ssl dont use shared ssl its not a good idea

 

Steve

Link to comment
Share on other sites

Fisrt of what payment module are you using also check that payment module doesnt have its own process page like paypal standard/ipn has

Hi steve - thanks for your reply!

 

You're right - I'm using PayPal, but there is no paypal_standard.php as it's written in the install.html. I've got a paypal.php ($Id: paypal.php,v 1.12 2008/01/09 08:21:02 mmr Exp $) and the lines I have to search for aren't found (this paypal module doesn't send any mails or does anything else - this is all done manually in the backend). One of the incomplete orders used paypal - the other one wasn't tracked (but I also had complete orders using paypal).

 

The other used payment modules are moneyorder, cc and ccbank.

 

Maybe it's because I didn't do all the changes of the install.html, such as:

- in catalog/includes/modules/order_total/shipping.php (the search-for wasn't found)

- in catalog/includes/modules/payment/paypal_standard.php (as said above - this is not the paypal module that is used in this shop)

- in catalog/includes/modules/payment/protx_direct.php and catalog/protx_process.php (files don't exist)

- in catalog/checkout_process.php (only the search-for "$email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"" wasn't found - but I added the change anyway)

 

Hope you can help me again! :-)

 

Greetings from Germany,

Martin

Link to comment
Share on other sites

Hi Martin,

 

that should be there in catalog/includes/modules/order_total/shipping.php on 2.2 & 2,31

 

below is the whole block of that function it is in

 

    function process() {
     global $order, $currencies;

     if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') {
       switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
         case 'national':
           if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
         case 'international':
           if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
         case 'both':
           $pass = true; break;
         default:
           $pass = false; break;
       }

       if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
         $order->info['shipping_method'] = FREE_SHIPPING_TITLE;
         $order->info['total'] -= $order->info['shipping_cost'];
         $order->info['shipping_cost'] = 0;
       }
     }

 

now you can compare and see where to add this in your file

/* One Page Checkout - BEGIN */
       if (ONEPAGE_CHECKOUT_ENABLED != 'True'){
         if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
           $order->info['shipping_method'] = FREE_SHIPPING_TITLE;
           $order->info['total'] -= $order->info['shipping_cost'];
           $order->info['shipping_cost'] = 0;
         }
       }
/* One Page Checkout - END */

 

Have you made the changes to catalog/includes/classes/order.php?

 

Steve

Link to comment
Share on other sites

Can anyone help to get Realex Remote Payments to work with OPC, please.

 

When the radio is clicked for it, OPC gives this error:

 

There was an error setting payment method, please inform Dublin Duck Race about this error.

 

 

<?php

class realex {
var $code, $title, $description, $enabled, $responses;

// class constructor
   function realex() {
     $this->code = 'realex';
     $this->title = MODULE_PAYMENT_REALEX_TEXT_TITLE;
     $this->description = MODULE_PAYMENT_REALEX_TEXT_DESCRIPTION;
     $this->enabled = ((MODULE_PAYMENT_REALEX_STATUS == 'True') ? true : false);
   }

// class methods
   // this method returns the javascript that will validate the form entry
   //** Checkout_Payment
   function javascript_validation() {
     $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
           '    var cc_owner = document.checkout_payment.realexpay_cc_owner.value;' . "\n" .
           '    var cc_number = document.checkout_payment.realexpay_cc_number.value;' . "\n" .
           '    if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" .
           '      error_message = error_message + "' . MODULE_PAYMENT_REALEX_TEXT_JS_CC_OWNER . '";' . "\n" .
           '      error = 1;' . "\n" .
           '    }' . "\n" .
           '    if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
           '      error_message = error_message + "' . MODULE_PAYMENT_REALEX_TEXT_JS_CC_NUMBER . '";' . "\n" .
           '      error = 1;' . "\n" .
           '    }' . "\n" .
           '  }' . "\n";

     return $js;
   }

   // this method returns the html that creates the input form
       //** Checkout_Payment

   function selection() {
     global $order;

     for ($i=1; $i<13; $i++) {
       $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
     }
     $today = getdate(); 
     for ($i=$today['year']; $i < $today['year']+10; $i++) {
       $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
     }

     $selection = array('id' => $this->code,
                       'module' => $this->title,
                       'fields' => array(array('title' => MODULE_PAYMENT_REALEX_TEXT_CREDIT_CARD_OWNER,
                                               'field' => tep_draw_input_field('realexpay_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
                                         array('title' => MODULE_PAYMENT_REALEX_TEXT_CREDIT_CARD_NUMBER,
                                               'field' => tep_draw_input_field('realexpay_cc_number')),
                                         array('title' => 'CVN Number:',
                                               'field' => tep_draw_input_field('cvn_number')),
                                         array('title' => MODULE_PAYMENT_REALEX_TEXT_CREDIT_CARD_EXPIRES,
                                               'field' => tep_draw_pull_down_menu('realexpay_cc_expires_month', $expires_month) . ' ' . tep_draw_pull_down_menu('realexpay_cc_expires_year', $expires_year))));
     return $selection;
   }

   // this method is called before the data is sent to the credit card processor
   // here you can do any field validation that you need to do
   // we also set the global variables here from the form values
       //** Checkout_Payment
   function pre_confirmation_check() {
     global $HTTP_POST_VARS;

     include(DIR_WS_CLASSES . 'cc_validation.php');

     $cc_validation = new cc_validation();
     $result = $cc_validation->validate($HTTP_POST_VARS['realexpay_cc_number'], $HTTP_POST_VARS['realexpay_cc_expires_month'], $HTTP_POST_VARS['realexpay_cc_expires_year']);

     $error = '';
     switch ($result) {
       case -1:
         $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
         break;
       case -2:
       case -3:
       case -4:
         $error = TEXT_CCVAL_ERROR_INVALID_DATE;
         break;
       case false:
         $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
         break;
     }

     if ( ($result == false) || ($result < 1) ) {
       $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&realexpay_cc_owner=' . urlencode($HTTP_POST_VARS['realexpay_cc_owner']) . '&realexpay_cc_type=' . urlencode($HTTP_POST_VARS['realexpay_cc_type']) . '&realexpay_cc_expires_month=' . $HTTP_POST_VARS['realexpay_cc_expires_month'] . '&realexpay_cc_expires_year=' . $HTTP_POST_VARS['realexpay_cc_expires_year'];

       tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
     }

     $this->cc_card_owner = $HTTP_POST_VARS['realexpay_cc_owner']; 
     $this->cc_card_number = $cc_validation->cc_number;
     $this->cc_expiry_month = $cc_validation->cc_expiry_month;
     $this->cc_expiry_year = $cc_validation->cc_expiry_year;
     $this->cc_card_type = $cc_validation->cc_type;
  $this->cvn_number = $HTTP_POST_VARS['cvn_number'];


   }

   // this method returns the data for the confirmation page
   //**check_confirmation
   function confirmation() {
     global $HTTP_POST_VARS;
     global $order;
     $confirmation = array('title' => $this->title,
                          'fields' => array(array('title' => MODULE_PAYMENT_REALEX_TEXT_CREDIT_CARD_OWNER,
                                                  'field' => $HTTP_POST_VARS['realexpay_cc_owner']),
                      array('title' => MODULE_PAYMENT_REALEX_TEXT_CREDIT_CARD_TYPE,
                                                  'field' =>  $this->cc_card_type),
                                            array('title' => MODULE_PAYMENT_REALEX_TEXT_CREDIT_CARD_NUMBER,
                                                  'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
                                            array('title' => 'CVN Number', 'field' =>  $this->cvn_number),                                           array('title' => MODULE_PAYMENT_REALEX_TEXT_CREDIT_CARD_EXPIRES,
                                                  'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['realexpay_cc_expires_month'], 1, '20' . $HTTP_POST_VARS['realexpay_cc_expires_year']))))); 

     return $confirmation;
   }

   // this method performs the authorization by sending the data to the processor, and getting the result
   //** Written in checkout_confimration

   function process_button() {
     global $order;

     $process_button_string = tep_draw_hidden_field('merchantid', MODULE_PAYMENT_REALEX_MERCHANT_ID) .
                              tep_draw_hidden_field('amount', number_format(($order->info['total']*100), 0, '', '')) .
		       tep_draw_hidden_field('amount2',$order->info['total']) .
                              tep_draw_hidden_field('ponum', date('Ymdhis')) .
                              tep_draw_hidden_field('cvn', ($this->cvn_number)) .
	                       tep_draw_hidden_field('cctype', ($this->cc_card_type)) . 
  		               tep_draw_hidden_field('ccowner',$this->cc_card_owner) .
		       tep_draw_hidden_field('currency', ($order->info['currency'])) .
                              tep_draw_hidden_field('creditCard1', $this->cc_card_number) .
                              tep_draw_hidden_field('exdate1', $this->cc_expiry_month) .
                              tep_draw_hidden_field('exdate2', substr($this->cc_expiry_year, -2)) ;

     return $process_button_string;
   }

   // this method gets called after the processing is done but before the app server 
   // accepts the result.  It is used to check for errors.
   //** called by checkout_process

   function before_process() {
     global $HTTP_POST_VARS;

$timestamp = strftime("%Y%m%d%H%M%S");
mt_srand((double)microtime()*1000000);

//** These values passed in from function process_button

$merchantid = $HTTP_POST_VARS['merchantid'];
$amount = $HTTP_POST_VARS['amount'];
$ccnum =$HTTP_POST_VARS['creditCard1'];
$ccname = $HTTP_POST_VARS['ccowner'];

$ccctype = $HTTP_POST_VARS['currency'];
$amount2 = $HTTP_POST_VARS['amount2'];

$curr = $HTTP_POST_VARS['currency'];
$expdate = $HTTP_POST_VARS['exdate1'] . $HTTP_POST_VARS['exdate2'];


$cardtype = $HTTP_POST_VARS['cctype'];
if (ereg('^Master Card$',  $cardtype)) {
       $cardtype = 'MC';
}
if (ereg('^American Express$',  $cardtype)) {
       $cardtype = 'AMEX';
}

$cvn = $HTTP_POST_VARS['cvn'];
if (!empty($cvn))
{
$presind = "1";
}
else
$presind = "4";




// I'm using a random number as the orderid - you probably have a better way.
$orderid = $timestamp."-".mt_rand(1, 999);
$secret = MODULE_PAYMENT_REALEX_SHARED_SECRET;
// creating the hash.
$tmp = "$timestamp.$merchantid.$orderid.$amount.$curr.$ccnum";
$md5hash = md5($tmp);
$tmp = "$md5hash.$secret";
$md5hash = md5($tmp);


// fire up the xml parser...
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "cDataHandler");

//include('osxmlparser.php');
//$os_xmlparser = new osxmlparser();


$xml = "<request type='auth' timestamp='$timestamp'>
<merchantid>$merchantid</merchantid>
<account>internet</account>
<orderid>$orderid</orderid>
<amount currency='$curr'>$amount</amount>
<card> 
	<number>$ccnum</number>
	<expdate>$expdate</expdate>
	<type>$cardtype</type> 
	<chname>$ccname</chname> 
<cvn>
     <number>$cvn</number>
     <presind>$presind</presind>
   </cvn>

</card> 
<autosettle flag='1'/>
<comments><comment id='1'>$amount2</comment></comments>
	<tssinfo>
	<address type='billing'>
		<country>ie</country>
	</address>
	<custnum>$ccctype</custnum>
	<prodid>$cccctype</prodid>
	<varref>$ccccctype</varref>
</tssinfo>
<md5hash>$md5hash</md5hash>
</request>";



$URL = MODULE_PAYMENT_REALEX_URL;

// send it to payandshop.com
$curlLoc = MODULE_PAYMENT_REALEX_CURL_LOC;
exec("$curlLoc -s -m 120 -d \"$xml\" $URL -L", $return_message_array, $return_number);

for ($i = 0; $i < count($return_message_array); $i++) {
   $response = $response.$return_message_array[$i];
}


// fix it up good.
$response = eregi_replace ( "[[:space:]]+", " ", $response );
$response = eregi_replace ( "[\n\r]", "", $response );

preg_match("/<result>(.*?)<\/result>/i",$response,$matches);
$XMLresult = $matches[1];

preg_match("/<message>(.*)<\/message>/i",$response,$matches);
$XMLmessage = $matches[1];

$resultString = $XMLresult."     ".$XMLmessage;

$realexResult = $XMLresult;

if ($realexResult != "00"){

       tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=' . urlencode($resultString), 'SSL', true, false));
       }


}




//**called after process complete

   function after_process() {
         return false;
   }

   function get_error() {
     global $HTTP_GET_VARS;

     $msg = "";
     if (stripslashes(urldecode($HTTP_GET_VARS['response_text'])) != "")
       $msg = stripslashes(urldecode($HTTP_GET_VARS['response_text']));
     else if (stripslashes(urldecode($HTTP_GET_VARS['error'])) != "")
       $msg = stripslashes(urldecode($HTTP_GET_VARS['error']));
     $error = array('title' => MODULE_PAYMENT_REALEX_TEXT_ERROR,
                    'error' => $msg);
     return $error;
   }



   function check() {
     if (!isset($this->_check)) {
       $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_REALEX_STATUS'");
       $this->_check = tep_db_num_rows($check_query);
     }
     return $this->_check;
   }

   function install() {
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Realex Module', 'MODULE_PAYMENT_REALEX_STATUS', 'True', 'Do you want to use Realex Payments?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID', 'MODULE_PAYMENT_REALEX_MERCHANT_ID', 'sec0001', 'The merchant id used for the Realex Payments service', '6', '0', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shared Secret', 'MODULE_PAYMENT_REALEX_SHARED_SECRET', 'secret', 'The shared secret used for the Realex Payments service', '6', '0', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Curl Location', 'MODULE_PAYMENT_REALEX_CURL_LOC', '/usr/bin/curl', 'This is where Curl is located on your server', '6', '0', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Realex URL', 'MODULE_PAYMENT_REALEX_URL', 'https://epage.payandshop.com/epage-remote.cgi', 'This is the URL of the Realex Gateway', '6', '0', now())");


   }

   function remove() {
     tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
   }

   function keys() {
     return array('MODULE_PAYMENT_REALEX_STATUS', 'MODULE_PAYMENT_REALEX_MERCHANT_ID','MODULE_PAYMENT_REALEX_SHARED_SECRET','MODULE_PAYMENT_REALEX_CURL_LOC','MODULE_PAYMENT_REALEX_URL');
   }





}
?>

Link to comment
Share on other sites

Can anyone help to get Realex Remote Payments to work with OPC, please.

 

When the radio is clicked for it, OPC gives this error:

 

There was an error setting payment method, please inform Dublin Duck Race about this error.

 

 

<?php

class realex {
var $code, $title, $description, $enabled, $responses;

// class constructor
   function realex() {
     $this->code = 'realex';
     $this->title = MODULE_PAYMENT_REALEX_TEXT_TITLE;
     $this->description = MODULE_PAYMENT_REALEX_TEXT_DESCRIPTION;
     $this->enabled = ((MODULE_PAYMENT_REALEX_STATUS == 'True') ? true : false);
   }

// class methods
   // this method returns the javascript that will validate the form entry
   //** Checkout_Payment
   function javascript_validation() {
     $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
           '    var cc_owner = document.checkout_payment.realexpay_cc_owner.value;' . "\n" .
           '    var cc_number = document.checkout_payment.realexpay_cc_number.value;' . "\n" .
           '    if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" .
           '      error_message = error_message + "' . MODULE_PAYMENT_REALEX_TEXT_JS_CC_OWNER . '";' . "\n" .
           '      error = 1;' . "\n" .
           '    }' . "\n" .
           '    if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
           '      error_message = error_message + "' . MODULE_PAYMENT_REALEX_TEXT_JS_CC_NUMBER . '";' . "\n" .
           '      error = 1;' . "\n" .
           '    }' . "\n" .
           '  }' . "\n";

     return $js;
   }

   // this method returns the html that creates the input form
       //** Checkout_Payment

   function selection() {
     global $order;

     for ($i=1; $i<13; $i++) {
       $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
     }
     $today = getdate(); 
     for ($i=$today['year']; $i < $today['year']+10; $i++) {
       $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
     }

     $selection = array('id' => $this->code,
                       'module' => $this->title,
                       'fields' => array(array('title' => MODULE_PAYMENT_REALEX_TEXT_CREDIT_CARD_OWNER,
                                               'field' => tep_draw_input_field('realexpay_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
                                         array('title' => MODULE_PAYMENT_REALEX_TEXT_CREDIT_CARD_NUMBER,
                                               'field' => tep_draw_input_field('realexpay_cc_number')),
                                         array('title' => 'CVN Number:',
                                               'field' => tep_draw_input_field('cvn_number')),
                                         array('title' => MODULE_PAYMENT_REALEX_TEXT_CREDIT_CARD_EXPIRES,
                                               'field' => tep_draw_pull_down_menu('realexpay_cc_expires_month', $expires_month) . ' ' . tep_draw_pull_down_menu('realexpay_cc_expires_year', $expires_year))));
     return $selection;
   }

   // this method is called before the data is sent to the credit card processor
   // here you can do any field validation that you need to do
   // we also set the global variables here from the form values
       //** Checkout_Payment
   function pre_confirmation_check() {
     global $HTTP_POST_VARS;

     include(DIR_WS_CLASSES . 'cc_validation.php');

     $cc_validation = new cc_validation();
     $result = $cc_validation->validate($HTTP_POST_VARS['realexpay_cc_number'], $HTTP_POST_VARS['realexpay_cc_expires_month'], $HTTP_POST_VARS['realexpay_cc_expires_year']);

     $error = '';
     switch ($result) {
       case -1:
         $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
         break;
       case -2:
       case -3:
       case -4:
         $error = TEXT_CCVAL_ERROR_INVALID_DATE;
         break;
       case false:
         $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
         break;
     }

     if ( ($result == false) || ($result < 1) ) {
       $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&realexpay_cc_owner=' . urlencode($HTTP_POST_VARS['realexpay_cc_owner']) . '&realexpay_cc_type=' . urlencode($HTTP_POST_VARS['realexpay_cc_type']) . '&realexpay_cc_expires_month=' . $HTTP_POST_VARS['realexpay_cc_expires_month'] . '&realexpay_cc_expires_year=' . $HTTP_POST_VARS['realexpay_cc_expires_year'];

       tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
     }

     $this->cc_card_owner = $HTTP_POST_VARS['realexpay_cc_owner']; 
     $this->cc_card_number = $cc_validation->cc_number;
     $this->cc_expiry_month = $cc_validation->cc_expiry_month;
     $this->cc_expiry_year = $cc_validation->cc_expiry_year;
     $this->cc_card_type = $cc_validation->cc_type;
  $this->cvn_number = $HTTP_POST_VARS['cvn_number'];


   }

   // this method returns the data for the confirmation page
   //**check_confirmation
   function confirmation() {
     global $HTTP_POST_VARS;
     global $order;
     $confirmation = array('title' => $this->title,
                          'fields' => array(array('title' => MODULE_PAYMENT_REALEX_TEXT_CREDIT_CARD_OWNER,
                                                  'field' => $HTTP_POST_VARS['realexpay_cc_owner']),
                      array('title' => MODULE_PAYMENT_REALEX_TEXT_CREDIT_CARD_TYPE,
                                                  'field' =>  $this->cc_card_type),
                                            array('title' => MODULE_PAYMENT_REALEX_TEXT_CREDIT_CARD_NUMBER,
                                                  'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
                                            array('title' => 'CVN Number', 'field' =>  $this->cvn_number),                                           array('title' => MODULE_PAYMENT_REALEX_TEXT_CREDIT_CARD_EXPIRES,
                                                  'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['realexpay_cc_expires_month'], 1, '20' . $HTTP_POST_VARS['realexpay_cc_expires_year']))))); 

     return $confirmation;
   }

   // this method performs the authorization by sending the data to the processor, and getting the result
   //** Written in checkout_confimration

   function process_button() {
     global $order;

     $process_button_string = tep_draw_hidden_field('merchantid', MODULE_PAYMENT_REALEX_MERCHANT_ID) .
                              tep_draw_hidden_field('amount', number_format(($order->info['total']*100), 0, '', '')) .
		       tep_draw_hidden_field('amount2',$order->info['total']) .
                              tep_draw_hidden_field('ponum', date('Ymdhis')) .
                              tep_draw_hidden_field('cvn', ($this->cvn_number)) .
	                       tep_draw_hidden_field('cctype', ($this->cc_card_type)) . 
  		               tep_draw_hidden_field('ccowner',$this->cc_card_owner) .
		       tep_draw_hidden_field('currency', ($order->info['currency'])) .
                              tep_draw_hidden_field('creditCard1', $this->cc_card_number) .
                              tep_draw_hidden_field('exdate1', $this->cc_expiry_month) .
                              tep_draw_hidden_field('exdate2', substr($this->cc_expiry_year, -2)) ;

     return $process_button_string;
   }

   // this method gets called after the processing is done but before the app server 
   // accepts the result.  It is used to check for errors.
   //** called by checkout_process

   function before_process() {
     global $HTTP_POST_VARS;

$timestamp = strftime("%Y%m%d%H%M%S");
mt_srand((double)microtime()*1000000);

//** These values passed in from function process_button

$merchantid = $HTTP_POST_VARS['merchantid'];
$amount = $HTTP_POST_VARS['amount'];
$ccnum =$HTTP_POST_VARS['creditCard1'];
$ccname = $HTTP_POST_VARS['ccowner'];

$ccctype = $HTTP_POST_VARS['currency'];
$amount2 = $HTTP_POST_VARS['amount2'];

$curr = $HTTP_POST_VARS['currency'];
$expdate = $HTTP_POST_VARS['exdate1'] . $HTTP_POST_VARS['exdate2'];


$cardtype = $HTTP_POST_VARS['cctype'];
if (ereg('^Master Card$',  $cardtype)) {
       $cardtype = 'MC';
}
if (ereg('^American Express$',  $cardtype)) {
       $cardtype = 'AMEX';
}

$cvn = $HTTP_POST_VARS['cvn'];
if (!empty($cvn))
{
$presind = "1";
}
else
$presind = "4";




// I'm using a random number as the orderid - you probably have a better way.
$orderid = $timestamp."-".mt_rand(1, 999);
$secret = MODULE_PAYMENT_REALEX_SHARED_SECRET;
// creating the hash.
$tmp = "$timestamp.$merchantid.$orderid.$amount.$curr.$ccnum";
$md5hash = md5($tmp);
$tmp = "$md5hash.$secret";
$md5hash = md5($tmp);


// fire up the xml parser...
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "cDataHandler");

//include('osxmlparser.php');
//$os_xmlparser = new osxmlparser();


$xml = "<request type='auth' timestamp='$timestamp'>
<merchantid>$merchantid</merchantid>
<account>internet</account>
<orderid>$orderid</orderid>
<amount currency='$curr'>$amount</amount>
<card> 
	<number>$ccnum</number>
	<expdate>$expdate</expdate>
	<type>$cardtype</type> 
	<chname>$ccname</chname> 
<cvn>
     <number>$cvn</number>
     <presind>$presind</presind>
   </cvn>

</card> 
<autosettle flag='1'/>
<comments><comment id='1'>$amount2</comment></comments>
	<tssinfo>
	<address type='billing'>
		<country>ie</country>
	</address>
	<custnum>$ccctype</custnum>
	<prodid>$cccctype</prodid>
	<varref>$ccccctype</varref>
</tssinfo>
<md5hash>$md5hash</md5hash>
</request>";



$URL = MODULE_PAYMENT_REALEX_URL;

// send it to payandshop.com
$curlLoc = MODULE_PAYMENT_REALEX_CURL_LOC;
exec("$curlLoc -s -m 120 -d \"$xml\" $URL -L", $return_message_array, $return_number);

for ($i = 0; $i < count($return_message_array); $i++) {
   $response = $response.$return_message_array[$i];
}


// fix it up good.
$response = eregi_replace ( "[[:space:]]+", " ", $response );
$response = eregi_replace ( "[\n\r]", "", $response );

preg_match("/<result>(.*?)<\/result>/i",$response,$matches);
$XMLresult = $matches[1];

preg_match("/<message>(.*)<\/message>/i",$response,$matches);
$XMLmessage = $matches[1];

$resultString = $XMLresult."     ".$XMLmessage;

$realexResult = $XMLresult;

if ($realexResult != "00"){

       tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=' . urlencode($resultString), 'SSL', true, false));
       }


}




//**called after process complete

   function after_process() {
         return false;
   }

   function get_error() {
     global $HTTP_GET_VARS;

     $msg = "";
     if (stripslashes(urldecode($HTTP_GET_VARS['response_text'])) != "")
       $msg = stripslashes(urldecode($HTTP_GET_VARS['response_text']));
     else if (stripslashes(urldecode($HTTP_GET_VARS['error'])) != "")
       $msg = stripslashes(urldecode($HTTP_GET_VARS['error']));
     $error = array('title' => MODULE_PAYMENT_REALEX_TEXT_ERROR,
                    'error' => $msg);
     return $error;
   }



   function check() {
     if (!isset($this->_check)) {
       $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_REALEX_STATUS'");
       $this->_check = tep_db_num_rows($check_query);
     }
     return $this->_check;
   }

   function install() {
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Realex Module', 'MODULE_PAYMENT_REALEX_STATUS', 'True', 'Do you want to use Realex Payments?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID', 'MODULE_PAYMENT_REALEX_MERCHANT_ID', 'sec0001', 'The merchant id used for the Realex Payments service', '6', '0', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shared Secret', 'MODULE_PAYMENT_REALEX_SHARED_SECRET', 'secret', 'The shared secret used for the Realex Payments service', '6', '0', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Curl Location', 'MODULE_PAYMENT_REALEX_CURL_LOC', '/usr/bin/curl', 'This is where Curl is located on your server', '6', '0', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Realex URL', 'MODULE_PAYMENT_REALEX_URL', 'https://epage.payandshop.com/epage-remote.cgi', 'This is the URL of the Realex Gateway', '6', '0', now())");


   }

   function remove() {
     tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
   }

   function keys() {
     return array('MODULE_PAYMENT_REALEX_STATUS', 'MODULE_PAYMENT_REALEX_MERCHANT_ID','MODULE_PAYMENT_REALEX_SHARED_SECRET','MODULE_PAYMENT_REALEX_CURL_LOC','MODULE_PAYMENT_REALEX_URL');
   }





}
?>

hi try this

 

in catalog/includes/classes/onepage_checkout.php

find

/* Comment line below for oscommerce versions before MS2.2 RC2a */

$confirmation = $GLOBALS[$payment]->confirmation();

 

/* Uncomment line below for oscommerce versions before MS2.2 RC2a */

//$confirmation = $GLOBALS[$payment]->selection();

 

change it to

/* Comment line below for oscommerce versions before MS2.2 RC2a */

//$confirmation = $GLOBALS[$payment]->confirmation();

 

/* Uncomment line below for oscommerce versions before MS2.2 RC2a */

$confirmation = $GLOBALS[$payment]->selection();

 

Steve

Link to comment
Share on other sites

Hey Steve! :)

 

that should be there in catalog/includes/modules/order_total/shipping.php on 2.2 & 2,31

 

below is the whole block of that function it is in

 

Thanks - I found the code in ot_shipping.php instead of shipping.php. I've made the changes.

 

Have you made the changes to catalog/includes/classes/order.php?

Interesting - you're right. It looks like I've overseen this file. The tax calculation is not the same as in install.html but I added the "+ $this->info['shipping_tax']" to the current calculation.

 

Unfortunately, I yesterday received the error e-mail again and it was - again - with paypal selected.

 

Also, 3 of the 4 users with an error e-mail used Mac OS X or at least Safari. The 4th was me using Windows XP and Firefox 4 - but I don't know what I exactly did different to my other test orders to receive this e-mail.

 

Hope we get this one fixed. :)

 

Greetings from Germany,

Martin

Link to comment
Share on other sites

  • 2 weeks later...

Hi there,

 

just having my first play around with this and notice that on IE9 all the pop ups dont work properly. They're all minimised and have to be stretched. Anyone else have the same problem?

 

Also if i try and edit an address it says at the end that that was a problem saving the details but if i cancel and return to the address book then the change has been made.

 

Are there any known solutions for these?

 

Thanks

 

Dave

Link to comment
Share on other sites

Hi guys,

 

I'm currently working for a client and we've fixed some issues with the OPC login box. However, because the problem was caused by a doctype, when I changed the doctype to make it work, it's thrown off the header on the checkout. All of the buttons are displaying further down than the shopping cart section.

 

The website is here and if you add something to the cart you'll see it.

 

Any help appreciated!!!!

 

Andrew

Link to comment
Share on other sites

OK I have been searching the forums and going through the code bit by bit, and I can't figure this one out...

 

See I have it working completely, all the way through checkout, it charges the card... everythihng works great, EXCEPT that even though it shows the correct shipping on the checkout page it doesn't charge it and the invoice looks like this:

 

Sub-Total: $1.50

f: $0.00

Sales Tax: $0.12

Total: $1.62

 

The f: 0.00 is the issue, that should be the shipping charge... but hmmm....

 

On the OPC page, it desplays the correct amount for shipping but once it gets proccessed then it changes to "f"

 

I mean I know what I have been using "f" to stand for, but I can't for the life of me figure out how to get it to register the correct value,

 

OH and it's only charging my card 1.62 vs the 1.62 + shipping

Link to comment
Share on other sites

Hi there,

 

just having my first play around with this and notice that on IE9 all the pop ups dont work properly. They're all minimised and have to be stretched. Anyone else have the same problem?

 

Also if i try and edit an address it says at the end that that was a problem saving the details but if i cancel and return to the address book then the change has been made.

 

Are there any known solutions for these?

 

Thanks

 

Dave

 

Did you miss this posted fix under the add-on?

 

1. In the new_address.php, it should be at the top "addNewAddress" not "saveAddress"

2. In the onepage_checkout.php you need to remove the blank return that is at the bottom underneath "success:true" in the saveAddress function

 

Then you will no longer get the error message.

Link to comment
Share on other sites

OK I have been searching the forums and going through the code bit by bit, and I can't figure this one out...

 

See I have it working completely, all the way through checkout, it charges the card... everythihng works great, EXCEPT that even though it shows the correct shipping on the checkout page it doesn't charge it and the invoice looks like this:

 

Sub-Total: $1.50

f: $0.00

Sales Tax: $0.12

Total: $1.62

 

The f: 0.00 is the issue, that should be the shipping charge... but hmmm....

 

On the OPC page, it desplays the correct amount for shipping but once it gets proccessed then it changes to "f"

 

I mean I know what I have been using "f" to stand for, but I can't for the life of me figure out how to get it to register the correct value,

 

OH and it's only charging my card 1.62 vs the 1.62 + shipping

 

I have seen this before and if I remember correctly I believe it is the checkout_process.php page is trying to run the checkout shipping page which causes it to drop the shipping information altogether. In the end I even had to change the filenames.php line to be define('FILENAME_CHECKOUT_SHIPPING', 'checkout.php');

 

Not sure if this will work for you because its been a long time since I have made all the changes I had to...to get the previous versions of this module working. It is something you could quickly try.

Link to comment
Share on other sites

Hi there,

 

Love the Contribution, but I have a problem with it.

 

The issue is with IE9, when someone enters an e-mail address IE9 freezes and will not proceed. It comes up, after a while, with "(website) is not responding due to a long-running script". I have placed <meta http-equiv="X-UA-Compatible" content="IE=8"/> into my checkout.php to force it to run as IE8, but still same problem.

 

The only other script I am running is for lightbox, and that does not impact the checkout.php. I still deleted it just in case, no effect. I also have tried putting my full address before the ext/jQuery.... in each line. No help either. Any ideas?

 

Maybe it is a IE9 problem, but as it is the one most people use due to Microsofts somewhat insistent update system I really want it to work on my website.

 

Thanks For the help

Steve C

Link to comment
Share on other sites

hve been searching for almost one hour now,

 

When i have filled in all customer details ( not logged in) and make a page reload all customer details are gone, thats not so good..

 

If a customer just want to check the shipping cost and enters all fields and then go back and come back to checkout they have to fill out all fields again.

 

In the third one page the say the took this ability away - Why?

 

I tried to check those files out but it didnt work.

 

Thanks for some input to the problem!

 

Regards.

Link to comment
Share on other sites

Hi there,

 

just having my first play around with this and notice that on IE9 all the pop ups dont work properly. They're all minimised and have to be stretched. Anyone else have the same problem?

 

Also if i try and edit an address it says at the end that that was a problem saving the details but if i cancel and return to the address book then the change has been made.

 

Are there any known solutions for these?

 

Thanks

 

Dave

 

As for the pop ups not being the correct size, you just need to change the width and height in the ajax/javascript on the checkout.php page for those boxes. For example I changed mine for the login to be height: 325 and width:200, it shows up fine in both IE9, 8, & 7 now plus Firefox etc.

Link to comment
Share on other sites

HIGHLY RECOMMEND for 1.5 USERS - That you use actual images instead of the CSS span tags for the buttons on the checkout page, IE7 and up do not show them at all for some reason, at least for me they don't. So if you are working with the latest version 1.5 then compare to 1.4 and change them to use the tep_image_submit instead.

 

Unless someone has fixed all the CSS??

Link to comment
Share on other sites

hve been searching for almost one hour now,

 

When i have filled in all customer details ( not logged in) and make a page reload all customer details are gone, thats not so good..

 

If a customer just want to check the shipping cost and enters all fields and then go back and come back to checkout they have to fill out all fields again.

 

In the third one page the say the took this ability away - Why?

 

I tried to check those files out but it didnt work.

 

Thanks for some input to the problem!

 

Regards.

 

Why would someone need to reload the page? What version are you using? If you are using 1.5 they have a new button that uses AJAX to reload the shipping and payment methods without reloading the page. This makes a better user experience so that they don't have to see the shipping/payment methods reload with every change in the event they need to change information.

Link to comment
Share on other sites

HIGHLY RECOMMEND for 1.5 USERS - That you use actual images instead of the CSS span tags for the buttons on the checkout page, IE7 and up do not show them at all for some reason, at least for me they don't. So if you are working with the latest version 1.5 then compare to 1.4 and change them to use the tep_image_submit instead.

 

Unless someone has fixed all the CSS??

 

My BAD...LOL Looks like I did this to myself when I decided to change the colors. That will teach you to change things and not fully test them out. :)

Link to comment
Share on other sites

Why would someone need to reload the page? What version are you using? If you are using 1.5 they have a new button that uses AJAX to reload the shipping and payment methods without reloading the page. This makes a better user experience so that they don't have to see the shipping/payment methods reload with every change in the event they need to change information.

 

 

Maybe not reload, but if someone does it i dont want them to fill in all fields again. Im using 1.4.

 

Same if they go to the paymentprocessor and then click cancel to go back to my shop the customer details is gone.

 

There must be some way to save this information in session.

 

Im going to dig in the subject.

Link to comment
Share on other sites

Hi there,

 

Love the Contribution, but I have a problem with it.

 

The issue is with IE9, when someone enters an e-mail address IE9 freezes and will not proceed. It comes up, after a while, with "(website) is not responding due to a long-running script". I have placed <meta http-equiv="X-UA-Compatible" content="IE=8"/> into my checkout.php to force it to run as IE8, but still same problem.

 

The only other script I am running is for lightbox, and that does not impact the checkout.php. I still deleted it just in case, no effect. I also have tried putting my full address before the ext/jQuery.... in each line. No help either. Any ideas?

 

Maybe it is a IE9 problem, but as it is the one most people use due to Microsofts somewhat insistent update system I really want it to work on my website.

 

Thanks For the help

Steve C

 

Did you find a solution Steve? I am having the same issue with IE. Firefox and Chrome work fine.

Link to comment
Share on other sites

Did you find a solution Steve? I am having the same issue with IE. Firefox and Chrome work fine.

 

I had the same problem with One Page Checkout so, installed the lastest version 1.5, this seemed to have solved the problem, however I am using Protx Direct and I now get the following message

 

Warning: constant() [function.constant]: Couldn't find constant MODULE_PAYMENT_PROTX_DIRECT_USE_ in /home/redtest/public_html/includes/modules/payment/protx_direct.php on line 264

 

Warning: Cannot modify header information - headers already sent by (output started at /home/redtest/public_html/includes/modules/payment/protx_direct.php:264) in /home/redtest/public_html/includes/functions/general.php on line 29

 

any suggestions

Link to comment
Share on other sites

I have older versions of this contribution working on two different carts, but I am trying to get 1.5 working now on a third cart. Everything appears to work OK except adding addresses to the address book, and editing addresses in the address book. These two functions work, but they don't work OK. The edits take place on the server side (and the new addresses are inserted), however; despite the a 200 OK with a response of

   {
     "success": "true",

   } 

The following code block in the checkout.php file (around line 601)

onePage.queueAjaxRequest({ 
						url: onePage.pageLinks.checkout,
						beforeSendMsg: 'Updating Address',
						dataType: 'json',
						data: $(":input", this).serialize(),
						type: 'post',
						success: function (data){ 
							onePage.loadAddressBook($this, addressType);
						},
						errorMsg: 'There was an error saving your address, please inform <?php echo STORE_NAME; ?> about this error.'
					});

Is returning the errorMsg rather than completing the success function. I have gone through all the applicable code and cannot find any reason why this would happen.

If I close the alert and close the dialog then click change address I can see that the changes were in fact saved despite the error message to the contrary. Furthermore once the new address has been added or edit made I can simply click the radio button of the address I want to change to and then click confirm and it changes it without any error message. Any help would be greatly appreciated.

Edited by jsalis

I run a completely customized osC2.2 RC1 shop with mostly custom modifications that replicate the features of many contributions available except in a way that the data is more easily synced with Quickbooks on a continuous basis.

Link to comment
Share on other sites

Hi there,

 

Love the Contribution, but I have a problem with it.

 

The issue is with IE9, when someone enters an e-mail address IE9 freezes and will not proceed. It comes up, after a while, with "(website) is not responding due to a long-running script". I have placed <meta http-equiv="X-UA-Compatible" content="IE=8"/> into my checkout.php to force it to run as IE8, but still same problem.

 

The only other script I am running is for lightbox, and that does not impact the checkout.php. I still deleted it just in case, no effect. I also have tried putting my full address before the ext/jQuery.... in each line. No help either. Any ideas?

 

Maybe it is a IE9 problem, but as it is the one most people use due to Microsofts somewhat insistent update system I really want it to work on my website.

 

Thanks For the help

Steve C

 

 

Did you find a solution Steve? I am having the same issue with IE. Firefox and Chrome work fine.

 

 

I had the same problem with One Page Checkout so, installed the lastest version 1.5, this seemed to have solved the problem, however ...

 

 

No not yet. I am wary about going to 1.5. I tried to install it when I first discovered this contribution but it never worked for me. I assumed it was because I am using a 2.2 MS2 version of oscommerce and not the 2.3 etc. Is that the case anyone? is the 1.5 version of OPC for all versions of oscommerce or not?

 

If I can not get this fixed I will have to try using 1.5 or removing the contrib, which sucks, as it is, in my opinion, the best single page checkout out there.

 

Steve C

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...