Google Checkout with ColdFusion
This article is aimed at webmasters whose sites are on shared ColdFusion 6.1 or lower hosting plans, in which they are unable to install custom tags. The reason Google Checkout remains difficult for that group is because the CFHMAC ColdFusion Custom Tag is required to be able to encrypt the shopping cart's contents before sending it to Google. I have come up with a somewhat decent workaround, which requies that PHP be installed on the server (which most shared ColdFusion plans do offer).
This hack requires that you make a CFHTTP call to a PHP script. The PHP script can be readily downloaded from Google Checkouts site. It contains the full code necessary to create a cart and send it to google. Simply call that PHP script, then output its contents:
This hack requires that you make a CFHTTP call to a PHP script. The PHP script can be readily downloaded from Google Checkouts site. It contains the full code necessary to create a cart and send it to google. Simply call that PHP script, then output its contents:
<!--- create the cart, your code may differ --->Google Checkout
<cfset size = ArrayLen(qString)>
<cfset cartString = "">
<cfloop index = "i" from="1" to="#size#">
<cfset cartString = cartString & "item" & i & "=" & qString[i] & "&">
</cfloop>
<!--- add the shipping charge to the cart --->
<cfset cartString = cartString & "shipping=" & shipping>
<!--- call the PHP script, which creates the Google Checkout Button --->
<cfhttp url="http://dev.mysite.com/dev/cart/google/php/cart.php?#cartString#">
<!--- Output the Google Checkout button on the page --->
<cfoutput>
#cfhttp.fileContent#
</cfoutput>
Need assistance with your project? Universal Web Services can help.
Contact us to request a quote.

