Jump to content
Sign in to follow this  
ski2bbad

GOOGLE CHECKOUT IPN

Recommended Posts

Settings in sandbox checkout are same as settings on website config.

 

One question though:

should

Shopping trolley post security

be set to yes? (i.e. google should reject non digitally signed xml shopping trolleys?

Share this post


Link to post
Share on other sites

The log file seems to now be recording, however, I have input the sandbox details into the payment module, but the log file records details of the actual checkout merchantid and key?? Is that normal?

 

This is strange and no it is not recorded in my logs.

 

Sounds more likely that there is still something from the old contribution hanging around?

Share this post


Link to post
Share on other sites
Settings in sandbox checkout are same as settings on website config.

 

One question though:

should

Shopping trolley post security

be set to yes? (i.e. google should reject non digitally signed xml shopping trolleys?

 

 

YES

Share this post


Link to post
Share on other sites
<?php

/*

$Id: checkout_process.php,v 1.128 2003/05/28 18:00:29 hpdl Exp $

*/

code]

 

Hello,

 

Not positive, but I'm thinking that the google_checkout_process.php file should work for you without any modifications.

 

And, if some small modifications should be needed, it would have to do with information being passsed, or not. It should have nothing to do with your not getting the Google splash page at all.

 

I am assuming that you have already tried using the google_checkout_process.php without any modifications.

 

I am pretty sure you can rule out the google_checkout_process.php being part of this present problem, for now.

 

I don't know anything about cgi php, so haven't a clue if this affects anything.

 

Something is amiss. It's not possible for you to be getting information passed back concerning your Google checkout ID & Key, if they're not inserted anywhere.

 

I don't mean to be redundant, but you do have separate checkout & sandbox accounts, with separate, different IDs & Keys - and you do have the sandbox ID & Key inserted into the IPN payment module, with sandbox selected?

 

Again, fishing: Do you have another Google Checkout contribution installed and active? Even if you do it shouldn't matter if everything's setup correctly, but everything is not setup correctly for sure, if you're getting back Google checkout info when you have Google sandbox, and sandbox ID & Key inserted.

 

Regards,

 

CT

Share this post


Link to post
Share on other sites

A material difference in all my checkout_*.php files is that //ICW CREDIT CLASS Gift Voucher System code is there? I assume gift voucher is different to the coupon so can I remove the credit class gift voucher?

Share this post


Link to post
Share on other sites
A material difference in all my checkout_*.php files is that //ICW CREDIT CLASS Gift Voucher System code is there? I assume gift voucher is different to the coupon so can I remove the credit class gift voucher?

 

 

Teamwhatever.

 

I agree with CT's post AND I don't think that the difference mentioned above is the reason for your problems. AGAIN . . . . was your site fully operational prior to GC IPN install? (please respond to post #25 above, that would give us more info to be able to help you out)

 

ski

Edited by ski2bbad

Share this post


Link to post
Share on other sites

What is strange is that this is a bit like the Paypal IPN I have installed and really operates quite separate from the rest of your files........

 

It is such a small install that there seems little to go wrong. Did you change the API callback address correctly - only I still had mine set for the old contribution at first?

Share this post


Link to post
Share on other sites
A material difference in all my checkout_*.php files is that //ICW CREDIT CLASS Gift Voucher System code is there? I assume gift voucher is different to the coupon so can I remove the credit class gift voucher?

 

Hello,

 

I believe the contribution is actually setup to use the ICW CREDIT CLASS Gift Voucher System. As well, I use it, and it works fine with the exception that's noted in the readme.txt.

 

If you have any standard payment module setup (example: check/money order), and it works, you can likely rule out the checkout_confirmation.php file as being a problem.

 

Regards,

 

CT

Share this post


Link to post
Share on other sites
After installing this contribution, all goes well except that at the order confirmation screen, clicking through to google_checkout_process, all I get is a blank screen.

 

The order is recorded (visible in the admin section) but as I said the google_checkout_process.php page is just blank, and does not redirect to google.

 

Any help gratefully received.

 

Are you using STS? I just installed this on a site using STS and got the same problem.

 

Here is how to fix it:

 

Open includes/sts_display_output.php:

Find

|| strpos($scriptname, "info_shopping_cart") !== false

 

Add after (on the same line):

|| strpos($scriptname, "google_checkout_process") !== false

 

This will stop STS from trying to process the google checkout page (which was resulting in the blank page)

Share this post


Link to post
Share on other sites

Hi all,

 

Ski, re site, it was and still is fully functional. It is the GC IPN that does not work. When both payment methods are activated, you can select either payment. Protx (still) works fine, but GC (still) does not.

 

I had installed the other Googlecheckout contribution. I think it is entirely plausible that my problem lies there.

 

Can confirm that have separate sandbox and checkout, and have inserted the correct id and keys and selected sandbox. Also can confirm have ssl.

 

Have looked through my entire mysql database, and no mention of the checkout (as opposed to sandbox) id or key. Strange.

 

Will try to restore to pre other google checkout state (with config settings restored to previous state) and try not to break the whole thing! lol.

 

Will report back once I have done that and see what if that makes any difference.

 

It just won't go to the google checkout website. It does however, create an order (which is visible from admin). google_checkout_process.php is just a blank screen (with template of my site) once it goes there.

 

madcrazygirl, yep changed the url to the correct one. I agree, it seems so little to go wrong, so feel pretty confident in being able to find a fix. hmmm.

Share this post


Link to post
Share on other sites

Hello.

 

I have been working on a TAX issue on this module for a few days now and I was wondering if anyone has had a similar issue?

 

My problem is that I have to charge taxes on both goods and shipping charges when a purchase is made in my home State; for example:

 

goods $29.99

shipping $8.87

State TAX (8.6%) $3.34

 

Store Total Charges $42.20

----------------------

 

However GC IPN totals DOES NOT match my checkout page:

 

goods $29.99

shipping $8.87

State TAX (8.6%) $3.67 . . . . where [(29.99 * 0.9 = 2.6991) + (8.87 * 0.11 = 0.9757) for a TOTAL of $3.67]

 

GC Total Charges $42.53

 

I have narrowed down to the catalog/includes/modules/payment/google.php file but I have not been able to successfully get it to work. I have also noticed that the tax rate in the goods and the tax rate in the shipping are different (please see bolded section of XML below).

 

<?xml version="1.0" encoding="UTF-8"?>

<checkout-shopping-cart xmlns="http://checkout.google.com/schema/2">

<shopping-cart>

<items>

<item>

<item-name>Fire Down Below</item-name>

<item-description>Fire Down Below</item-description>

<unit-price currency="USD">29.99</unit-price>

<rate>0.09</rate>

<quantity>1</quantity>

<tax-table-selector>tax-11</tax-table-selector>

</item>

</items>

<merchant-private-data>

<osc-orders-id>59</osc-orders-id>

</merchant-private-data>

</shopping-cart>

<checkout-flow-support>

<merchant-checkout-flow-support>

<continue-shopping-url>http://www.mystore.com/store/checkout_success.php?order_id=59</continue-shopping-url>

<tax-tables>

<default-tax-table>

<tax-rules>

<default-tax-rule>

<shipping-taxed>true</shipping-taxed>

<rate>0.11</rate>

<tax-area>

<us-country-area country-area="FULL_50_STATES"/>

</tax-area>

</default-tax-rule>

</tax-rules>

</default-tax-table>

<alternate-tax-tables>

<alternate-tax-table name="tax-11" standalone="false">

<alternate-tax-rules>

<alternate-tax-rule>

<rate>0.09</rate>

<tax-area>

<us-country-area country-area="FULL_50_STATES"/>

</tax-area>

</alternate-tax-rule>

</alternate-tax-rules>

</alternate-tax-table>

</alternate-tax-tables>

</tax-tables>

<shipping-methods>

<flat-rate-shipping name="United Parcel Service (XML) (1 pkg x 8 lbs total) (UPS Ground, 2007-05-24)">

<price currency="USD">8.87</price>

</flat-rate-shipping>

</shipping-methods>

</merchant-checkout-flow-support>

</checkout-flow-support>

</checkout-shopping-cart>

. . . .etc . . .

 

I also don't know what or where the tax-11 (in particular the #11) is coming from. I found the line in the google.php file, but I'm not sure on its purpose.

 

	reset($order->products);
foreach ($order->products as $key => $value) {
	$tax = number_format($value['tax'] / 100, 2, '.', '');
	$data .= '	<item>' . $eol;
	$data .= '		<item-name>' . htmlentities($value['name']) . '</item-name>' . $eol;
	$data .= '		<item-description>' . htmlentities($value['name']) . '</item-description>' . $eol;
	$data .= '		<unit-price currency="' . $order->info['currency'] . '">' . $value['final_price'] . '</unit-price>' . $eol;
	$data .= '		<quantity>' . $value['qty'] . '</quantity>' . $eol;
	[b]$data .= '		<tax-table-selector>tax-' . $value['id'] . '</tax-table-selector>' . $eol;[/b]
	$data .= '	</item>' . $eol;
	$alternate_tax .= '	<alternate-tax-table name="tax-' . $value['id'] . '" standalone="false">' . $eol;

$alternate_tax .= '		<alternate-tax-rules>' . $eol;

$alternate_tax .= '			<alternate-tax-rule>' . $eol;
$alternate_tax .= '				<rate>' . $tax . '</rate>' . $eol;

$alternate_tax .= '				<tax-area>' . $eol;

$alternate_tax .= '					<us-country-area country-area="FULL_50_STATES"/>' . $eol;

$alternate_tax .= '				</tax-area>' . $eol;

$alternate_tax .= '			</alternate-tax-rule>' . $eol;

$alternate_tax .= '		</alternate-tax-rules>' . $eol;

$alternate_tax .= '	</alternate-tax-table>' . $eol;		
}
if (MODULE_ORDER_TOTAL_INSTALLED && is_array($order_total_modules->modules)) {
	reset($order_total_modules->modules);
	while (list(, $value) = each($order_total_modules->modules)) {
	  $class = substr($value, 0, strrpos($value, '.'));
	if ($GLOBALS[$class]->enabled) {
		$size = sizeof($GLOBALS[$class]->output);
	  for ($i=0; $i<$size; $i++) {
		  if ($value == 'ot_coupon.php' || $value == 'ot_gv.php') {
			  $discount_title = htmlentities(substr($GLOBALS[$class]->output[$i]['title'], 0, strlen($GLOBALS[$class]->output[$i]['title']) - 1));
			  $discoun_value = number_format($GLOBALS[$class]->output[$i]['value'], 2, '.', '');
$data .= '	<item>' . $eol;
$data .= '		<item-name>' . $discount_title . '</item-name>' . $eol;
$data .= '		<item-description>' . $discount_title . '</item-description>' . $eol;
$data .= '		<unit-price currency="' . $order->info['currency'] . '">-' . $discoun_value . '</unit-price>' . $eol;
$data .= '		<quantity>1</quantity>' . $eol;
$data .= '	</item>' . $eol;
				  }
	  }
	}
  }		
}

$data .= '			</items>' . $eol;
$data .= '			<merchant-private-data>' . $eol;
$data .= '			<osc-orders-id>' . $orders_id . '</osc-orders-id>' . $eol;
$data .= '			</merchant-private-data>' . $eol;

$data .= '		</shopping-cart>' . $eol;

$data .= '		<checkout-flow-support>' . $eol;

$data .= '			<merchant-checkout-flow-support>' . $eol;

$data .= '				<continue-shopping-url>' . htmlentities(tep_href_link(FILENAME_CHECKOUT_SUCCESS, 'order_id=' . $orders_id)) . '</continue-shopping-url>' . $eol;

$data .= '				<tax-tables>' . $eol;
$data .= '					<default-tax-table>' . $eol;
$data .= '						<tax-rules>' . $eol;
$data .= '							<default-tax-rule>' . $eol;
$data .= '								<shipping-taxed>true</shipping-taxed>' . $eol;
$data .= '								<rate>' . $default_tax_rate . '</rate>' . $eol;
$data .= '								<tax-area>' . $eol;

$data .= '									<us-country-area country-area="FULL_50_STATES"/>' . $eol;

$data .= '								</tax-area>' . $eol;
$data .= '							</default-tax-rule>' . $eol;
$data .= '						</tax-rules>' . $eol;
$data .= '					</default-tax-table>' . $eol;
$data .= '					<alternate-tax-tables>' . $eol;
$data .= $alternate_tax;
$data .= '					</alternate-tax-tables>' . $eol;

$data .= '				</tax-tables>' . $eol;
if (tep_not_null($order->info['shipping_method'])) {

$data .= '		<shipping-methods>' . $eol;

$data .= '			<flat-rate-shipping name="' . htmlentities($order->info['shipping_method']) . '">' . $eol;

$data .= '				<price currency="' . $order->info['currency'] . '">' . number_format($order->info['shipping_cost'], 2, '.', '') . '</price>' . $eol;

$data .= '			</flat-rate-shipping>' . $eol;

$data .= '		</shipping-methods>' . $eol;
}
$data .= '		</merchant-checkout-flow-support>' . $eol;
$data .= '	</checkout-flow-support>' . $eol;

$data .= '	</checkout-shopping-cart>' . $eol;

	return $data;
 }

 

So, to summarize my winded post (sorry), how can I make the rates change from 0.09 to 0.0860 and from 0.11 also to 0.0860? (My taxes are correct in the Admin side!) OR in other words, is there a way that I can change the number of characters (pad in the GC file) allowed so that the rate would show as X.XXXX instead of the X.XX ( which I think might be part of the problem as 8.6% becomes 0.09 with rounding instead of 0.0860)? That would at least get me going in the right direction. :rolleyes:

 

Anyway, if someone would be kind enough to shed some light on how I can solve this so that I can get the taxes figured out correctly, I'd appreciate it very much.

 

Regards,

 

ski

Share this post


Link to post
Share on other sites

hi all,

 

 

I have installed this module and everything seems to work fine apart from one thing TAX i.e. the tax doesn't seem to be carried to google checkout. On google checkout page (i.e. sandbox) it displayed product with price, delivery charge and total, underneath total there is a text saying "(includes VAT £0.00)". In UK, VAT is 17.50% which is set up correctly and work fine with any other payment module but for whatever reason, this would not work for me. can you guys help? Do i need to edit anything else in catalog/includes/modules/payment/google.php apart from one below

 

$data .= '								<shipping-taxed>false</shipping-taxed>' . $eol;

 

please help

 

thank you

 

mangotrees

Share this post


Link to post
Share on other sites

 

Hello all.

 

Regarding my previous post above . . . . I have solved the problem :thumbsup:

 

I decided to print out the google.php file so that I could take a closer look at it, other than just looking at the computer screen, and that did it!

 

Ok, for those of you needing to figure out taxes (including or excluding shipping taxes) or simply trying to get GC to show the TAX correctly here is how you can fix the tax problem:

 

on catalog/includes/modules/payment/google.php:

 

FIND:
		  $tax = number_format($value['tax'] / 100, 2, '.', '');

CHANGE TO:
		  $tax = number_format($value['tax'] / 100, 4, '.', '');

 

If shipping charges are taxable where you reside you also need to change (same file catalog/includes/modules/payment/google.php)

 

FIND:
							  $data .= '				<shipping-taxed>false</shipping-taxed>' . $eol;
CHANGE TO:
							  $data .= '				<shipping-taxed>true</shipping-taxed>' . $eol;

FIND:
							  $data .= '				<rate>' . $default_tax_rate . '</rate>' . $eol;
CHANGE TO:
							  $data .= '				<rate>' . $tax . '</rate>' . $eol;

 

The first modification will increase the tax rate pad (i.e. X.XX to X.XXXX) so that there is no rounding; Google uses the X.XXXX format. The second modification will make shipping taxable and charge the appropriate tax that you have setup for your store.

 

It's amazing what you can see when you look at an actual piece of paper :rolleyes:

 

Regards,

 

ski

Share this post


Link to post
Share on other sites
hi all,

I have installed this module and everything seems to work fine apart from one thing TAX i.e. the tax doesn't seem to be carried to google checkout. On google checkout page (i.e. sandbox) it displayed product with price, delivery charge and total, underneath total there is a text saying "(includes VAT £0.00)". In UK, VAT is 17.50% which is set up correctly and work fine with any other payment module but for whatever reason, this would not work for me. can you guys help? Do i need to edit anything else in catalog/includes/modules/payment/google.php apart from one below

$data .= '	<shipping-taxed>false</shipping-taxed>' . $eol;

please help

thank you

mangotrees

 

Mangotrees, please see modifications on previous post.

 

ski

Share this post


Link to post
Share on other sites
Are you using STS? I just installed this on a site using STS and got the same problem.

 

Here is how to fix it:

 

Open includes/sts_display_output.php:

Find

|| strpos($scriptname, "info_shopping_cart") !== false

 

Add after (on the same line):

|| strpos($scriptname, "google_checkout_process") !== false

 

This will stop STS from trying to process the google checkout page (which was resulting in the blank page)

 

Hi there,

 

Can't believe I missed this post earlier. You are right, I am using STS, but my sts_display_output.php doesn't seem to have the code you mention.

 

My sts_display_output.php file is as follows:

 

<?php
/*
$Id: sts_display_output.php,v 1.1 2003/09/22 05:16:09 jhtalk Exp jhtalk $
*/

// Used for debugging, please don't change
$sts_version = "1.8";

$template['debug'] .= ''; // Define as blank if not already defined

/////////////////////////////////////////////
// SELECT HOW TO DISPLAY THE OUTPUT
/////////////////////////////////////////////
$display_template_output = 1;
$display_normal_output = 0;
$display_debugging_output = 0;
$display_version_output = 0;

// Override if we need to show a pop-up window
$scriptname = $_SERVER['PHP_SELF'];
$scriptname = getenv('SCRIPT_NAME');
$scriptbasename = substr($scriptname, strrpos($scriptname, '/') + 1);
// If script name contains "popup" then turn off templates and display the normal output
// This is required to prevent display of standard page elements (header, footer, etc) from the template and allow javascript code to run properly
if (strpos($scriptname, "popup") !== false) {
$display_normal_output = 1;
$display_template_output = 0;
}


/////////////////////////////////////////////
// Allow the ability to turn on/off settings from the URL
// Set values to 0 or 1 as needed
/////////////////////////////////////////////

// Allow Template output control from the URL
if ($HTTP_GET_VARS['sts_template'] != "") {
$display_template_output = $HTTP_GET_VARS['sts_template'];
}

// Allow Normal output control from the URL
if ($HTTP_GET_VARS['sts_normal'] != "") {
$display_normal_output = $HTTP_GET_VARS['sts_normal'];
}

// Allow Debugging control from the URL
if ($HTTP_GET_VARS['sts_debug'] != "") {
$display_debugging_output = $HTTP_GET_VARS['sts_debug'];
}

// Allow Version control from the URL
if ($HTTP_GET_VARS['sts_version'] != "") {
$display_version_output = $HTTP_GET_VARS['sts_version'];
}

// Print out version number if needed
if ($display_version_output == 1 or $display_debugging_output == 1) {
print "STS_VERSION=[$sts_version]\n";
}

// See if there is a template file for the currently running script
$sts_template_file = STS_TEMPLATE_DIR . $scriptbasename . ".html";
if (file_exists($sts_template_file)) {
 // Use it
} else {
 // Otherwise, use the default template
 $sts_template_file = STS_DEFAULT_TEMPLATE;
}

// Open Template file and read into a variable
if (! file_exists($sts_template_file)) {
echo "Template file doesn't exist: [" . STS_TEMPLATE . "]";
}

if (! $fh = fopen($sts_template_file, 'r')) {
echo "Can't open Template file: [" . $sts_template_file . "]";
}

$template_html = fread($fh, filesize($sts_template_file));
fclose($fh);


/////////////////////////////////////////////
////// Run any user code needed
/////////////////////////////////////////////
require(STS_USER_CODE);

/////////////////////////////////////////////
////// Set up template variables
/////////////////////////////////////////////

/////////////////////////////////////////////
////// Capture <title> and <meta> tags
/////////////////////////////////////////////

// STS: ADD: Support for WebMakers.com's Header Tag Controller contribution
 // Capture the output
 require(STS_START_CAPTURE);

 // BOF: WebMakers.com Changed: Header Tag Controller v1.0
 // Replaced by header_tags.php
 if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
require(DIR_WS_FUNCTIONS . 'clean_html_comments.php');
require(DIR_WS_FUNCTIONS . 'header_tags.php');
require(DIR_WS_INCLUDES . 'header_tags.php');
 } else {
echo "<title>" . TITLE . "</title>";
 }
 // EOF: WebMakers.com Changed: Header Tag Controller v1.0

 $sts_block_name = 'headertags';
 require(STS_STOP_CAPTURE);

// STS: EOADD: Support for WebMakers.com's Header Tag Controller contribution

/////////////////////////////////////////////
////// Set up template variables
/////////////////////////////////////////////

 $template['sid'] =  tep_session_name() . '=' . tep_session_id();

 // Strip out <title> variable
 $template['title'] = str_between($sts_block['headertags'], "<title>", "</title>");

 // Load up the <head> content that we need to link up everything correctly.  Append to anything that may have been set in sts_user_code.php
 $template['headcontent'] .= '<meta http-equiv="Content-Type" content="text/html; charset=' . CHARSET . '">' . "\n";
 $template['headcontent'] .= $sts_block['headertags'];
 $template['headcontent'] .= '<base href="' . (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG . '">' . "\n";
 // $template['headcontent'] .= '<link rel="stylesheet" type="text/css" href="stylesheet.css">' . "\n";
 $template['headcontent'] .= get_javascript($sts_block['applicationtop2header'],'get_javascript(applicationtop2header)');


 // Note: These values lifted from the stock /catalog/includes/header.php script's HTML
 // catalogurl: url to catalog's home page
 // catalog: link to catalog's home page
 $template['cataloglogo'] = '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', STORE_NAME) . '</a>';
 $template['urlcataloglogo'] = tep_href_link(FILENAME_DEFAULT);
// original for the following was in the format tep_href_link("folder/","variable")
//change to remove variable field as it was using ? and tep_href with brackets as //they were adding trailing slashes
//260106 changed tep_href_link("view/") for urlhome to root ie index
//270106 changed urlcatalog for urlcatalog to root ie index
//$template['urlcatalog'] = tep_href_link(FILENAME_DEFAULT);
 $template['urlcatalog'] = "/";
 $template['urlhome'] = "/";
 $template['urlabout'] = "view/aboutus.html";
 $template['urlcontact'] = "view/contact.html";
 $template['urlterms'] = "view/terms.html";

 $template['myaccountlogo'] = '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>';
 $template['urlmyaccountlogo'] = tep_href_link(FILENAME_ACCOUNT, '', 'SSL');

 $template['cartlogo'] = '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>';
 $template['urlcartlogo'] = tep_href_link(FILENAME_SHOPPING_CART);

 $template['checkoutlogo'] = '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>';
 $template['urlcheckoutlogo'] = tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL');

 $template['breadcrumbs'] = $breadcrumb->trail(' » ');

 $template['myaccount'] = '<a href=' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL')  . ' class="headerNavigation">' . HEADER_TITLE_MY_ACCOUNT . '</a>';
 $template['urlmyaccount'] = tep_href_link(FILENAME_ACCOUNT, '', 'SSL');

 if (tep_session_is_registered('customer_id')) {
$template['login'] = '<a href=' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . ' class="headerNavigation">' . HEADER_TITLE_LOGOFF . '</a>';
$template['urllogin'] = tep_href_link(FILENAME_LOGOFF, '', 'SSL');
 } else {
$template['login'] = '<a href=' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . ' class="headerNavigation">' . HEADER_TITLE_LOGIN . '</a>';
$template['urllogin'] = tep_href_link(FILENAME_LOGIN, '', 'SSL');
 }

 $template['cartcontents']	= '<a href=' . tep_href_link(FILENAME_SHOPPING_CART) . ' class="headerNavigation">' . HEADER_TITLE_CART_CONTENTS . '</a>';
 $template['urlcartcontents'] = tep_href_link(FILENAME_SHOPPING_CART);

 $template['checkout'] = '<a href=' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . ' class="headerNavigation">' . HEADER_TITLE_CHECKOUT . '</a>';
 $template['urlcheckout'] = tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL');

/////////////////////////////////////////////
////// Create custom boxes
/////////////////////////////////////////////
 $template['categorybox'] = $sts_block['categorybox'];
 $template['manufacturerbox'] = strip_unwanted_tags($sts_block['manufacturerbox'], 'manufacturerbox');
 $template['whatsnewbox'] = strip_unwanted_tags($sts_block['whatsnewbox'], 'whatsnewbox');
 $template['searchbox'] = strip_unwanted_tags($sts_block['searchbox'], 'searchbox');
 $template['informationbox'] = strip_unwanted_tags($sts_block['informationbox'], 'informationbox');
 $template['cartbox'] = strip_unwanted_tags($sts_block['cartbox'], 'cartbox');
 $template['maninfobox'] = strip_unwanted_tags($sts_block['maninfobox'], 'maninfobox');
 $template['orderhistorybox'] = strip_unwanted_tags($sts_block['orderhistorybox'], 'orderhistorybox');
 $template['bestsellersbox'] = strip_unwanted_tags($sts_block['bestsellersbox'], 'bestsellersbox');
 $template['specialfriendbox'] = strip_unwanted_tags($sts_block['specialfriendbox'], 'specialfriendbox');
 $template['reviewsbox'] = strip_unwanted_tags($sts_block['reviewsbox'], 'reviewsbox');
 $template['languagebox'] = strip_unwanted_tags($sts_block['languagebox'], 'languagebox');
 $template['currenciesbox'] = strip_unwanted_tags($sts_block['currenciesbox'], 'currenciesbox');
 $template['content'] = strip_content_tags($sts_block['columnleft2columnright'], 'content');
 // Prepend any error/warning messages to $content
 if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
  $template['content'] = '<table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n" .
						 '  <tr class="headerError">' . "\n" .
						 '	<td class="headerError">' . htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])) . '</td>' . "\n" .
						 '  </tr>' . "\n" .
						 '</table>' . "\n" .
						 $template['content'];
 }
 if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {
  $template['content'] = '<table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n" .
						 '  <tr class="headerInfo">' . "\n" .
						 '	<td class="headerInfo">' . htmlspecialchars($HTTP_GET_VARS['info_message']) . '</td>' . "\n" .
						 '  </tr>' . "\n" .
						 '</table>' . "\n" .
						 $template['content'];
 }
 if ($messageStack->size('header') > 0) {
$template['content'] = $messageStack->output('header') . $template['content'];
 }

 preg_match("/<td class=\"pageHeading\"( valign=\"top\")?>(.+?)<\/td>/i", $template['content'], $regTitle);
 $template['currenttitle'] = $regTitle[2];

 $template['content'] = &preg_replace("/<td class=\"pageHeading\"( valign=\"top\")?>(.+?)<\/td>/i", "", $template['content']);

 $template['date'] = strftime(DATE_FORMAT_LONG);
 $template['numrequests'] = $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted;
 $template['counter'] = $sts_block['counter'];
 $template['footer'] = $sts_block['footer'];
 $template['banner'] = $sts_block['banner'];


/////////////////////////////////////////////
////// Get Categories
/////////////////////////////////////////////
$get_categories_description_query = tep_db_query("SELECT categories_id, categories_name FROM " . TABLE_CATEGORIES_DESCRIPTION . " where language_id = '" . (int)$languages_id . "'");
// Loop through each category (in each language) and create template variables for each name and path
while ($categories_description = tep_db_fetch_array($get_categories_description_query)) {
  $cPath_new = "cPath=" . tep_get_full_path($categories_description['categories_id']);
  $path = substr($cPath_new, 6); // Strip off the "cPath=" from string

  // Replace Spaces in Category Name with Underscores
  $catname = str_replace(" ", "_",
			$categories_description['categories_name']);

  $template["urlcat_" . $catname] = tep_href_link(FILENAME_DEFAULT, $cPath_new);
  // $template["cat_" . $catname] = tep_href_link(FILENAME_DEFAULT, $cPath_new);
  // $template["urlcat_" . $path] = tep_href_link(FILENAME_DEFAULT, $cPath_new);
  // $template["cat_" . $path] = tep_href_link(FILENAME_DEFAULT, $cPath_new);

  // print "<b>template[" . $categories_description['categories_name'] . "]=" . $template[$categories_description['categories_name']] . "<br>template[" . $path . "]=" . $template[$path] . "</b>";
}

/////////////////////////////////////////////
////// Display Template HTML
/////////////////////////////////////////////

 // Sort array by string length, so that longer strings are replaced first
 uksort($template, "sortbykeylength");

 // Manually replace the <!--$headcontent--> if present
$template_html = str_replace('<!--$headcontent-->', $template['headcontent'], $template_html);

 // Automatically replace all the other template variables
 foreach ($template as $key=>$value) {
$template_html = str_replace('$' . $key, $value, $template_html);
 }

 if ($display_template_output == 1) {
echo $template_html;
 }


/////////////////////////////////////////////
////// Display HTML
/////////////////////////////////////////////
if ($display_normal_output == 1) {
 echo $sts_block['applicationtop2header'];
 echo $sts_block['header'];


 echo $sts_block['header2columnleft'];

 // print column_left stuff
 echo $sts_block['categorybox'];
 echo $sts_block['manufacturerbox'];
 echo $sts_block['whatsnewbox'];
 echo $sts_block['searchbox'];
 echo $sts_block['informationbox'];

 echo $sts_block['columnleft2columnright'];

 // print column_right stuff
 echo $sts_block['cartbox'];
 echo $sts_block['maninfobox'];
 echo $sts_block['orderhistorybox'];
 echo $sts_block['bestsellersbox'];
 echo $sts_block['specialfriendbox'];
 echo $sts_block['reviewsbox'];
 echo $sts_block['languagebox'];
 echo $sts_block['currenciesbox'];

 echo $sts_block['columnright2footer'];

 // print footer
 echo $sts_block['content'];
 echo $sts_block['counter'];
 echo $sts_block['footer'];
 echo $sts_block['banner'];
}
/////////////////////////////////////////////
////// End Display HTML
/////////////////////////////////////////////

if ($display_debugging_output == 1) {
 // Print Debugging Info
 print "\n<pre><hr>\n";
 print "STS_VERSION=[" . $sts_version . "]<br>\n";
 print "STS_TEMPLATE=[" . $sts_template_file . "]<hr>\n";
 // Replace $variable names in $sts_block_html_* with variables from the $template array
 foreach ($sts_block as $key=>$value) {
print "<b>\$sts_block['$key']</b><hr>" . htmlspecialchars($value) . "<hr>\n";
 }

 foreach ($template as $key=>$value) {
print "<b>\$template['$key']</b><hr>" . htmlspecialchars($value) . "<hr>\n";
 }

}

if ($display_normal_output == 1) {
 echo $sts_block['footer2applicationbottom'];
}

// STRIP_UNWANTED_TAGS() - Remove leading and trailing <tr><td> from strings
function strip_unwanted_tags($tmpstr, $commentlabel) {
 // Now lets remove the <tr><td> that the require puts in front of the tableBox
 $tablestart = strpos($tmpstr, "<table");
 $formstart = strpos($tmpstr, "<form");
 if(($formstart !== false && $formstart < $tablestart) || $tablestart === false) {
$tablestart = $formstart;
 }

 // If empty, return nothing
 if ($tablestart < 1) {
return  "\n<!-- start $commentlabel //-->\n$tmpstr\n<!-- end $commentlabel //-->\n";
 }

 $tmpstr = substr($tmpstr, $tablestart); // strip off stuff before <table>

 // Now lets remove the </td></tr> at the end of the tableBox output
 // strrpos only works for chars, not strings, so we'll cheat and reverse the string and then use strpos
 $tmpstr = strrev($tmpstr);

 $tableend = strpos($tmpstr, strrev("</table>"), 1);
 $formend = strpos($tmpstr, strrev("</form>"), 1);
 if(($formend !== false && $formend < $tableend) || $tableend === false) {
$tableend = $formend;
 }

 $tmpstr = substr($tmpstr, $tableend);  // strip off stuff after </table>

 // Now let's un-reverse it
 $tmpstr = strrev($tmpstr);

 // print "<hr>After cleaning tmpstr:" . strlen($tmpstr) . ": FULL=[".  htmlspecialchars($tmpstr) . "]<hr>\n";
 return  "\n<!-- start $commentlabel //-->\n$tmpstr\n<!-- end $commentlabel //-->\n";
}


// STRIP_CONTENT_TAGS() - Remove text before "body_text" and after "body_text_eof"
function strip_content_tags($tmpstr, $commentlabel) {
 // Now lets remove the <tr><td> that the require puts in front of the tableBox
 $tablestart = strpos($tmpstr, "<table");
 $formstart = strpos($tmpstr, "<form");

 // If there is a <form> tag before the <table> tag, keep it
 if ($formstart !== false and $formstart < $tablestart) {
 $tablestart = $formstart;
 }

 // If empty, return nothing
 if ($tablestart < 1) {
	return  "\n<!-- start $commentlabel //-->\n$tmpstr\n<!-- end $commentlabel //-->\n";
 }

 $tmpstr = substr($tmpstr, $tablestart); // strip off stuff before <table>

 // Now lets remove the </td></tr> at the end of the tableBox output
 // strrpos only works for chars, not strings, so we'll cheat and reverse the string and then use strpos
 $tmpstr = strrev($tmpstr);

 $tableend = strpos($tmpstr, strrev("</table>"), 1);
 $formend = strpos($tmpstr, strrev("</form>"), 1);
 if($formend !== false && $formend < $tableend) {
$tableend = $formend;
 }
 $tmpstr = substr($tmpstr, $tableend);  // strip off stuff after <!-- body_text_eof //-->

 // Now let's un-reverse it
 $tmpstr = strrev($tmpstr);

 // print "<hr>After cleaning tmpstr:" . strlen($tmpstr) . ": FULL=[".  htmlspecialchars($tmpstr) . "]<hr>\n";
 return  "\n<!-- start $commentlabel //-->\n$tmpstr\n<!-- end $commentlabel //-->\n";
}


function get_javascript($tmpstr, $commentlabel) {
 // Now lets remove the <tr><td> that the require puts in front of the tableBox
 $tablestart = strpos($tmpstr, "<script");

 // If empty, return nothing
 if ($tablestart === false) {
return  "\n<!-- start $commentlabel //-->\n\n<!-- end $commentlabel //-->\n";
 }

 $tmpstr = substr($tmpstr, $tablestart); // strip off stuff before <table>

 // Now lets remove the </td></tr> at the end of the tableBox output
 // strrpos only works for chars, not strings, so we'll cheat and reverse the string and then use strpos
 $tmpstr = strrev($tmpstr);

 $tableend = strpos($tmpstr, strrev("</script>"), 1);
 $tmpstr = substr($tmpstr, $tableend);  // strip off stuff after </table>

 // Now let's un-reverse it
 $tmpstr = strrev($tmpstr);

 // print "<hr>After cleaning tmpstr:" . strlen($tmpstr) . ": FULL=[".  htmlspecialchars($tmpstr) . "]<hr>\n";
 return  "\n<!-- start $commentlabel //-->\n$tmpstr\n<!-- end $commentlabel //-->\n";
}

// Return the value between $startstr and $endstr in $tmpstr
function str_between($tmpstr, $startstr, $endstr) {
 $startpos = strpos($tmpstr, $startstr);

 // If empty, return nothing
 if ($startpos === false) {
	return  "";
 }

 $tmpstr = substr($tmpstr, $startpos + strlen($startstr)); // strip off stuff before $start

 // Now lets remove the </td></tr> at the end of the tableBox output
 // strrpos only works for chars, not strings, so we'll cheat and reverse the string and then use strpos
 $tmpstr = strrev($tmpstr);

 $endpos = strpos($tmpstr, strrev($endstr), 1);

 $tmpstr = substr($tmpstr, $endpos + strlen($endstr));  // strip off stuff after </table>

 // Now let's un-reverse it
 $tmpstr = strrev($tmpstr);

 return  $tmpstr;
}

function sortbykeylength($a,$b) {
 $alen = strlen($a);
 $blen = strlen($b);
 if ($alen == $blen) $r = 0;
 if ($alen < $blen) $r = 1;
 if ($alen > $blen) $r = -1;
 return $r;
}

?>

 

Any ideas?

Share this post


Link to post
Share on other sites
Hello,

 

I believe the contribution is actually setup to use the ICW CREDIT CLASS Gift Voucher System. As well, I use it, and it works fine with the exception that's noted in the readme.txt.

 

If you have any standard payment module setup (example: check/money order), and it works, you can likely rule out the checkout_confirmation.php file as being a problem.

 

Regards,

 

CT

 

Hi CT,

 

I've never had this up and running with anything other than protx, so I don't know if any other payment modules would or do work. I was going to strip out the ICW credit class thing but if it works for you then I'll leave it. I think the STS thing might have something to do with it but cant find the code being referred to. I changed my checkout_confirmation.php for a stock one and it works ok with protx still, but not with GC.

Share this post


Link to post
Share on other sites

@dave,

 

thanks it was the sts, i just added your line to my code and it worked!

 

Seems all is working now, however, just wanted to confirm that successful or not, an order is added to the database and visible in admin?

 

cos that is what my site is doing?!

 

thanks again to you all for your help!!! :-D

Share this post


Link to post
Share on other sites
@dave,

 

thanks it was the sts, i just added your line to my code and it worked!

 

Seems all is working now, however, just wanted to confirm that successful or not, an order is added to the database and visible in admin?

 

cos that is what my site is doing?!

 

thanks again to you all for your help!!! :-D

 

Teamwhatever,

 

I'm glad that you got it to work. :thumbsup:

 

As for your question . . . YES, the order will show in your ADMIN and in your DATABASE even if the customer decides not to complete the order when in the Google Checkout website. It is IMPERATIVE, that you check your Google Merchant Account to verify that payment has been made and credited to your account prior to sending the goods to the customer. ALL monetary transations (payment, refunds, etc) will have to be done via Google Checkout. Very similar to PayPal in a sense.

 

I have not gone into production yet (I've been working on the tax issue described a few posts back). I'd recommend that you test it in production yourself so that you can see ALL the steps that goes on once a purchase is made. Also try cancelling, refunding, etc. Once you have all of that worked out and know how they work, then make it available to your customers. I will create a dummy product with a low cost and test it in the next few days. I will post any problems here.

 

Good luck.

 

ski

Share this post


Link to post
Share on other sites
Hello,

 

If there have been any changes/modifications made to your oscommerce's checkout_process.php file, it is likely those same changes will need to be made to the GOOGLE CHECKOUT IPN's google_checkout_process.php file.

 

As oscommerce's checkout_process.php file processes the oscommerce checkout, similarly does the GOOGLE CHECKOUT IPN's google_checkout_process.php file process the Google Checkout.

 

Regards,

 

CT

 

 

I tried that with discount coupons it still does not work


********************************************************

Deep Link Bidding PR 4 Directory

Share this post


Link to post
Share on other sites

Just to say that I have this working in production.

 

If you set the order status messages in the module in admin then Google updates this for you. If Google checkout is not completed then the order is marked with the top variable set in the 'Google checkout - Set order status'. This is like the Paypal IPN and is useful in that because the order is captured prepayment then you get to see abandoned order.

 

No problems so far apart from Googles server being unavailable the other day........ As Ski says though you do have to log into google to charge the card etc.

Share this post


Link to post
Share on other sites

Would like to say, thanks again to you all for your help to get this up and running.

 

Ski, although not quite as good as the protx setup, it is good enough, since the google system will set the paid for orders status to paid (I called it GC_Paid) I can tell which are done and which are not. The only bad point is that I need to keep checking the orders and removing those that are not completed as the product quantities go down and become unavailable, since the site is selling every hour, I need to keep on top of it.

 

One other thing I would like it to do, is to include the google checkout reference in emails send out to customers on confirmed orders. I'll have a read of the osc documentation to see which file does the email send outs on status updates. Then, I'm pretty much happy with the system!

 

Thanks again, you've all been really helpful and patience and it is very much appreciated!

Share this post


Link to post
Share on other sites
One other thing I would like it to do, is to include the google checkout reference in emails send out to customers on confirmed orders.

 

You may wish to save yourself some effort here as I'm afraid Google annoyingly send your customers quite a few emails throughout the whole ordering process so little chance of them not knowing their refs..........

Share this post


Link to post
Share on other sites
I tried that with discount coupons it still does not work

 

Hello,

 

The contribution already has code for CCGV gift vouchers & Discount Coupons written into it in the includes/modules/payment/google.php file.

 

I am now assuming the discount coupons you are referring to is a separate, different contribution. I wouldn't know how to add the code for it. Maybe someone else would.

 

Regards,

 

CT

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×