Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Integrating Google Checkout

 

 


gdl2306
New User

Jun 6, 2008, 3:21 AM

Post #1 of 6 (629 views)
Shortcut
Integrating Google Checkout Can't Post

Hi,
I am attempting to create a product template which allow users to create a few products that visitors can buy using google checkout. Each product needs some html to link to the checkout. I think what I need to do is create some system fields to hide this code from the (non technical) user who creates the product but is included in the product web page. Can anyone say whether this is possible and if so how to go about it?
Gerald


Dave
Staff / Moderator


Jun 6, 2008, 6:50 AM

Post #2 of 6 (621 views)
Shortcut
Re: [gdl2306] Integrating Google Checkout [In reply to] Can't Post

Hi Gerald, welcome to the CMS Builder forum! :)

The first step is to figure out the code to make google checkout work with a regular html page. The next step is to figure out how to automatically generate that code with CMS Builder.

Can you post an example of the html google checkout needs? I'll see if I can make any suggestions. I've done a few paypal integrations with CMS Builder and I imagine it's similar.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com


gdl2306
New User

Jun 6, 2008, 6:58 AM

Post #3 of 6 (620 views)
Shortcut
Re: [Dave] Integrating Google Checkout [In reply to] Can't Post

Thanks. Huge improvement to PageBuilder, by the way.

Google code per product is


<form method="POST"
action="https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/1234567890"
accept-charset="utf-8">

<input type="hidden" name="item_name_1" value="Peanut Butter"/>
<input type="hidden" name="item_description_1" value="Chunky peanut butter."/>
<input type="hidden" name="item_quantity_1" value="1"/>
<input type="hidden" name="item_price_1" value="3.99"/>
<input type="hidden" name="item_currency_1" value="USD"/>

<input type="hidden" name="ship_method_name_1" value="UPS Ground"/>
<input type="hidden" name="ship_method_price_1" value="10.99"/>

<input type="hidden" name="tax_rate" value="0.0875"/>
<input type="hidden" name="tax_us_state" value="NY"/>

<input type="hidden" name="_charset_"/>

<input type="image" name="Google Checkout" alt="Fast checkout through Google"
src="http://checkout.google.com/buttons/checkout.gif?merchant_id=1234567890&w=180&h=46&style=white&variant=text&loc=en_US"
height="46" width="180"/>

</form>

Gerald


Dave
Staff / Moderator


Jun 6, 2008, 9:11 AM

Post #4 of 6 (603 views)
Shortcut
Re: [gdl2306] Integrating Google Checkout [In reply to] Can't Post

Hi Gerald,

So what I'm thinking is you could just create fields for the values that you need to change. You probably have some of them setup already. In this case you'd need: name, description, price, and shipping (assuming it will always be UPS Ground"). It tax_rate and other values won't change we can leave those as is.

Then you'd insert those in the content as follows. Not that I'm using the PHP htmlspecialchars() function to encode the values so if there is a " in the value it doesn't break the tag. Also, I'll use the variable name $product, but feel free to use whatever your variable name is called.


Code
<form method="POST" 
action="https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/1234567890"
accept-charset="utf-8">

<input type="hidden" name="item_name_1" value="<?php echo htmlspecialchars($product['name']); ?>"/>
<input type="hidden" name="item_description_1" value="<?php echo htmlspecialchars($product['description']); ?>"/>
<input type="hidden" name="item_quantity_1" value="1"/>
<input type="hidden" name="item_price_1" value="<?php echo htmlspecialchars($product['price']); ?>"/>
<input type="hidden" name="item_currency_1" value="USD"/>

<input type="hidden" name="ship_method_name_1" value="UPS Ground"/>
<input type="hidden" name="ship_method_price_1" value="<?php echo htmlspecialchars($product['shipping']); ?>"/>

<input type="hidden" name="tax_rate" value="0.0875"/>
<input type="hidden" name="tax_us_state" value="NY"/>

<input type="hidden" name="_charset_"/>

<input type="image" name="Google Checkout" alt="Fast checkout through Google"
src="http://checkout.google.com/buttons/checkout.gif?merchant_id=1234567890&w=180&h=46&style=white&variant=text&loc=en_US"
height="46" width="180"/>

</form>


Does that example make sense? Give it a try and let me know if you have any questions or need more help!

Dave Edis - Senior Developer
interactivetools.com


gdl2306
New User

Jun 6, 2008, 9:58 AM

Post #5 of 6 (596 views)
Shortcut
Re: [Dave] Integrating Google Checkout [In reply to] Can't Post

Thanks Dave. Just realized I am being a bit thick as I can produce this code for every product by simply including it within php loops. Cheers. Gerald


Dave
Staff / Moderator


Jun 6, 2008, 10:10 AM

Post #6 of 6 (592 views)
Shortcut
Re: [gdl2306] Integrating Google Checkout [In reply to] Can't Post

No problem at all, we're here to help! :)

Dave Edis - Senior Developer
interactivetools.com

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4