Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Offical Google Checkout module for osCommerce Support Thread


Silverado05

Recommended Posts

Seems kind of simple but there is an extra space in the code that generates the Google Checkout button on the checkout page.

The space comes right before the merchant_id and a merchant_id=%20<mymerchant_id> gets generated in the url .. Google Checkout doesn't understand this merchant_id with the %20 in front of it.

 

This is about line 473 in my code (yours may differ a little)

	 <input type="hidden" name="cart" value="<?php echo base64_encode($gcheck->getXml());?>">
 <input type="hidden" name="signature" value="<?php echo base64_encode( $googlepayment->CalcHmacSha1($gcheck->getXml())); ?>">
	   <input type="image" name="Checkout" alt="Checkout"
		src="<?php echo $googlepayment->mode;?>buttons/checkout.gif?merchant_id= <?php echo $googlepayment->merchantid;?>&w=168&h=44&style=trans&variant=$
	</form>

 

Should correctly be:

	 <input type="hidden" name="cart" value="<?php echo base64_encode($gcheck->getXml());?>">
 <input type="hidden" name="signature" value="<?php echo base64_encode( $googlepayment->CalcHmacSha1($gcheck->getXml())); ?>">
	   <input type="image" name="Checkout" alt="Checkout"
		src="<?php echo $googlepayment->mode;?>buttons/checkout.gif?merchant_id=<?php echo $googlepayment->merchantid;?>&w=168&h=44&style=trans&variant=$
	</form>

Yes sometimes one little extra space can make a difference.

My site was in the summer 2008 promotion and the starburst "$10 off" checkout button wasn't appearing because the merchant_id wasn't recognized.

 

<Curt

 

Curt,

 

What file is this?

Link to comment
Share on other sites

  • Replies 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

did you find the file?

 

No, that's what I'm missing in my code. The webserver changed to a new platform and suddenly the Google Checkout button disappeared on my site's 'login' and 'shopping cart' pages. Before the changeover to the new platform, I remember removing the "%20" somewhere, but I've forgotten where it was, that's why I was asking. I've tried reinstalling Google Checkout but the problem is still there.

Link to comment
Share on other sites

I have the module installed and working but I need to be able to do free shipping on some items, preferably by designating 0 weight. Is there a way to do this with non virtual items?

Link to comment
Share on other sites

I have note error once I setup the Merchant ID & Merchant Key, and I click save

It show error code: Fatal error: Call to undefined function gc_makeSqlString() in /home/xxxxx/public_html/admin/modules.php on line 61

that mean have error for my sql?

my version 1.4.5a

 

thanks

Edited by kenkenms
Link to comment
Share on other sites

lines missing

 

. /catalog/admin/orders.php LINE 40

============================================================================

REPLACE:

 

if ( ($check_status['orders_status'] != $status) || tep_not_null($comments)) {

tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");

 

$customer_notified = '0';

if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on')) {

$notify_comments = '';

if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) {

$notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";

}

 

$email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);

 

tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

$customer_notified = '1';

}

 

tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "')");

 

$order_updated = true;

}

 

in my orders.php page these are not there

so where i replace

WITH:

 

if ( ($check_status['orders_status'] != $status) || tep_not_null($comments)) {

tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");

 

// ** GOOGLE CHECKOUT **

chdir("./..");

require_once(DIR_WS_LANGUAGES . $language . '/modules/payment/googlecheckout.php');

$payment_value= MODULE_PAYMENT_GOOGLECHECKOUT_TEXT_TITLE;

$num_rows = tep_db_num_rows(tep_db_query("select google_order_number from google_orders where orders_id= ". (int)$oID));

 

if($num_rows != 0) {

$customer_notified = google_checkout_state_change($check_status, $status, $oID,

(@$_POST['notify']=='on'?1:0),

(@$_POST['notify_comments']=='on'?$comments:''));

}

$customer_notified = isset($customer_notified)?$customer_notified:'0';

// ** END GOOGLE CHECKOUT **

if (isset($_POST['notify']) && ($_POST['notify'] == 'on')) {

$notify_comments = '';

if (isset($_POST['notify_comments']) && ($_POST['notify_comments'] == 'on') && tep_not_null($comments)) {

$notify_comments = EMAIL_TEXT_COMMENTS_UPDATE . $comments . "\n\n";

}

// ** GOOGLE CHECKOUT **

$force_email = false;

if($num_rows != 0 && (strlen(htmlentities(strip_tags($notify_comments))) > GOOGLE_MESSAGE_LENGTH && MODULE_PAYMENT_GOOGLECHECKOUT_USE_CART_MESSAGING == 'True')) {

$force_email = true;

$messageStack->add_session(GOOGLECHECKOUT_WARNING_SYSTEM_EMAIL_SENT, 'warning');

}

 

if($num_rows == 0 || $force_email) {

//send emails, not a google order or configured to use both messaging systems

$email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);

tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

$customer_notified = '1';

//send extra emails

}

}

tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "')");

$order_updated = true;

Link to comment
Share on other sites

Hi, I am new to google checkout and need a little advice. I have installed the latest google checkout module for OSC and now have the normal checkout button plus "or use google checkout" button. The tning is I only want to use google checkout so why is there 2 buttons for checking out. I just want 1 button for checkout. What will the original checkout button do now that google checkout is installed. If anyone could shed some light on my confused state it would be great.

 

Thanks in advance

 

Peter

Link to comment
Share on other sites

Hi there,

 

I've been trying to move my wife's jewellery website to a new host server.

 

Currently it is at http://www.larafarewell.co.uk (hosted by

freehostia), but temporarily moving to test site at http://www.larafarewell.net46.net/

(hosted by 000webhost) to test out a new host, in the hopes that it is

faster and more reliable.

 

I have moved the database and files, and all is working fine, except

when you add something to the basket, you get the following errors:

 

Warning: googlecheckout::require_once(/home/www/larafarewell.net46.net/

catalog//includes/languages/english/modules/payment/

googlecheckout.php) [googlecheckout.require-once]: failed to open

stream: No such file or directory in /home/a5747932/public_html/

catalog/includes/modules/payment/googlecheckout.php on line 38

 

Fatal error: googlecheckout::require_once() [function.require]: Failed

opening required '/home/www/larafarewell.net46.net/catalog//includes/

languages/english/modules/payment/

googlecheckout.php' (include_path='.:/usr/lib/php:/usr/local/lib/php')

in /home/a5747932/public_html/catalog/includes/modules/payment/

googlecheckout.php on line 38

 

Do you think it could be the two slashes? ...... catalog//

includes.....

 

or do I have to define the websites somewhere on the google checkout

site?

 

I have level 2 integration

 

Many thanks,

 

ThreeIsles

Link to comment
Share on other sites

Hi there,

 

I've been trying to move my wife's jewellery website to a new host server.

 

Currently it is at http://www.larafarewell.co.uk (hosted by

freehostia), but temporarily moving to test site at http://www.larafarewell.net46.net/

(hosted by 000webhost) to test out a new host, in the hopes that it is

faster and more reliable.

 

I have moved the database and files, and all is working fine, except

when you add something to the basket, you get the following errors:

 

Warning: googlecheckout::require_once(/home/www/larafarewell.net46.net/

catalog//includes/languages/english/modules/payment/

googlecheckout.php) [googlecheckout.require-once]: failed to open

stream: No such file or directory in /home/a5747932/public_html/

catalog/includes/modules/payment/googlecheckout.php on line 38

 

Fatal error: googlecheckout::require_once() [function.require]: Failed

opening required '/home/www/larafarewell.net46.net/catalog//includes/

languages/english/modules/payment/

googlecheckout.php' (include_path='.:/usr/lib/php:/usr/local/lib/php')

in /home/a5747932/public_html/catalog/includes/modules/payment/

googlecheckout.php on line 38

 

Do you think it could be the two slashes? ...... catalog//

includes.....

 

or do I have to define the websites somewhere on the google checkout

site?

 

I have level 2 integration

 

Many thanks,

 

ThreeIsles

 

That's an error in your includes/configure.php file. Yes, you shouldn't have 2 slashes. You either have an extra slash at the beginning or end. It should look like this:

define('DIR_WS_INCLUDES', 'includes/');

 

or if that doesn't work look in Define HTTP catalog.

Edited by speed777
Link to comment
Share on other sites

That's an error in your includes/configure.php file. Yes, you shouldn't have 2 slashes. You either have an extra slash at the beginning or end. It should look like this:

define('DIR_WS_INCLUDES', 'includes/');

 

or if that doesn't work look in Define HTTP catalog.

 

thanks for that. I've compared the two files (old and new) and I have exactly the same number and placement of slashes on each of the files. Could it be a PhP 5 error, do you think?

 

Many thanks,

 

ThreeIsles

Link to comment
Share on other sites

thanks for that. I've compared the two files (old and new) and I have exactly the same number and placement of slashes on each of the files. Could it be a PhP 5 error, do you think?

 

Many thanks,

 

ThreeIsles

 

I don't know about the PHP 5 error, the only thing that I know of that would cause the error is an error in your config file.

Link to comment
Share on other sites

I pasted the wrong code earlier. that was fixed! this is the problem i am having. i must be missing something, everything else works so far except this. anyone help? Please??

 

Authorization: Basic XXXXXX:XXXXXX

Content-Type: application/xml;charset=UTF-8

Accept: application/xml;charset=UTF-8

X-Origin-IP:

 

 

XML We Received: HTTP/1.1 500

Date: Wed, 02 Jul 2008 13:57:54 GMT

Server: Apache

Set-Cookie: cookie_test=please_accept_for_session; expires=Fri, 01 Aug 2008 13:57:54 GMT; path=/catalog/; domain=allstarlab.com

Connection: close

Transfer-Encoding: chunked

Content-Type: text/html

 

Shopping cart not obtained from session.

Link to comment
Share on other sites

Hi!

 

i am new to this forum...and would like some help.

 

I have downloaded the Google checkout module from the goolge website. The file name is google-checkout-oscommerce-v1.4.5a.zip

 

I have installed it according the instruction given in in the zip file.

 

I have got the module installed as I can see it in the OSCOMMERCE Admin page. I have put in my merchant and id numbers all correctly.

 

But I still don't get any google checkout button on the webpage? Is there an additional code i have to put in or something?

 

Can someone pleases help me!

Link to comment
Share on other sites

has anyone been able to get this to work with USPS Methods? FedEx shows up just fine, but i get no figures whatsoever from USPS. when i disable the FedEx module, i get the "Oops!" message from Google. it's like the GC module doesn't recognize that i have USPS set up at all.

 

thanks.

Link to comment
Share on other sites

Hi all,

 

I have almost no contributions installed on OSC, only FEC and Google Checkout. GC and PayPal are the only payment modules I have activated, and PP works fine.

 

However, GC goes round and round in circles. Selecting GC on checkout_shipping.php takes me to checkout_confirmation.php?paynow= - like that, with no value for paynow,

and then clicking 'confirm order' on that page takes me back to my shopping cart.

 

What have I done wrong?!

 

TIA for any advice,

Sue

Link to comment
Share on other sites

Hi All,

 

Can someone tell me which is the latest contrib I need to download if I want to install GCO on my oscommerce site? There are so many updates I am a bit confused. <_<

 

Cheers, Chris

Founder & Director at CSC Tours Ltd

Link to comment
Share on other sites

I really hate to see that people are still trying to use this module:

 

1) It has never worked period.

2) The developer has disappeared and it is now unsupported

3) The underlying API for carrier calculated shipping returns invalid results and google has known about it for a longtime but still will not fix it.

 

 

My advice is to quit banging your head against the wall. No matter what you do to this code it will NOT work!

Edited by dmason2
Link to comment
Share on other sites

Hey,

 

I have given Google Checkout another attempt, hopefully this time I

will be more successful. Anyway I have just uploaded and configured

version v1.4.5_CCS.

 

 

I have put in the shipping methods which is shown below, all of my

shipping methods are flat rate and do not change, they come up fine

when the customer is taken to the google checkout page.

 

 

I am using freeamount to offer free delivery for customers that order

over a certain amount. Instead of only appearing when the value of

freeamount is reached, it shows even when the value of the order is

below the threshold. Is there a way of only showing the free shipping

when the order is over a certain amount?

 

 

Since testing it out, I have noticed all prices are taken from the

entered amount in the Google Checkout payment module. Should it not

take the amounts from the actual shipping modules?

 

 

Thanks again,

 

 

All help and suggestions are appreciated!

 

 

GCL

 

 $this->mc_shipping_methods = $mc_shipping_methods; 
 $this->mc_shipping_methods = array( 
                       'priority' => array( 
                                   'domestic_types' => 
                                     array( 
                                         'priority' => 'Priority 
Delivery', 
                                          ), 


                                   'international_types' => 
                                     array( 
                                       ), 
                                       ), 
                                               'flat' => array( 
                                   'domestic_types' => 
                                     array( 
                                         'flat' => 'Standard 
Delivery', 
                                          ), 


                                   'international_types' => 
                                     array( 
                                                                                       ), 
                                          ), 
                                               'freeamount' => array( 
                                   'domestic_types' => 
                                     array( 
                                         'freeamount' => 'Free Shipping', 
                                          ), 


                                   'international_types' => 
                                     array( 
                                                                                       ), 
                                          ), 
                                               'nextday' => array( 
                                   'domestic_types' => 
                                     array( 
                                         'nextday' => 'Nexy Day Noon', 
                                          ), 


                                   'international_types' => 
                                     array( 
                                                                                       ), 
                                          ), 
                                 ); 
 $this->mc_shipping_methods_names = $mc_shipping_methods_names; 
 $this->mc_shipping_methods_names = array( 
                                        'priority' => 'Priority 
Delivery', 
                                        'flat' => 'Standard 
Delivery', 
                                        'freeamount' => 'Free 
Shipping', 
                                        'nextday' => 'Next Day Noon', 
                                       );

Edited by parma
Link to comment
Share on other sites

I have installed Google Checkout and get a 500 error, page cannot be displayed, when I go to googlecheckout/responsehandler.php even though I can see it on the server. I went to the admin and installed the module but when I try to edit it I get the following error:

 

 

Fatal error: Call to undefined function: gc_cfg_select_shipping() in /home/penguin/public_html/admin/modules.php(235) : eval()'d code on line 1

 

What did I do wrong?

 

Thanks

 

Dan

Link to comment
Share on other sites

I really hate to see that people are still trying to use this module:

 

1) It has never worked period.

2) The developer has disappeared and it is now unsupported

3) The underlying API for carrier calculated shipping returns invalid results and google has known about it for a longtime but still will not fix it.

 

 

My advice is to quit banging your head against the wall. No matter what you do to this code it will NOT work!

 

 

What solution do you suggest?

 

This contribution? http://www.oscommerce.com/community/contributions,4556/

Link to comment
Share on other sites

I really hate to see that people are still trying to use this module:

 

1) It has never worked period.

2) The developer has disappeared and it is now unsupported

3) The underlying API for carrier calculated shipping returns invalid results and google has known about it for a longtime but still will not fix it.

 

 

My advice is to quit banging your head against the wall. No matter what you do to this code it will NOT work!

 

 

1) It does work -- it is very technical and time consuming to install (it took me about 2 days and I've installed well over 50 contribs) - I know there are a lot of posts but just read through all of the posts and you will likely find your answer.

2) Yes the google developer who was working on this contrib is no longer working on it. Why don't you contact google and ask them to update the contrib instead of complaining? FYI it was the sheer number of oscommerce users who got them to support and help develop the contrib originally. Not to mention myself and I'm sure many others nagged the actual development team of the google checkout them at the Internet Retailer Conference and other conferences....

3) I'm unsure about this but I do know the fedex calculated rates work.

Edited by homewetbar

Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

Link to comment
Share on other sites

Does anyone know how I might add this to a batch update program?

 

I have it currently check the order number against the google orders table and if its populated then it runs the batch update script, however the information doesnt seem to be getting to GC. Here is what I have so far:-

 

if ($googleid[0]) {
 require('includes/application_top.php');
/* ** GOOGLE CHECKOUT **/
 define('GC_STATE_NEW', 100);
 define('GC_STATE_PROCESSING', 101);
 define('GC_STATE_SHIPPED', 102);
 define('GC_STATE_REFUNDED', 103);
 define('GC_STATE_SHIPPED_REFUNDED', 104);
 define('GC_STATE_CANCELED', 105);
 function google_checkout_state_change($check_status, $status, $oID, 
										  $cust_notify, $notify_comments) {
  global $db,$messageStack, $orders_statuses;

  define('API_CALLBACK_ERROR_LOG', 
				   DIR_FS_CATALOG. "/googlecheckout/logs/response_error.log");
  define('API_CALLBACK_MESSAGE_LOG',
				   DIR_FS_CATALOG . "/googlecheckout/logs/response_message.log");

  include_once(DIR_FS_CATALOG.'/includes/modules/payment/googlecheckout.php');
  include_once(DIR_FS_CATALOG.'/googlecheckout/library/googlerequest.php');

  $googlepayment = new googlecheckout();

  $Grequest = new GoogleRequest($googlepayment->merchantid, 
								$googlepayment->merchantkey, 
								MODULE_PAYMENT_GOOGLECHECKOUT_MODE==
								  'https://sandbox.google.com/checkout/'
								  ?"sandbox":"production",
								DEFAULT_CURRENCY);
  $Grequest->SetLogFiles(API_CALLBACK_ERROR_LOG, API_CALLBACK_MESSAGE_LOG);


  $google_answer = tep_db_fetch_array(tep_db_query("SELECT go.google_order_number, go.order_amount, o.customers_email_address, gc.buyer_id, o.customers_id
								  FROM " . $googlepayment->table_order . " go 
								  inner join " . TABLE_ORDERS . " o on go.orders_id = o.orders_id
								  inner join " . $googlepayment->table_name . " gc on gc.customers_id = o.customers_id
								  WHERE go.orders_id = '" . (int)$oID ."'
								  group by o.customers_id order by o.orders_id desc"));

  $google_order = $google_answer['google_order_number'];  
  $amount = $google_answer['order_amount'];

  list($curl_status,) = $Grequest->SendDeliverOrder($google_order, $carrier,
						  $tracking_no, ($cust_notify==1)?"true":"false");
  list($curl_status,) = $Grequest->SendArchiveOrder($google_order);
}

but this doesnt seem to work... anyone got any quick ideas?

Link to comment
Share on other sites

Hi

 

If you say it does work can you post all the code over as many pages as it need to prove you case? that would help us and not all these post just saying it does work.

 

No need to post new code, just use the google version off the google server as I discussed many posts before... If you cannot get it to work then I would suggest you contact google like I said before and explain your specific problems, then post your solutions in the forum so it benefits everyone instead of sitting on your lazy ass and complaining. Also FYI last I knew google checkout only works for the US, and your profile says you are from the UK, that might be part of your problem but you didn't take the time to read the directions so you wouldn't know that...

Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

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