Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

One Page Checkout Support


Guest

Recommended Posts

Hi its this setting

 

Dont show shipping and handling address checkbox or ship methods if weight of products = 0

 

Did you use the paypal standar mod that came with OPC?

 

Steve

 

Sorry I had to uninstall OSC its too buggy for my shop. :( Thanks for your help though.

Link to comment
Share on other sites

i´ve got some order errors lately and the problem only appears when a customer fill in his adress and when he click on something else the ajax begin to spin and it setting billig and shipping adress and so on. lets say the customer will se that he forgotten the email address and fill it in, then it wont be registered with the order.

 

So i need to know what file wich rule this functions.

 

More exactly i need to know what code in what file :D

Link to comment
Share on other sites

i´ve got some order errors lately and the problem only appears when a customer fill in his adress and when he click on something else the ajax begin to spin and it setting billig and shipping adress and so on. lets say the customer will se that he forgotten the email address and fill it in, then it wont be registered with the order.

 

So i need to know what file wich rule this functions.

 

More exactly i need to know what code in what file :D

Hi Try this on the demo if so report it as a bug

 

Steve

Link to comment
Share on other sites

i´ve got some order errors lately and the problem only appears when a customer fill in his adress and when he click on something else the ajax begin to spin and it setting billig and shipping adress and so on. lets say the customer will se that he forgotten the email address and fill it in, then it wont be registered with the order.

 

So i need to know what file wich rule this functions.

 

More exactly i need to know what code in what file :D

 

 

I was looking at the same problem when integrating our contrib with OPC (UK Postcode Address Finder) - it seems like on every onBlur event on any of the form fields the full update sequence gets triggered if all address fiels are populated. This is especially noticable in IE.

 

I did a little tweak to checkout.js to check for change in the form data before running the update - if data is unchanged we bail out and don't do any of the ajax-y bits.

 

No guarantee it will help you as I haven't tested extensively, but worth a try.

 

Here is a chunk out of checkout.js, mods were done to functions processBillingAddress, processShippingAddress and setCheckoutAddress.

 

last_processBillingAddress : '',
processBillingAddress: function (skipUpdateTotals){
	var hasError = false;
	var checkoutClass = this;
	$('select[name="billing_country"], input[name="billing_street_address"], input[name="billing_zipcode"], input[name="billing_city"], *[name="billing_state"]', $('#billingAddress')).each(function (){
		if (checkoutClass.fieldErrorCheck($(this), false, true) == true){
			hasError = true;
		}
	});
	if (hasError == true){
		return;
	}

	this.setBillTo();
	if ($('#diffShipping').checked && this.loggedIn != true){

		this.setSendTo(true);
	}else{
		this.setSendTo(false);
	}
	if (this.last_processBillingAddress != $('*', $('#billingAddress')).serialize()) {
		this.last_processBillingAddress = $('*', $('#billingAddress')).serialize();
	} else {
		return;
	}

	if(skipUpdateTotals != true)
	{
		this.updateCartView();
		this.updateFinalProductListing();
		this.updatePaymentMethods(true);
		this.updateShippingMethods(true);
		this.updateOrderTotals();
	}
},
last_processShippingAddress : '',
processShippingAddress: function (skipUpdateTotals){
	var hasError = false;
	var checkoutClass = this;
	$('select[name="shipping_country"], input[name="shipping_street_address"], input[name="shipping_zipcode"], input[name="shipping_city"]', $('#shippingAddress')).each(function (){
		if (checkoutClass.fieldErrorCheck($(this), false, true) == true){
			hasError = true;
		}
	});
	if (hasError == true){
		return;
	}
	if (this.last_processShippingAddress != $('*', $('#shippingAddress')).serialize()) {
		this.last_processShippingAddress = $('*', $('#shippingAddress')).serialize();
	} else {
		return;
	}
	this.setSendTo(true);
	if (this.shippingEnabled == true && skipUpdateTotals != true){
		this.updateShippingMethods(true);
	}
	if(skipUpdateTotals != true)
	{
		this.updateCartView();
		this.updateFinalProductListing();
		this.updatePaymentMethods(true);
		this.updateShippingMethods(true);
		this.updateOrderTotals();
	}
},
last_setBillTo: '',
last_setSendTo: '',
setCheckoutAddress: function (type, useShipping){ 
	var checkoutClass = this;
	var selector = '#' + type + 'Address';
	var sendMsg = 'Setting ' + (type == 'shipping' ? 'Shipping' : 'Billing') + ' Address';
	var errMsg = type + ' address';
	if (type == 'shipping' && useShipping == false){
		selector = '#billingAddress';
		sendMsg = 'Setting Shipping Address';
		errMsg = 'billing address';
	}

	if (selector == '#billingAddress') {
		if (this.last_setBillTo != $('*', $('#billingAddress')).serialize()) {
			this.last_setBillTo = $('*', $('#billingAddress')).serialize();
		} else {
			return;
		}
	} else {
		if (this.last_setSendTo != $('*', $('#shippingAddress')).serialize()) {
			this.last_setSendTo = $('*', $('#shippingAddress')).serialize();
		} else {
			return;
		}
	}

	action = 'setBillTo';
	if (type == 'shipping'){
		action = 'setSendTo';
	}

	this.queueAjaxRequest({
		url: this.pageLinks.checkout,
		beforeSendMsg: sendMsg,
		dataType: 'json',
		data: 'action=' + action + '&' + $('*', $(selector)).serialize(),
		type: 'post',
		success: function (){
		},
		errorMsg: 'There was an error updating your ' + errMsg + ', please inform ' + checkoutClass.storeName + ' about this error.'
	});
},

 

Cheers,

Adam

Link to comment
Share on other sites

I haven't read every page of this thread, but here is my problem:

 

The user must be logged in before using the OPC. No problems there.

 

When the user tries to select their shipping option, the price does not update. I never updates to include the shipping price. I have two shipping modules I use, a flat rate and a pickup option. The flat rate increases as the order hits specified dollar thresholds.

 

I have a feeling it has something to do with AJAX or Javascript, but no proof.

 

When I switch the option Require Login to false, the user then has to enter in their password, and addresses. There is no form validation, i.e. address fields do not have a green checkmarks after they have been completed.

 

Any help would be appreciated.

 

Johan

Link to comment
Share on other sites

This is a great contribution installed the mod and and it works good in IE8, Firefox, Opera and Safari... however in Google Chrome when you click on the "checkout" button you get a pop up box:

 

checkout_error.PNG

 

I am making people login before they can checkout, I tried it the with the other setting and get the same results. And it only happens in Chrome... everything else on the checkout page works fine.

 

Any ideas?

Edited by myancey260
Link to comment
Share on other sites

I haven't read every page of this thread, but here is my problem:

 

The user must be logged in before using the OPC. No problems there.

 

When the user tries to select their shipping option, the price does not update. I never updates to include the shipping price. I have two shipping modules I use, a flat rate and a pickup option. The flat rate increases as the order hits specified dollar thresholds.

 

I have a feeling it has something to do with AJAX or Javascript, but no proof.

 

When I switch the option Require Login to false, the user then has to enter in their password, and addresses. There is no form validation, i.e. address fields do not have a green checkmarks after they have been completed.

 

Any help would be appreciated.

 

Johan

Hi Johan,

 

All i can say is try another browser i have not had that problem

 

Steve

Link to comment
Share on other sites

This is a great contribution installed the mod and and it works good in IE8, Firefox, Opera and Safari... however in Google Chrome when you click on the "checkout" button you get a pop up box:

 

checkout_error.PNG

 

I am making people login before they can checkout, I tried it the with the other setting and get the same results. And it only happens in Chrome... everything else on the checkout page works fine.

 

Any ideas?

Hi

 

try this in catalog/includes/onepage_checkout.php

find

        'customers_newsletter'    => $onepage['customer']['newsletter'],

add after it

	'customers_status'        => '1',

 

Steve

Link to comment
Share on other sites

Hi

 

try this in catalog/includes/onepage_checkout.php

find

        'customers_newsletter'    => $onepage['customer']['newsletter'],

add after it

	'customers_status'        => '1',

 

Steve

 

Thanks Steve, but I am afraid I tried that already (Just to be sure... that file path is catalog/includes/classes/onepage_checkout.php -NOT- catalog/includes/onepage_checkout.php Right?)

 

I saw that suggestion for the status bit on an early post... so I tried it. I just can't seem to diagnose the issue, it only happens in Chrome, everything else is just peachy. I am verifying (for the 4th time) that I have installed everything correctly, but would appreciate any additional ideas you might have.

 

Thanks

 

Michael

Edited by myancey260
Link to comment
Share on other sites

Thanks Steve, but I am afraid I tried that already (Just to be sure... that file path is catalog/includes/classes/onepage_checkout.php -NOT- catalog/includes/onepage_checkout.php Right?)

 

I saw that suggestion for the status bit on an early post... so I tried it. I just can't seem to diagnose the issue, it only happens in Chrome, everything else is just peachy. I am verifying (for the 4th time) that I have installed everything correctly, but would appreciate any additional ideas you might have.

 

Thanks

 

Michael

yep is catalog/includes/classes/onepage_checkout.php my mistake, have you tried to see if their demo does the same thing?

 

maybe its the way chrome handles javascript or needs a minor fix but contact a freelancer if their demo doesnt do same thing

Steve

Edited by steve_s
Link to comment
Share on other sites

Thanks Steve, but I am afraid I tried that already (Just to be sure... that file path is catalog/includes/classes/onepage_checkout.php -NOT- catalog/includes/onepage_checkout.php Right?)

 

I saw that suggestion for the status bit on an early post... so I tried it. I just can't seem to diagnose the issue, it only happens in Chrome, everything else is just peachy. I am verifying (for the 4th time) that I have installed everything correctly, but would appreciate any additional ideas you might have.

 

Thanks

 

Michael

 

I saw this posted earlier in the thread and it fixed the problem for me:

 

 

In checkout.php, find:

 

if (updateTotals == true){

onePage.updateOrderTotals();

}

 

This is around line 453.

 

Add right after:

 

javascript:location.reload(true);

Link to comment
Share on other sites

Could someone please help me modify One Page Checkout to have a required delivery telephone number? I can't quite figure it out. As far as I have it, instead of making one address book entry each for billing and shipping address, it makes two entries for billing address. I'm not sure what is causing this error.

Link to comment
Share on other sites

I have installed contribution and everything in admin displays. I have no errors. One page checkout is enabled. When I go to website to check out I get a blank main checkout page. You can see header, footer, and both side columns. You just do not see anything in the center. Any thoughts anyone?

 

Thanks

Link to comment
Share on other sites

Could someone please help me modify One Page Checkout to have a required delivery telephone number? I can't quite figure it out. As far as I have it, instead of making one address book entry each for billing and shipping address, it makes two entries for billing address. I'm not sure what is causing this error.

Hi This is done in admin>configuration>one page checkout set telephone to required field

 

Steve

Link to comment
Share on other sites

I have installed contribution and everything in admin displays. I have no errors. One page checkout is enabled. When I go to website to check out I get a blank main checkout page. You can see header, footer, and both side columns. You just do not see anything in the center. Any thoughts anyone?

 

Thanks

Hi you have an error of some sort in the content of that page recheck install or look in your error log if you have one

 

Steve

Edited by steve_s
Link to comment
Share on other sites

Hi This is done in admin>configuration>one page checkout set telephone to required field

 

Steve

 

I have billing telephone required set. What I need is a required delivery telephone. My friend's site requires that delivery telephone be entered. He calls the recipient if the first delivery attempt fails.

Link to comment
Share on other sites

Same thing in IE 8 :(

 

I guess I will just have to troubleshoot this a little more.

 

Johan

 

Eureka! It seems as though in my header.php I have the following line:

 

<!-- BOF Cycle Products -->

<?php

echo '<script language="javascript" src="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . DIR_WS_INCLUDES . 'javascript/jquery.js" type="text/javascript"></script>' . "\n";

echo '<script language="javascript" src="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . DIR_WS_INCLUDES . 'javascript/jquery.cycle.js" type="text/javascript"></script>' . "\n";

 

?>

<!-- EOF Cycle Products -->

 

When I remove those calls for the jquery.cycle.js the OPC works. Now I have to make my way over to support for Cycle Products, I will post an update once I get this resolved.

 

Johan

 

Update:

 

I just removed those calls from header.php and added them to each page that has a Cycle Products Box, yay Lightbox and OPC works with one stroke of the keyboard!

Edited by johanv
Link to comment
Share on other sites

I have billing telephone required set. What I need is a required delivery telephone. My friend's site requires that delivery telephone be entered. He calls the recipient if the first delivery attempt fails.

Hi

 

Add this code to where you want the telephone to appear in the 2 shipping files in includes/checkout/ folder

 

<tr>

 <td class="main"><?php echo ENTRY_TELEPHONE; ?></td>

 <td>

 <?php

if(ONEPAGE_TELEPHONE == 'True')

  	echo tep_draw_input_field('billing_telephone', (isset($customerAddress) ? $customerAddress['telephone'] : ''), 'class="required" style="width:80%;float:left;"'); 

  else

	  echo tep_draw_input_field('billing_telephone', (isset($customerAddress) ? $customerAddress['telephone'] : ''), 'style="width:80%;float:left;"'); 



  ?></td>

</tr>

 

might well need to remove it from billing address files in includes/checkout folder too

 

but table only holds customers telephone number so cant have both

 

Steve

Link to comment
Share on other sites

Hi steve,

 

Thanks for this great contribution,

 

I use Quantum Payment gateway, but it seems need a little modifictions to work with one page checkout. it shows "There was an error setting payment method" when select quantum payment.

 

below is the quantum payment gateway code,

 

<?php
/*
$Id: quantumqgwdbe.php,v 1.40 2007/06/13 18:23:14 dgw_ Exp $

Released under the GNU General Public License

quantumqgwdbe.php  was developed for QuantumGateway

https://www.quantumgateway.com

by

Jerry Brown
Project Development
CDGcommerce
*/

class quantumqgwdbe {
var $code, $title, $description, $enabled;

// class constructor
function quantumqgwdbe () {
global $order;
	$this->code = 'quantumqgwdbe';
	$this->title = MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_TITLE;
	$this->description = MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_DESCRIPTION;
	$this->enabled = ((MODULE_PAYMENT_QUANTUMQGWDBE_STATUS == 'True') ?
	true : false);
	$this->sort_order = MODULE_PAYMENT_QUANTUMQGWDBE_SORT_ORDER;



     if ((int)MODULE_PAYMENT_QUANTUMQGWDBE_ORDER_STATUS_ID > 0) {
       $this->order_status = MODULE_PAYMENT_QUANTUMQGWDBE_ORDER_STATUS_ID;
     }
	#################################################

	#################################################
	$this->quantum_gets_cc = ((MODULE_PAYMENT_QUANTUMQGWDBE_CC == 'True') ? true : false);
	$this->uses_cvv = ((MODULE_PAYMENT_QUANTUMQGWDBE_USESCVV == 'Y') ? true : false);
	$this->logo_url = MODULE_PAYMENT_QUANTUMQGWDBE_LOGO_URL;
	$this->bck_color = MODULE_PAYMENT_QUANTUMQGWDBE_BCK_COLOR;
	$this->text_color = MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_COLOR;
	$this->form_action_url = 'https://secure.quantumgateway.com/cgi/qgwdbe.php';
	$this->cvvtype[] = array('id' => '2', 'text' => 'CVV on card is unreadable');
	$this->cvvtype[] = array('id' => '9', 'text' => 'Card does not have CVV imprint');

	if (is_object($order)) $this->update_status();
}

  function update_status() {
     global $order;


    }



// class methods
function javascript_validation() {

	// if quatnumgateway is collecting the CC#, then CreLoaded does not
	// allow the user to enter CC#, therefore we do not need to validate it

	if (!$this->quantum_gets_cc)
	{
		$js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
		'    var cc_owner = document.checkout_payment.quatnumgateway_cc_owner.value;' . "\n" .
		'    var cc_number = document.checkout_payment.quantumqgwdbe_cc_number.value;' . "\n" .
		'    if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" .
		'      error_message = error_message + "' . MODULE_PAYMENT_QUANTUMQGWDBE_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_QUANTUMQGWDBE_TEXT_JS_CC_NUMBER . '";' . "\n" .
		'      error = 1;' . "\n" .
		'    }' . "\n" .
		'  }' . "\n";
	}
	else
	{
		$js = '';
	}

	return $js;
}

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)));
	}

	// Depending on whether CreLoaded is collecting the CC# or not.  If
	// CreLoaded is collecting then we must allow the user to enter it,
	// here we output the form fields to collect the cc#

	if (!$this->quantum_gets_cc)
	{
		$selection = array('id' => $this->code,
		'module' => $this->title,
		'fields' => array(
		array('title' => MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_CREDIT_CARD_OWNER,
		'field' => tep_draw_input_field('quantumqgwdbe_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
		array('title' => MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_CREDIT_CARD_NUMBER,
		'field' => tep_draw_input_field('quantumqgwdbe_cc_number')),
		array('title' => MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_CREDIT_CARD_EXPIRES,
		'field' => tep_draw_pull_down_menu('quantumqgwdbe_cc_expires_month', $expires_month) . ' ' . tep_draw_pull_down_menu('quantumqgwdbe_cc_expires_year', $expires_year))			
		));
		if ($this->uses_cvv) {
			array_push($selection['fields'], array('title' => 'CVV number ' . ' ' .'<a href="cvv.html" target="_blank">' . '<u><i>' . '(What is it?)' . '</i></u></a>',
		'field' => tep_draw_input_field('quantumqgwdbe_cvv','',"SIZE=4, MAXLENGTH=4")),
			array('title' => MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_NOT_CVV,
			'field' => tep_draw_checkbox_field('quantumqgwdbe_notcvv', '1')),
			array('title' => MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_REASON_NOT_CVV,
			'field' => tep_draw_pull_down_menu('quantumqgwdbe_cvvtype', $this->cvvtype, '2'))
			);
		}
	}
	else
	{
		$selection = array('id' => $this->code,
		'module' => $this->title,
		'fields' => array(array('title' => 'Continue',
		'field' => tep_draw_hidden_field('quantumqgwdbe_cc_owner', ''))));
	}

	return $selection;
}

function pre_confirmation_check() {
	global $_REQUEST;

	// We don't confirm if CreLoaded is not collecting the CC#

	if (!$this->quantum_gets_cc)
	{
	include(DIR_WS_CLASSES . 'cc_validation.php');

	$cc_validation = new cc_validation();
	$result = $cc_validation->validate($_REQUEST['quantumqgwdbe_cc_number'], $_REQUEST['quantumqgwdbe_cc_expires_month'], $_REQUEST['quantumqgwdbe_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;
	$result = true;
	break;
	}

	if ( ($result == false) || ($result < 1) ) {
	$payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&quantumqgwdbe_cc_owner=' . urlencode($_REQUEST['quantumqgwdbe_cc_owner']) . '&quantumqgwdbe_cc_expires_month=' . $_REQUEST['quantumqgwdbe_cc_expires_month'] . '&quantumqgwdbe_cc_expires_year=' . $_REQUEST['quantumqgwdbe_cc_expires_year'];

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

	$this->cc_card_type = $cc_validation->cc_type;
	$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;
	$x_Card_Code = $_REQUEST['quantumqgwdbe_cvv'];
	}
}

function confirmation() {
	global $_REQUEST;

	// don't confirm if CreLoaded is not collecting the CC#

	if (!$this->quantum_gets_cc)
	{
		$x_Card_Code=$_REQUEST['quantumqgwdbe_cvv'];
		$confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
		'fields' => array(
		array('title' => 'CVV number',
		'field' => $_REQUEST['quantumqgwdbe_cvv']),
		array('title' => MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_CREDIT_CARD_OWNER,
		'field' => $_REQUEST['quantumqgwdbe_cc_owner']),
		array('title' => MODULE_PAYMENT_QUANTUMQGWDBE_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' => MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_CREDIT_CARD_EXPIRES,
		'field' => strftime('%B, %Y', mktime(0,0,0,$_REQUEST['quantumqgwdbe_cc_expires_month'], 1, '20' . $_REQUEST['quantumqgwdbe_cc_expires_year'])))));
	}
	else
	{
		$confirmation = '';
	}

	return $confirmation;
}

function process_button() {
	global $_REQUEST, $order, $customer_id;

	$process_button_string =
	tep_draw_hidden_field ('gwlogin',
	MODULE_PAYMENT_QUANTUMQGWDBE_LOGIN);
	//tep_draw_hidden_field ('Redirect', '0');

	// if CreLoaded collected the CC# then send it on to eProc

	if (!$this->quantum_gets_cc)
	{
		if ($this->uses_cvv) 
		{
			if ((isset($_REQUEST['quantumqgwdbe_notcvv'])) && ($_REQUEST['quantumqgwdbe_notcvv'] == "1")) {
				if (($_REQUEST['quantumqgwdbe_cvvtype'] != "2") && ($_REQUEST['quantumqgwdbe_cvvtype'] != "9")) 
				{
					$process_button_string .= tep_draw_hidden_field('CVV2', $_REQUEST['quantumqgwdbe_cvv']) .
					tep_draw_hidden_field('CVVtype', '1');
				} 
				else 
				{
					$process_button_string .= tep_draw_hidden_field('CVVtype', $_REQUEST['quantumqgwdbe_cvvtype']);
				}
			} 
			else 
			{
				$process_button_string .= tep_draw_hidden_field('CVVtype', '1') . 
				tep_draw_hidden_field('CVV2', $_REQUEST['quantumqgwdbe_cvv']);	
			}
		} 
		else 
		{
			$process_button_string .= tep_draw_hidden_field('CVVtype', '0'); 
		}					
		$process_button_string .= tep_draw_hidden_field ('ccnum', $this->cc_card_number) .
		tep_draw_hidden_field('ccmo', $this->cc_expiry_month).
		tep_draw_hidden_field('ccyr', substr($this->cc_expiry_year, -2));
	}
	$process_button_string .= tep_draw_hidden_field('amount', number_format($order->info['total'],2,".","")) .	
	tep_draw_hidden_field('ID',  tep_session_id ()) .
	tep_draw_hidden_field('override_email_customer', ((MODULE_PAYMENT_QUANTUMQGWDBE_EMAIL_CUSTOMER == 'True') ? 'Y': 'N'));
	if (MODULE_PAYMENT_QUANTUMQGWDBE_TXNKEY2 == "Y") {
		$process_button_string .= tep_draw_hidden_field ('RestrictKey', MODULE_PAYMENT_QUANTUMQGWDBE_TXNKEY);
	}
	$process_button_string .= tep_draw_hidden_field('MAXMIND', ((MODULE_PAYMENT_QUANTUMQGWDBE_MAXMIND == 'Y') ? 'Y': 'N')) .
	tep_draw_hidden_field ('company_logo', MODULE_PAYMENT_QUANTUMQGWDBE_LOGO_URL) .
	tep_draw_hidden_field ('bg_color', MODULE_PAYMENT_QUANTUMQGWDBE_BCK_COLOR) .
	tep_draw_hidden_field ('txt_color', MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_COLOR) .
	tep_draw_hidden_field('FNAME', $order->billing['firstname']) .
	tep_draw_hidden_field('LNAME', $order->billing['lastname']) .
	tep_draw_hidden_field('BADDR1', $order->billing['street_address']) .
	tep_draw_hidden_field('BCITY', $order->billing['city']) .
	tep_draw_hidden_field('BSTATE', $order->billing['state']) .
	tep_draw_hidden_field('BZIP1', $order->billing['postcode']) .
	tep_draw_hidden_field('BCOUNTRY', $order->billing['country']['title']) .
	tep_draw_hidden_field('PHONE', $order->customer['telephone']) .
	tep_draw_hidden_field('BCUST_EMAIL', $order->customer['email_address']) .
	tep_draw_hidden_field('returning_visit', 'N') .
	tep_draw_hidden_field('ResponseMethod', 'GET') .

	tep_draw_hidden_field('post_return_url_approved', tep_href_link(FILENAME_CHECKOUT_PROCESS, '','SSL', true)) .
	tep_draw_hidden_field('post_return_url_declined',  tep_href_link(FILENAME_CHECKOUT_PROCESS, 'payment_error=' . $this->code . '&quantumqgwdbe_cc_owner=' . urlencode($_REQUEST['quantumqgwdbe_cc_owner']), 'SSL', true));



	// now take care of some cosmetic issues

	$process_button_string .= tep_draw_hidden_field(tep_session_name(),tep_session_id());
	return $process_button_string;
}



function before_process() {
	global $messageStack, $insert_id, $_REQUEST;
	$auth_response = $_REQUEST['auth_response'];
	$id = $_REQUEST['ID'];
	$session_name = tep_session_name ();
	$approved = (($_REQUEST['trans_result'] == "APPROVED") ? "1" : "0");
	if ($approved == "0") 
	{
		$comments = $_REQUEST['decline_reason'];
		// alert to customer:
		$payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($comments);
		//$messageStack->tep_session_register('checkout_payment', MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_ERROR_MESSAGE, 'caution');
		tep_db_query("UPDATE " . TABLE_ORDERS_STATUS_HISTORY . " SET comments= 'Credit Card payment.  " . $comments . " " . $this->cc_card_type . " AUTH: " . $_REQUEST['authCode'] . ". TransID: " . $_REQUEST['transID'] . ".', date_added=now() WHERE orders_id = '" . (int)$insert_id . "'");
	tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));

	}
}

function after_process() {
	return false;
}

function get_error() {
	global $_GET;
	$error = array('title' => MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_ERROR,
	'error' => stripslashes(urldecode($_GET['error'])));
	return $error;
}

function check() {
	if (!isset($this->_check)) {
		$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_QUANTUMQGWDBE_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 QuantumGateway Module', 'MODULE_PAYMENT_QUANTUMQGWDBE_STATUS', 'True', 'Do you want to accept QuantumGateway 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 ('Login Username', 'MODULE_PAYMENT_QUANTUMQGWDBE_LOGIN', 'testing', 'The login username used for the QuantumGateway service', '6', '1', now())");
	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 QuantumGateway To Collect CC#', 'MODULE_PAYMENT_QUANTUMQGWDBE_CC', 'False', 'Do you want QuantumGateway to Collect the Credit Card Number??', '6', '2', '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, set_function, date_added) values ('Customer Notifications', 'MODULE_PAYMENT_QUANTUMQGWDBE_EMAIL_CUSTOMER', 'False', 'Should Quatnumgateway e-mail a receipt to the customer?', '6', '3', '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, set_function, date_added) values ('Restrict Key', 'MODULE_PAYMENT_QUANTUMQGWDBE_TXNKEY2', 'N', 'Enable Restriction Key?', '6', '4', 'tep_cfg_select_option(array(\'Y\', \'N\'), ', now())");
	tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Restriction Key', 'MODULE_PAYMENT_QUANTUMQGWDBE_TXNKEY', '', 'Restriction Key used for restricting processing without key.  Note: You must have this enabled in your Quantumgateway Processing Config.', '6', '5', now())");  
	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 ('Maxmind Fraud Control', 'MODULE_PAYMENT_QUANTUMQGWDBE_MAXMIND', 'Y', 'Enable?', '6', '6', 'tep_cfg_select_option(array(\'Y\', \'N\'), ', now())");
	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 ('Capture CVV2', 'MODULE_PAYMENT_QUANTUMQGWDBE_USESCVV', 'Y', 'Does user must type CVV code?.', '6', '7','tep_cfg_select_option(array(\'Y\', \'N\'), ', now())");
	tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('URL for Store Logo', 'MODULE_PAYMENT_QUANTUMQGWDBE_LOGO_URL', '', 'The URL to a logo to be used by eProcessing to display during transactions', '6', '8', now())");
	tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Background Color', 'MODULE_PAYMENT_QUANTUMQGWDBE_BCK_COLOR', '#FFFFFF', 'The Background Color in Hex format:', '6', '9', now())");
	tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Text Color', 'MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_COLOR', '#000000', 'The Color of the Text in Hex format:', '6', '10', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_QUANTUMQGWDBE_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '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_QUANTUMQGWDBE_STATUS', 
	'MODULE_PAYMENT_QUANTUMQGWDBE_LOGIN',
	'MODULE_PAYMENT_QUANTUMQGWDBE_CC',
	'MODULE_PAYMENT_QUANTUMQGWDBE_TXNKEY2',
	'MODULE_PAYMENT_QUANTUMQGWDBE_TXNKEY',
	'MODULE_PAYMENT_QUANTUMQGWDBE_EMAIL_CUSTOMER',
	'MODULE_PAYMENT_QUANTUMQGWDBE_LOGO_URL',
	'MODULE_PAYMENT_QUANTUMQGWDBE_BCK_COLOR',
	'MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_COLOR',
	'MODULE_PAYMENT_QUANTUMQGWDBE_MAXMIND',
	'MODULE_PAYMENT_QUANTUMQGWDBE_USESCVV',
	'MODULE_PAYMENT_QUANTUMQGWDBE_SORT_ORDER'
	);
}
}
?>

 

 

Thanks

 

 

Sean

Link to comment
Share on other sites

After I reinstalled one page checkout, the "There was an error setting payment method" error is gone,

but it still doesn;t work, it displays like this:

 

cc.jpg

 

and I narrow down below code need modifictions,

function confirmation() {
	global $_REQUEST;

	// don't confirm if CreLoaded is not collecting the CC#

	if (!$this->quantum_gets_cc)
	{
		$x_Card_Code=$_REQUEST['quantumqgwdbe_cvv'];
		$confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
		'fields' => array(
		array('title' => 'CVV number',
		'field' => $_REQUEST['quantumqgwdbe_cvv']),
		array('title' => MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_CREDIT_CARD_OWNER,
		'field' => $_REQUEST['quantumqgwdbe_cc_owner']),
		array('title' => MODULE_PAYMENT_QUANTUMQGWDBE_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' => MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_CREDIT_CARD_EXPIRES,
		'field' => strftime('%B, %Y', mktime(0,0,0,$_REQUEST['quantumqgwdbe_cc_expires_month'], 1, '20' . $_REQUEST['quantumqgwdbe_cc_expires_year'])))));
	}
	else
	{
		$confirmation = '';
	}

	return $confirmation;
}

Link to comment
Share on other sites

After I reinstalled one page checkout, the "There was an error setting payment method" error is gone,

but it still doesn;t work, it displays like this:

 

cc.jpg

 

and I narrow down below code need modifictions,

function confirmation() {
	global $_REQUEST;

	// don't confirm if CreLoaded is not collecting the CC#

	if (!$this->quantum_gets_cc)
	{
		$x_Card_Code=$_REQUEST['quantumqgwdbe_cvv'];
		$confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
		'fields' => array(
		array('title' => 'CVV number',
		'field' => $_REQUEST['quantumqgwdbe_cvv']),
		array('title' => MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_CREDIT_CARD_OWNER,
		'field' => $_REQUEST['quantumqgwdbe_cc_owner']),
		array('title' => MODULE_PAYMENT_QUANTUMQGWDBE_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' => MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_CREDIT_CARD_EXPIRES,
		'field' => strftime('%B, %Y', mktime(0,0,0,$_REQUEST['quantumqgwdbe_cc_expires_month'], 1, '20' . $_REQUEST['quantumqgwdbe_cc_expires_year'])))));
	}
	else
	{
		$confirmation = '';
	}

	return $confirmation;
}

Hi

 

to get this to work you need to copy and paste code from function selection to function process leaving the return $confirmation at the end

 

Steve

Link to comment
Share on other sites

Hi you have an error of some sort in the content of that page recheck install or look in your error log if you have one

 

Steve

 

 

Steve, thanks for the reply. I went through install and double checked everything but no luck. I don't know if this will help but I noticed the web page dispays but it said with errors on page Well here they are:

 

Webpage error details

 

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Zune 4.0; .NET4.0C)

Timestamp: Sat, 6 Nov 2010 00:58:48 UTC

 

 

Message: 'jQuery' is undefined

Line: 14

Char: 1

Code: 0

URI: http://localhost/xam...jQuery.ajaxq.js

 

 

Message: 'jQuery' is undefined

Line: 1

Char: 1

Code: 0

URI: http://localhost/xam...ry.pstrength.js

 

 

Message: 'jQuery' is undefined

Line: 10

Char: 1

Code: 0

URI: http://localhost/xam...ry/jQuery.ui.js

 

 

Message: '$' is undefined

Line: 1

Char: 1

Code: 0

URI: http://localhost/xam...out/checkout.js

 

 

Message: 'onePage' is null or not an object

Line: 29

Char: 3

Code: 0

URI: http://localhost/xam...4ckls4ebk40ruf3

 

Does this tell me why?

Thanks,

Capt Tony

Link to comment
Share on other sites

Steve, thanks for the reply. I went through install and double checked everything but no luck. I don't know if this will help but I noticed the web page dispays but it said with errors on page Well here they are:

 

Webpage error details

 

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Zune 4.0; .NET4.0C)

Timestamp: Sat, 6 Nov 2010 00:58:48 UTC

 

 

Message: 'jQuery' is undefined

Line: 14

Char: 1

Code: 0

URI: http://localhost/xam...jQuery.ajaxq.js

 

 

Message: 'jQuery' is undefined

Line: 1

Char: 1

Code: 0

URI: http://localhost/xam...ry.pstrength.js

 

 

Message: 'jQuery' is undefined

Line: 10

Char: 1

Code: 0

URI: http://localhost/xam...ry/jQuery.ui.js

 

 

Message: '$' is undefined

Line: 1

Char: 1

Code: 0

URI: http://localhost/xam...out/checkout.js

 

 

Message: 'onePage' is null or not an object

Line: 29

Char: 3

Code: 0

URI: http://localhost/xam...4ckls4ebk40ruf3

 

Does this tell me why?

Thanks,

Capt Tony

Hi Capt Tony,

 

if your using IE8 try another browser and see if all is ok

 

Steve

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...