• Welcome to KonaKart Community Forum. Please login or sign up.
 

Help needed to hook up Google Checkout via [ Google Checkout's HTML API ]

Started by tomtom, January 01, 2008, 09:14:37 am

Previous topic - Next topic

tomtom

Hi,
    Can someone please give me some pointer on what i need to do in
order to use google checkout html api integrated into konakart ?  ;D

I believe the actual  google checkout html api form posting will need to happen at
this page:

http://domain/konakart/CheckoutDelivery.do

I assume that i will need to pass whatever info i have at the CheckoutDelivery.do
page as hidden form fields to google when the customer click on the google checkout button.

I took a look at google doc for html api version: http://code.google.com/apis/checkout/developer/google_checkout_html_api.html#integration_overview

and i presume i need to add a form posting integrated to CheckoutDelivery.do page.

==============================
<form method="POST" action="https://sandbox.google.com/checkout/cws/v2/Merchant/1234567890/checkoutForm"; 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="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://sandbox.google.com/checkout/buttons/checkout.gif?merchant_id=1234567890&w=180&h=46&style=white&variant=text&loc=en_US";
height="46" width="180"/>

</form>
==============================

If this is true, can someone please give me some starting pointer on what i need to change ?
I presume i need to make some jsp file changes and some config file changes but before i start to implement it base on my understanding, i like to get some expert advice first before i start.

I do appreciate your help and expertise guidance on this.  ;D
Thanks again for your help on this   ;D


tomtom :P

pete

Hi Tomtom,

I'm no expert on Google Checkout (GC) but here are some pointers on what you may need to do:

Once you have all of the shipping quotes (CheckoutDeliveryAction) you need to pass these along with the basket information to GC in a form similar to the one you metioned in your post. This form will have to be created dynamically in a JSP. You will need to modify struts-config.xml to change the navigation since you don't want to show a checkout payment and checkout confirmation page.

At this point KonaKart will not have saved the order so if you want KonaKart to keep a track of the order you will need to save it before passing control to GC. Otherwise I suppose you can do all of your order processing through GC and never save any orders in the KonaKart database.

Good luck, and if you get it working please post a link to your web site since it may be of interest to other KonaKart users.

-Pete

tomtom

Thanks for the response.

I decided to take this approach which you suggested below:
"Otherwise I suppose you can do all of your order processing through GC and never save any orders in the KonaKart database."

If this is the case, i believe the dynamic jsp changes that need to happen is here:
EditCartBody.jsp

I like to get your expertise on some of the questions that comes up base on this changes above:
a) Is this the right place to integrate GC at the EditCartBody.jsp ? If not, please give me a better suggestion if possible.  ;D

b) Here is what i think the EditCartBody.jsp page would look like:

What's in my cart?
Remove     Product(s)     Qty.     Total
                    Item # 1         2         $1.00
                    Item # 2         1         $2.00

Update Continue-Shopping            GoogleCheckoutBuyButton

Since i'm using google checkout button, how can i still make the "Update" and the "Continue-Shopping" action button work since their
action in the form is different and i can only have one form posting?

I guess i'm not so worry about the "Continue-Shopping" action button since i can have just a link instead of a action button.
I'm more concern of the fact that once i integrate GC in this page, the "Update" action button will not work for the remove item functionality. Any suggestion here will be really appreciated   ;D

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

Konakart post action form:
<html:form action="/EditCartSubmit.do">