/** * Copyright (C) 2007 Powersellersunite.com. * Written by Bob Lee. All rights reserved. * Please contact info@powersellersunite.com for licensing or purchase * Or visit http://www.powersellersunite.com/googlecheckout.php * Do not remove this from the file. * 05/05/2008 Version 3.0 * Level 2 Integration see https://checkout.google.com/support/sell/bin/answer.py?answer=42917 * * Rewritten for clarity by websnail * * */ Joomla VirtueMart - Google Checkout Payments Module -------------------------------------- This Joomla VirtueMart payment module allows you to easily add Google Checkout as a payment option to your website. Customers can click on the Google Checkout Buy Now button and quickly pay for items in their cart. COMPATABILITY ============= This module is currently supports VirtueMart 1.0.x. and 1.1.x. INSTALLATION ----------------- If you've extracted the files correctly you should already have the correct structure so just copy the "administrator" folder into the root (base) folder for your Joomla installation. Ref: ==== /administrator/components/com_virtuemart/classes/payment/ps_googlecheckout.cfg.php /administrator/components/com_virtuemart/classes/payment/ps_googlecheckout.php /administrator/components/com_virtuemart/classes/payment/googlecheckout/googlecheckout.php [UPLOAD IN BINARY] /administrator/components/com_virtuemart/classes/payment/googlecheckout/googleerror.log [CHMOD 766] /administrator/components/com_virtuemart/classes/payment/googlecheckout/googlemessage.log [CHMOD 766] /administrator/components/com_virtuemart/classes/payment/googlecheckout/license.php [UPLOAD IN BINARY, (Will arrive in seperate email)] /administrator/components/com_virtuemart/classes/payment/googlecheckout/callback/htaccess.php /administrator/components/com_virtuemart/classes/payment/googlecheckout/callback/merchant-calculation-callback.php /administrator/components/com_virtuemart/classes/payment/googlecheckout/callback/new-order-notification.php /administrator/components/com_virtuemart/classes/payment/googlecheckout/callback/order-state-change-notification_CANCELLED.php /administrator/components/com_virtuemart/classes/payment/googlecheckout/callback/order-state-change-notification_CHARGED.php /administrator/components/com_virtuemart/classes/payment/googlecheckout/callback/order-state-change-notification_DELIVERED.php /administrator/components/com_virtuemart/classes/payment/googlecheckout/callback/responsehandler_gc.php [UPLOAD IN BINARY] /administrator/components/com_virtuemart/classes/payment/googlecheckout/ioncube/* [See below] /administrator/components/com_virtuemart/classes/payment/googlecheckout/library/googlecart.php /administrator/components/com_virtuemart/classes/payment/googlecheckout/library/googleitem.php /administrator/components/com_virtuemart/classes/payment/googlecheckout/library/googlelog.php /administrator/components/com_virtuemart/classes/payment/googlecheckout/library/googlemerchantcalculations.php /administrator/components/com_virtuemart/classes/payment/googlecheckout/library/googlerequest.php /administrator/components/com_virtuemart/classes/payment/googlecheckout/library/googleresponse.php /administrator/components/com_virtuemart/classes/payment/googlecheckout/library/googleresult.php /administrator/components/com_virtuemart/classes/payment/googlecheckout/library/googleshipping.php /administrator/components/com_virtuemart/classes/payment/googlecheckout/library/googletax.php /administrator/components/com_virtuemart/classes/payment/googlecheckout/library/xml-processing/gc_xmlbuilder.php /administrator/components/com_virtuemart/classes/payment/googlecheckout/library/xml-processing/gc_xmlparser.php /administrator/components/com_virtuemart/classes/payment/googlecheckout/library/xml-processing/xmlbuilder.php /administrator/components/com_virtuemart/classes/payment/googlecheckout/library/xml-processing/xmlparser.php /administrator/components/com_virtuemart/classes/shipping/standard_shipping_gc.php /administrator/components/com_virtuemart/html/* [See MODIFICATIONS For VirtueMart 1.0.x. below] /components/com_virtuemart/themes/default/templates/* [See MODIFICATIONS For VirtueMart 1.1.x. below] IMPORTANT: ---------- The files: - googlecheckout.php, - responsehandler_gc.php, - license.php MUST be uploaded in BINARY mode (Not ASCII) I suggest using Joomlxplorer to upload those files since it will automatically set them to BINARY mode If using another FTP client specify BINARY mode when you are uploading these files. (For locations see the 'Ref:' table above) =============== MODIFICATIONS For VirtueMart 1.0.x. (file edits) The files in this folder: /administrator/components/com_virtuemart/html/ Have already been modified for 1.0.15. If you are using a different version or already customized those files please follow the manual modifications below. shop.cart.php and checkout.index.php are being distributed with this package as free code under Joomla/VirtueMart GNU license. # #-----[ OPEN shop.cart.php]------------------------------------------ #-----[IE: /administrator/components/com_virtuemart/html/shop.cart.php ] # # #-----[ FIND ]------------------------------------------ # _PHPSHOP_CHECKOUT_TITLE ?> # #-----[ AFTER, ADD ]------------------------------------------ # # #-----[ OPEN checkout.index.php]------------------------------------------ #-----[IE: /administrator/components/com_virtuemart/html/checkout.index.php ] # # #-----[ FIND ]------------------------------------------ # elseif ($checkout_this_step == CHECK_OUT_GET_FINAL_CONFIRMATION) { ps_checkout::final_info(); ?>
# #-----[ AFTER, ADD ]------------------------------------------ # # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # MODIFICATIONS For VirtueMart 1.1.x. (file edits) The files in this folder: /components/com_virtuemart/themes/default/templates/* Have already been modified for 1.1.0. If you are using a different version or already customized those files please follow the manual modifications below. list_payment_methods.tpl.php and shop.cart.tpl.php are being distributed with this package as free code under Joomla/VirtueMart GNU license. # #-----[ OPEN list_payment_methods.tpl.php]------------------------------------------ #-----[IE: /components/com_virtuemart/themes/default/templates/checkout/list_payment_methods.tpl.php ] # # #-----[ FIND ]------------------------------------------ # include(PAGEPATH. 'basket.php'); # #-----[ AFTER, ADD ]------------------------------------------ # include($mosConfig_absolute_path.'/administrator/components/com_virtuemart/classes/payment/googlecheckout/googlecheckout.php'); # #-----[ OPEN shop.cart.tpl.php]------------------------------------------ #-----[IE: /components/com_virtuemart/themes/default/templates/pages/shop.cart.tpl.php ] # # #-----[ FIND ]------------------------------------------ # else { echo vmCommonHTML::hyperlink( $href, $text, '', $text, $class_att ); } # #-----[ AFTER, ADD ]------------------------------------------ # include($mosConfig_absolute_path.'/administrator/components/com_virtuemart/classes/payment/googlecheckout/googlecheckout.php'); # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # FILE PERMISSIONS ================ These folders need to made writeable \administrator\components\com_VirtueMart\classes\payment\ps_googlecheckout.cfg.php \administrator\components\com_VirtueMart\classes\payment\googlecheckout\googlemessage.log \administrator\components\com_VirtueMart\classes\payment\googlecheckout\googleerror.log You can do this in Shell (if available) or using your FTP client to: CHMOD 766 ... the files. Hint: Logging ============= If you turn on "Write to Log" in the Google Checkout module configuration you can view the xml information being passed between VirtueMart and Google checkout by looking at googlemessage.log and any errors at googleerror.log INSTALL SQL =========== You will need to run the SQL command found in: add_googlecheckout.sql ...to be able to select and use this mod. If you're unsure how to do this, please see this support thread: http://www.powersellersunite.com/viewtopic.php?t=11326 IMPORTANT: If your Joomla/Mambo installation uses a different table prefix to the default (ie: "jos_" ) you will need edit the sql command to use the appropriate prefix instead. IONCUBE REQUIRED ================ Key parts of this script are encrypted using IonCube as a result this module requires the ioncube loaders which are already bundled with this package. If you have not already installed IonCube on your server or it is not already available you will need to install it. Information on how to do this is provided in the file here: \administrator\components\com_virtuemart\classes\payment\googlecheckout\ioncube\README FINISHING OFF ============= Once you've installed the module successfully you will need to setup your google checkout account Create either: - a Google checkout PRODUCTION account at http://checkout.google.com OR - SANDBOX account at http://sandbox.google.com/checkout (The latter is useful for initial testing and debugging the module) Under your Google Checkout Settings tab - Choose "integration" - Make a note of your Merchant ID and key for later (see below) - Choose the "For extra security, my company will only post digitally signed XML shopping trolleys" or set the "Callback method" to XML - Set "API callback URL:" https:///administrator/components/com_virtuemart/classes/payment/googlecheckout/callback/responsehandler_gc.php NOTE: You will need to update your API callback URL if you are upgrading from version 2.0 For further reference see: https://checkout.google.com/support/sell/bin/answer.py?answer=42928 Now visit your Joomla Admin page: - Locate: Store > List Payment Methods - Click on "GoogleCheckout" - Fill out the fields required with your Google Merchant ID and Google Merchant Key noted earlier. - Save and away you go. COMMON MISTAKES =============== - If you get an error with the module. Make sure you uploaded the files below in BINARY mode: googlecheckout.php responsehandler_gc.php license.php - Missing or incorrect Google vendor ID and Google merchant key - Using the incorrect server "sandbox" or "production" with the current Google vendor ID and Google merchant key - Tax does not calculate. Make sure you have a tax rate set in VirtueMart. MORE HELP? ========== If you're still having problems visit our support forum http://www.powersellersunite.com/viewforum.php?f=59