Jump to content
Sign in to follow this  
ski2bbad

GOOGLE CHECKOUT IPN

Recommended Posts

You must must must put a .htaccess in your GCLOG directory or else anyone can read all your customer's info from the log.

Hello,

 

If anyone has an example of a .htaccess file that prevents access, but still allows the information to be written, it would be much appreciated.

 

I have no clue as to what's needed here.

 

Regards,

 

CT

Share this post


Link to post
Share on other sites

The easiest way to do this would just be copy the .htaccess file in your catalog/admin directory to your log directory. This will make it so you have to use the same admin login/password to access this directory. Hope that helps!

 

-Eric

 

Hello,

 

If anyone has an example of a .htaccess file that prevents access, but still allows the information to be written, it would be much appreciated.

 

I have no clue as to what's needed here.

 

Regards,

 

CT

Share this post


Link to post
Share on other sites

Hi all,

 

Unfortunately I am in the position of having STS 4.x and not being able to use the STS fix mentioned earlier to solve the 'blank page' problem. The problem has been identified but no solution has been suggested. Does anybody now of one or where to start?

 

It seems a shame to be 'punished' for using the latest version! ;)

Share this post


Link to post
Share on other sites
Also the tax isnt being carried onto google, show as 0.00. What am i missing here??

 

Thanks

Chris

 

Hi Chris.

 

First of all, where are you located, US or UK? If you are in the US, please make sure that your catalog/includes/modules/payment/google.php is set from

 

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

to

 

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

 

If you are in the UK . . . . Mangotrees is having the same problem and I am trying to help him figure it out. . . . . please stay tuned.

 

ski

Share this post


Link to post
Share on other sites
I cannot get the Google order number, via the call back in a testing environment. I get no errors as far as I can tell; I just don't get the Google order number updated to the data base in either the google_checkout_logs table or the orders table. So, I don't get status updates either.

 

Hi CT.

 

Have you looked in the EXTRAS folder of the newest Google Checkout IPN v1.2.2? That might solve your google order number problem.

 

ski

Share this post


Link to post
Share on other sites

 

Hi Mangotrees.

 

I have just tested your site and although everything was correct at the point of "confirm your order", I never got sent to Google as before. Could you please go to your google_log file and post that particular order in here (order total was UK$ 12.04). Also, go into your Google Merchant account and see if you have an ERROR in the XML for that order and you can post that here too.

 

Have you made any significant modifications to your checkout, as I was sent to Google to complete the order last week?

 

Thank you.

 

ski

Share this post


Link to post
Share on other sites
Hi all,

 

Unfortunately I am in the position of having STS 4.x and not being able to use the STS fix mentioned earlier to solve the 'blank page' problem. The problem has been identified but no solution has been suggested. Does anybody now of one or where to start?

 

It seems a shame to be 'punished' for using the latest version! ;)

Hi amigaman.

 

I do not use STS, so I may not be of much help here. I am not sure why the code below is not working for all STS versions, but I will try to investigate.

 

In ... /includes/sts_display_output.php:

 

Find:

 

// 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 || strpos($scriptname, "info_shopping_cart") !== false) {
$display_normal_output = 1;
$display_template_output = 0;
}

Change to this:

 

 
// 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 || strpos($scriptname, "info_shopping_cart") !== false || strpos($scriptname, "google_checkout_process") !== false {
$display_normal_output = 1;
$display_template_output = 0;
}

 

ski

Edited by ski2bbad

Share this post


Link to post
Share on other sites
Hi amigaman.

 

I do not use STS, so I may not be of much help here. I am not sure why the code below is not working for all STS versions, but I will try to investigate.

ski

 

Many thanks. The problem is that I don't have an includes/sts_display_output.php using STS 4. There is such a file in includes/modules/sts_inc but it does not contain the code you refer to. It contains the following:

 

 

<?php
/*
$Id: sts_display_output.php,v 4.1 2006/01/25 05:57:12 rigadin Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2005 osCommerce

Released under the GNU General Public License

Based on: Simple Template System (STS) - Copyright (c) 2004 Brian Gallagher - brian@diamondsea.com
STS v4.1 by Rigadin (rigadin@osc-help.net)
*/

// Get list of modules to include
$sts_modules_inc = $sts->capture_fields(); // Returns an array of files to include
$sts_modules_str = ''; // Added in v4.0.7 for debug
if (!empty($sts_modules_inc)) {
 foreach ($sts_modules_inc as $sts_mod){
include(DIR_WS_MODULES.'sts_inc/'.$sts_mod);
$sts_modules_str.= $sts_mod .' - '; // Added in v4.0.7 for debug
 }
}

// If we use a template, replace placeholders and display the page
 if ($sts->display_template_output == 1) {
$sts->replace();  // Read file and replace placeholders with variables content
echo $sts->template['template_html'];  // Display the page
 }

// Display debug information if we are in template debug mode
if ($sts->display_debug_output) {
 // Print Debugging Info
 print "\n<pre><hr>\n";
 print "STS_VERSION=[" . $sts->version . "]<br>\n";
 print "OSC_VERSION=[".PROJECT_VERSION."]\n";
 print "STS_TEMPLATE=[" . $sts->template_file . "]\n";
 print "STS_MODULE=[" . $sts->script->code . "]\n";
 print "STS_INC_MODULES=[". $sts_modules_str . "]<hr>\n"; // Added in v4.0.7 to know what modules are included

 $sts->template['template_html'] = 'This variable is the source code of this page, without debug informations. As it is quite long, we dont show it here.';
 foreach ($sts->template as $key=>$value) {
print "<b>\$sts->template['$key']</b><hr>" . htmlspecialchars($value) . "<hr>\n";
 }

}
?>

 

Thanks for any time you can spare on this.

Share this post


Link to post
Share on other sites
Many thanks. The problem is that I don't have an includes/sts_display_output.php using STS 4. There is such a file in includes/modules/sts_inc but it does not contain the code you refer to. It contains the following:

 

Hi amigaman.

 

I'm flying blind here, so bare with me. Please try this fix and then let me know if it works.

 

Go to catalog/includes/modules/sts/sts_default.php

 

FIND:
 if (strstr($scriptbasename, "popup")|| strstr($scriptbasename, "info_shopping_cart"))
  return ''; // We don't use template for these scripts

REPLACE WITH:

 if (strstr($scriptbasename, "popup")|| strstr($scriptbasename, "info_shopping_cart")|| strstr($scriptbasename, "google_checkout_process"))
  return ''; // We don't use template for these scripts

 

I don't promise anything, but it might just work. If it does, please let us know. If not, I'd suggest you check with the STS forum as they might have experienced similar issues.

 

Good luck!

 

ski

Share this post


Link to post
Share on other sites

Thanks but that code is not present in the file you name.

 

The sts_default contains:

 

<?php
/*
$Id: sts_default.php,v 1.0.4 2005/12/12 09:36:00 rigadin Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2005 osCommerce

Released under the GNU General Public License
* 
* STS v4 module for pages without own module by Rigadin (rigadin@osc-help.net)
*/


class sts_default {

 var $template_file;

 function sts_default (){
$this->code = 'sts_default';
$this->title = MODULE_STS_DEFAULT_TITLE;
$this->description = MODULE_STS_DEFAULT_DESCRIPTION.' (v1.0.4)';
$this->sort_order=1;
 }

 function find_template (){
 // Return an html file to use as template
// Check if there is a template for this script
$check_file = STS_TEMPLATE_DIR . basename ($_SERVER['PHP_SELF']) . ".html";
if (file_exists($check_file)) return $check_file;

// No template for this script, returns the default template
return STS_DEFAULT_TEMPLATE;
 } // End function

 function capture_fields () {
 // Returns list of files to include from folder sts_inc in order to build the $template fields
return MODULE_STS_DEFAULT_NORMAL;
 }

 function replace (&$template) {
$template['content']=sts_strip_content_tags($template['content'], 'Default Content');
 }

//======================================
// Functions needed for admin
//======================================

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

function keys() {
  return array('MODULE_STS_DEFAULT_STATUS', 'MODULE_STS_DEBUG_CODE' ,'MODULE_STS_DEFAULT_NORMAL', 'MODULE_STS_TEMPLATE_FOLDER','MODULE_STS_TEMPLATE_FILE');
}

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 ('Use Templates?', 'MODULE_STS_DEFAULT_STATUS', 'false', 'Do you want to use Simple Template System?', '6', '1','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 ('Code for debug output', 'MODULE_STS_DEBUG_CODE', 'debug', 'Code to enable debug output from URL (ex: index.php?sts_debug=debug', '6', '2', now())");
  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Files for normal template', 'MODULE_STS_DEFAULT_NORMAL', 'sts_user_code.php', 'Files to include for a normal template, separated by semicolon', '6', '2', now())");
  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Template folder', 'MODULE_STS_TEMPLATE_FOLDER', 'test', 'Location of templates inside the includes/sts_templates/ folder. Do not start nor end with a slash', '6', '2', now())");
  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Default template file', 'MODULE_STS_TEMPLATE_FILE', 'sts_template.html', 'Name of the default template file', '6', '2', now())");
}

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

}// end class
?>

Share this post


Link to post
Share on other sites
Hi CT.

 

Have you looked in the EXTRAS folder of the newest Google Checkout IPN v1.2.2? That might solve your google order number problem.

 

ski

 

Hi Ski,

 

I had already downloaded and implemented the EXTRAS optional modifications. My problem is not in viewing the numbers.

 

My problem is, I am not getting anything added to the database to begin with, in neither table (google_checkout_logs & orders). Nor do I get any info in the google_log.txt file).

 

I have only tested in the sandbox environment.

 

I am a little confused about the google_log.txt file, as I thought to begin with it was meant for debugging, and therefore I assumed that there wouldn't be information inserted if there were no problems. However, I am under the impression now, from others experiences shared here that order information is inputted into google_log.txt as a regular part of the contributions process.

 

So, I am just wondering if you might have any thoughts (assuming for the moment that my install is correct) as to why I wouldn't be getting the Google Order ID Number inserted into the google_checkout_logs & orders tables?

 

Regards,

 

CT

Share this post


Link to post
Share on other sites
I am a little confused about the google_log.txt file, as I thought to begin with it was meant for debugging, and therefore I assumed that there wouldn't be information inserted if there were no problems. However, I am under the impression now, from others experiences shared here that order information is inputted into google_log.txt as a regular part of the contributions process.

 

Yes I thought this at first too and was looking in there for errors! However, can confirm that it is where all the order detail is posted. Do you have the correct write permissions?

Share this post


Link to post
Share on other sites
Thanks but that code is not present in the file you name.

 

Ok . . . amigaman,

 

This is what I need you to do, so that I can try to help you. I need to know the exact name and version of the STS you are using. A link to the actual module would be great. I searched STS in OSC, under contributions, and found at least two different ones. So help me out here and be more specific. I will do my best to help you.

 

ski

Share this post


Link to post
Share on other sites
So, I am just wondering if you might have any thoughts (assuming for the moment that my install is correct) as to why I wouldn't be getting the Google Order ID Number inserted into the google_checkout_logs & orders tables?

CT,

 

Are any of the fields in your database updated once an order is placed?

 

I'd check your API callback to make sure it is correct. Also, as madcrazygirl has pointed out, make sure you have the write permissons set correctly. The log should have all the order information each time an order is placed.

 

Also check your XML error log in your Merchant Google account and see if there is anything there. That might also give you a clue.

 

ski

Share this post


Link to post
Share on other sites
Ok . . . amigaman,

 

This is what I need you to do, so that I can try to help you. I need to know the exact name and version of the STS you are using. A link to the actual module would be great. I searched STS in OSC, under contributions, and found at least two different ones. So help me out here and be more specific. I will do my best to help you.

 

ski

 

 

I believe I am using STS v4.1. Module is located here.

 

Thanks again.

Share this post


Link to post
Share on other sites
Hi Chris.

 

First of all, where are you located, US or UK? If you are in the US, please make sure that your catalog/includes/modules/payment/google.php is set from

 

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

to

 

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

 

If you are in the UK . . . . Mangotrees is having the same problem and I am trying to help him figure it out. . . . . please stay tuned.

 

ski

 

Hi Mango & Ski,

pls keep me updated about any news on this UK issue.

Thanks,

Roberto

Share this post


Link to post
Share on other sites
I believe I am using STS v4.1. Module is located here.

 

Amigaman,

 

Try this . . . . go to catalog/includes/classes/sts.php

 

FIND:

if (strstr($scriptbasename, "popup")|| strstr($scriptbasename, "info_shopping_cart")) {
  $this->display_template_output = false;
  return;
}

REPLACE WITH:

if (strstr($scriptbasename, "popup")|| strstr($scriptbasename, "info_shopping_cart")|| strstr($scriptbasename, "google_checkout_process")) {
  $this->display_template_output = false;
  return;
}

 

Again . . . . no promises.

 

Good luck!

 

ski

Share this post


Link to post
Share on other sites

 

Hi Mangotrees.

 

I have just tested your site and although everything was correct at the point of "confirm your order", I never got sent to Google as before. Could you please go to your google_log file and post that particular order in here (order total was UK$ 12.04). Also, go into your Google Merchant account and see if you have an ERROR in the XML for that order and you can post that here too.

 

Have you made any significant modifications to your checkout, as I was sent to Google to complete the order last week?

 

Thank you.

 

ski

 

hi ski,

 

i saw your order, but you chose Check/Money Order as your pyament method. I removed that option, only Goolge is there now. Please check again. i am still haing problems with Tax not being carried to Google Checkout.

 

Anyone in UK using this module. please help. you can check my test site on www.simplythai.co.uk/eshop

Share this post


Link to post
Share on other sites
Amigaman,

 

Try this . . . . go to catalog/includes/classes/sts.php

 

 

Again . . . . no promises.

 

Good luck!

 

ski

 

 

Many thanks, that was the one!

Share this post


Link to post
Share on other sites
Many thanks, that was the one!

 

Hi amigaman.

 

You are welcome. I'm glad I was able to get you going. :thumbsup:

 

Best regards,

 

ski

Share this post


Link to post
Share on other sites
Hi amigaman.

 

You are welcome. I'm glad I was able to get you going. :thumbsup:

 

Best regards,

 

ski

 

Thanks but I'm afraid I'm going to have to bother you again! :(

 

A customer can now checkout as normal and select Google checkout as an option (which is great!) but when they leave the site to go to Google an error occurs. At first a processing screen appears with my logo and an instruction to wait. The page then refreshes with the following message:

 

Oops!

(My Store) has sent Google a shopping cart with errors in it. We'll contact them to ask that they fix this problem. As this could be a temporary issue, you can go back in your browser to try checking out again.

 

I haven't received an email from Google stating what the problem is. Searching the net it seems that this error may occur by incorrect cart information being sent to Google. Could this have something to do with the way STS processes the information?

 

Sorry to be a pain...

Edited by amigaman

Share this post


Link to post
Share on other sites
Thanks but I'm afraid I'm going to have to bother you again! :(

 

A customer can now checkout as normal and select Google checkout as an option (which is great!) but when they leave the site to go to Google an error occurs. At first a processing screen appears with my logo and an instruction to wait. The page then refreshes with the following message:

I haven't received an email from Google stating what the problem is. Searching the net it seems that this error may occur by incorrect cart information being sent to Google. Could this have something to do with the way STS processes the information?

 

Sorry to be a pain...

 

Amigaman,

 

Not a problem. I will try to help, if I can. First, have you looked at the log file in the GCLOG folder? Second, have you looked at the XML error log in your Google Merchant account? Please take a look and post them here (you may change any sensitive info with XXXs). This error is new and the information in the log and XML will help me in figuring out a possible solution. I cannot tell you if it is a STS problem or not, but it is a possibility. You may want to monitor the STS forum for similar behavior with other payment modules. I will know more if you can send me the logs above.

 

ski

Share this post


Link to post
Share on other sites
I will know more if you can send me the logs above.

ski

 

That's great.

 

There is no information in the google_log.txt file. It is '777' enabled. There are two different errors in the XML log. I tried to checkout a couple of times when testing it.

 

The first error is:

Error parsing XML; message from parser is: The entity "pound" was referenced, but not declared.

 

XML We Received:

<?xml version="1.0" encoding="UTF-8"?>
<checkout-shopping-cart xmlns="http://checkout.google.com/schema/2">
	<shopping-cart>
		<items>
<item>
	<item-name>The Who T-shirt Magic Bus</item-name>
	<item-description>The Who T-shirt Magic Bus</item-description>
	<unit-price currency="GBP">17.99</unit-price>
	<quantity>1</quantity>
	<tax-table-selector>tax-33{1}23{2}15</tax-table-selector>
</item>
		</items>
		<merchant-private-data>
		<osc-orders-id>100</osc-orders-id>
		</merchant-private-data>
	</shopping-cart>
	<checkout-flow-support>
		<merchant-checkout-flow-support>
			<continue-shopping-url>http://www.MYSITE.com/checkout_success.php?order_id=100</continue-shopping-url>
			<tax-tables>
				<default-tax-table>
					<tax-rules>
						<default-tax-rule>
							<shipping-taxed>false</shipping-taxed>
							<rate>0.0000</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-33{1}23{2}15" standalone="false">
	<alternate-tax-rules>
		<alternate-tax-rule>
			<rate>0.0000</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="Zone Rates, First Item, Plus Additional Items ((£1.99 first item, £0.99 each additional item))">
			<price currency="GBP">2.98</price>
		</flat-rate-shipping>
	</shipping-methods>
	</merchant-checkout-flow-support>
</checkout-flow-support>
</checkout-shopping-cart>
[/code[

[b]XML We Sent:[/b]
[code]
<?xml version="1.0" encoding="UTF-8"?>
<error xmlns="http://checkout.google.com/schema/2" serial-number="A SERIAL NUMBeR IS WRITTEN HERE">
 <error-message>Error parsing XML; message from parser is: The entity "pound" was referenced, but not declared.</error-message>
</error>

 

 

The second error is:

The Http Get method is invalid for sending requests.

 

There is no XML received but the 'XML we sent' reads:

<?xml version="1.0" encoding="UTF-8"?>
<error xmlns="http://checkout.google.com/schema/2" serial-number="SERIAL NUMBER">
 <error-message>The Http Get method is invalid to use for sending requests.</error-message>
</error>

Edited by amigaman

Share this post


Link to post
Share on other sites
That's great.

 

There is no information in the google_log.txt file. It is '777' enabled. There are two different errors in the XML log. I tried to checkout a couple of times when testing it.

 

The first error is:

Error parsing XML; message from parser is: The entity "pound" was referenced, but not declared.

 

Hi amigaman.

 

I don't know where the word "pound" is coming from. So, my question to you is . . . are you in the US or UK? Have you made any modifications to any of the GC IPN files?

 

ski

Share this post


Link to post
Share on other sites
i am still haing problems with Tax not being carried to Google Checkout.

 

Hi mangotrees,

 

I don't know if this will fix your issue as I am unable to test it as I am in the US. Please let me know if anything changes. Also, I really would like to see a copy of your log (from the GCLOG folder) and if you have an XML log error, that would help me too.

 

Ok. . . . go to catalog/includes/modules/payment/google.php

 

FIND:

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

REPLACE WITH:

$alternate_tax .= '				<tax-area>' . $eol;
$alternate_tax .= '					<postal-area>' . $eol;
$alternate_tax .= '						<country-code>GB</country-code>' . $eol;
$alternate_tax .= '					</postal-area>' . $eol;
$alternate_tax .= '				</tax-area>' . $eol;


FIND:

$data .= '							<default-tax-rule>' . $eol;
$data .= '								<shipping-taxed>true</shipping-taxed>' . $eol;
$data .= '								<rate>' . $tax . '</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;

REPLACE WITH:

$data .= '								<shipping-taxed>true</shipping-taxed>' . $eol;
$data .= '								<rate>' . $tax . '</rate>' . $eol;
$data .= '								<tax-area>' . $eol;
$data .= '									<postal-area>' . $eol;
$data .= '										<country-code>GB</country-code>' . $eol;
$data .= '									</postal-area>' . $eol;
$data .= '								</tax-area>' . $eol;
$data .= '							</default-tax-rule>' . $eol;

 

Please let me know if this changes anything for you. I wish google would give us (in the US) some clues at how the code is supposed to be in the UK, but I'll keep at it!

 

ski

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  

×