Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: SVN trunk
    • Labels:
      None

      Description

      Hi,

      Google just released Google checkout, which much like paypal, provides a easy way for businesses to accept payments online. I recommend that it should be integrated with Ofbiz. This will add great value to ofbiz and make it easier for its adoption, just the way paypal does.

      More information on google checkout can be found at the following links:

      http://checkout.google.com/sell
      http://code.google.com/apis/checkout/
      http://code.google.com/apis/checkout/samples/Google_Checkout_Sample_Code_Java.html

      Thank you.

      rohit

      1. gcheckout.zip
        4.60 MB
        BJ Freeman
      2. gcheckout_jdk1.4.zip
        3.81 MB
        Rohit Sureka
      3. googCheckout.patch
        20 kB
        Chris Howe
      4. googCheckout.patch
        34 kB
        Chris Howe
      5. googCheckout.patch
        32 kB
        Chris Howe
      6. googCheckout.patch
        32 kB
        Chris Howe
      7. googCheckout.patch
        37 kB
        Chris Howe
      8. googCheckout.patch
        37 kB
        Chris Howe
      9. googCheckout.patch
        49 kB
        Chris Howe
      10. Google Checkout Screenshot.jpg
        147 kB
        Chris Howe

        Activity

        Hide
        Jacques Le Roux added a comment -

        Hi BJ,

        Yes I was surprised by your thanks inuser ML, it's Chris indeed. I only commited, is it still working ?

        Show
        Jacques Le Roux added a comment - Hi BJ, Yes I was surprised by your thanks inuser ML, it's Chris indeed. I only commited, is it still working ?
        Hide
        BJ Freeman added a comment -

        Not sure who to thank, Looks like chris.
        so thank you for the example of using minilang.

        Show
        BJ Freeman added a comment - Not sure who to thank, Looks like chris. so thank you for the example of using minilang.
        Hide
        Jacques Le Roux added a comment -

        Hi Chris,

        I finally commited in CTR mode the patch in trunk revision 584440. I had to put the recent licence header (also was missing in ftl files) and to replace some tabs, but I guess it's because this patch is old. I also added a readme file with a pointer to the doc in Confluence. FWIW, it's more visible now...

        Show
        Jacques Le Roux added a comment - Hi Chris, I finally commited in CTR mode the patch in trunk revision 584440. I had to put the recent licence header (also was missing in ftl files) and to replace some tabs, but I guess it's because this patch is old. I also added a readme file with a pointer to the doc in Confluence. FWIW, it's more visible now...
        Hide
        Jacques Le Roux added a comment -

        I will put a README to reference the link in Confluence...

        Show
        Jacques Le Roux added a comment - I will put a README to reference the link in Confluence...
        Hide
        Jacques Le Roux added a comment -

        Thanks Chris,

        So it looks like commiting googCheckout.patch would be a good idea (to easily let know that it exists). If nobody complains I will commit it in few days.

        Show
        Jacques Le Roux added a comment - Thanks Chris, So it looks like commiting googCheckout.patch would be a good idea (to easily let know that it exists). If nobody complains I will commit it in few days.
        Hide
        Chris Howe added a comment -

        I had finished what I was going to do with this and did a write up here: a while back.
        http://docs.ofbiz.org/display/OFBIZ/Google+Checkout+Integration

        Show
        Chris Howe added a comment - I had finished what I was going to do with this and did a write up here: a while back. http://docs.ofbiz.org/display/OFBIZ/Google+Checkout+Integration
        Hide
        Jacques Le Roux added a comment -

        Any news ?

        Show
        Jacques Le Roux added a comment - Any news ?
        Hide
        Chris Howe added a comment -

        To note, that's a screen shot of Google Checkout's Sandbox showing what the customer would see after pressing checkout out from an ofbiz site using google checkout, not ofbiz-sandbox on sf.net.

        I'll try to put together a write up in the next day or two, especially in regards to accepting checkout.google.com's ssl certificate into the trust store

        Show
        Chris Howe added a comment - To note, that's a screen shot of Google Checkout's Sandbox showing what the customer would see after pressing checkout out from an ofbiz site using google checkout, not ofbiz-sandbox on sf.net. I'll try to put together a write up in the next day or two, especially in regards to accepting checkout.google.com's ssl certificate into the trust store
        Hide
        Jacques Le Roux added a comment -

        Chris,

        The screen shot looks great, sorry no time for more :o)

        Show
        Jacques Le Roux added a comment - Chris, The screen shot looks great, sorry no time for more :o)
        Hide
        Chris Howe added a comment -

        Brings the Checkout to the point of posting to google, accepting the
        redirect and a screen to actually do the redirect. This is now at a point that is usable for basic needs, and easily expanded for the additional needs

        Still needs:
        1) to sign the cart
        2) add shipping options list
        3) add tax tables
        4) accept update notification/requests for charge avaailable, etc
        5) refactor xml creation to utilize pattern that usps uses instead of
        ftl
        6) support promotional discounts

        Show
        Chris Howe added a comment - Brings the Checkout to the point of posting to google, accepting the redirect and a screen to actually do the redirect. This is now at a point that is usable for basic needs, and easily expanded for the additional needs Still needs: 1) to sign the cart 2) add shipping options list 3) add tax tables 4) accept update notification/requests for charge avaailable, etc 5) refactor xml creation to utilize pattern that usps uses instead of ftl 6) support promotional discounts
        Hide
        Chris Howe added a comment -

        googCheckout.patch

        This patch replaces all others.

        Brings the service to the point where it submits the cart to Google and receives a response.

        The response will need to be parsed and return html with the re-direct information to the customer in the header.

        This requires that you import the certificate from sandbox.google.com to your ofbizcerts.jks keystore

        I used the tool from:
        http://blogs.sun.com/andreas/entry/no_more_unable_to_find
        to get the certificate then used java's keytool to export it from the keystore it created and import it into ofbizcerts.jks . I'm sure I went a long way about it, but it worked. If you need more information on how to deal with the ssl certificates, and are wanting to help finish this up, just ask. When this is complete I'll post a complete how to integration to the wiki.

        Show
        Chris Howe added a comment - googCheckout.patch This patch replaces all others. Brings the service to the point where it submits the cart to Google and receives a response. The response will need to be parsed and return html with the re-direct information to the customer in the header. This requires that you import the certificate from sandbox.google.com to your ofbizcerts.jks keystore I used the tool from: http://blogs.sun.com/andreas/entry/no_more_unable_to_find to get the certificate then used java's keytool to export it from the keystore it created and import it into ofbizcerts.jks . I'm sure I went a long way about it, but it worked. If you need more information on how to deal with the ssl certificates, and are wanting to help finish this up, just ask. When this is complete I'll post a complete how to integration to the wiki.
        Hide
        Chris Howe added a comment -

        googCheckout.patch

        Includes service that will output the xml necessary.

        still needs:
        encode
        sign
        taxTables
        shippingMethods

        Show
        Chris Howe added a comment - googCheckout.patch Includes service that will output the xml necessary. still needs: encode sign taxTables shippingMethods
        Hide
        Chris Howe added a comment -

        removed absolute path and apache grant

        Show
        Chris Howe added a comment - removed absolute path and apache grant
        Hide
        Chris Howe added a comment -

        removed absolute path

        Show
        Chris Howe added a comment - removed absolute path
        Hide
        Chris Howe added a comment -

        googCheckout.patch

        replaces previous patch with same name

        creates service and simple methods to populate template. shippingMethods and taxTables are incomplete

        Show
        Chris Howe added a comment - googCheckout.patch replaces previous patch with same name creates service and simple methods to populate template. shippingMethods and taxTables are incomplete
        Hide
        Chris Howe added a comment -

        googCheckout.patch

        I've changed my direction of how to implement this.

        It seems that all google wants is an XML sent over HTTP or HTTPS

        Since freemarker/screen widgets has done pretty well to create xml on the fly, I figure that will be much easier then messing working through all of the generic java (read "not with OFBiz in mind" sample stuff that's been attached to this issue so far.

        This patch should be able to create the XML template needed. The following, I believe, remains

        1) create a service to transform an OFBiz shopping cart into the variables needed in this template
        2) create a service to post this xml to google
        3) maybe encode/sign the xml prior to sending, (I keep glossing over that part)
        4) create the request uri to handle google's responses.

        I'm committing my improvements simultaneously to ofbiz-sandbox on sf.net . If this can be reviewed and committed to the specialpurpose app (or other appropriate place)before I get collaboration over there, I will take it down from there. So far, this is entirely my work. I'm more interested in getting this completed than the administrative work that might be required to transfer a joint work/outside project into Apache Ofbiz.

        Show
        Chris Howe added a comment - googCheckout.patch I've changed my direction of how to implement this. It seems that all google wants is an XML sent over HTTP or HTTPS Since freemarker/screen widgets has done pretty well to create xml on the fly, I figure that will be much easier then messing working through all of the generic java (read "not with OFBiz in mind" sample stuff that's been attached to this issue so far. This patch should be able to create the XML template needed. The following, I believe, remains 1) create a service to transform an OFBiz shopping cart into the variables needed in this template 2) create a service to post this xml to google 3) maybe encode/sign the xml prior to sending, (I keep glossing over that part) 4) create the request uri to handle google's responses. I'm committing my improvements simultaneously to ofbiz-sandbox on sf.net . If this can be reviewed and committed to the specialpurpose app (or other appropriate place)before I get collaboration over there, I will take it down from there. So far, this is entirely my work. I'm more interested in getting this completed than the administrative work that might be required to transfer a joint work/outside project into Apache Ofbiz.
        Hide
        Chris Howe added a comment -

        those are all variables that google is asking for in their api

        Show
        Chris Howe added a comment - those are all variables that google is asking for in their api
        Hide
        G Venkata Phanindra added a comment -

        Hi,
        I am unable to find the following information you are trying to provide with the Code above.
        Where will this serveice get invoked.
        I could not get the following lines of code also.it will be great help if u add more comments to the code. explainning how to integrate with google check out.

        ShippingMethodsType methods = ; //haven't looked into what this is made up of yet
        DefaultTaxTable defaultTaxTable = ; //haven't looked into what this is made up of yet
        List alterTaxTableList = ; //haven't looked into what this is made up of yet
        MerchantCalculations couponInfo = ; //haven't looked into what this is made up of yet
        String editCartUrl = ; //haven't looked into what this is made up of yet
        String continueShoppingUrl = ; //haven't looked into what this is made up of yet

        Thanks and Regards,

        G venkata phanindra

        Show
        G Venkata Phanindra added a comment - Hi, I am unable to find the following information you are trying to provide with the Code above. Where will this serveice get invoked. I could not get the following lines of code also.it will be great help if u add more comments to the code. explainning how to integrate with google check out. ShippingMethodsType methods = ; //haven't looked into what this is made up of yet DefaultTaxTable defaultTaxTable = ; //haven't looked into what this is made up of yet List alterTaxTableList = ; //haven't looked into what this is made up of yet MerchantCalculations couponInfo = ; //haven't looked into what this is made up of yet String editCartUrl = ; //haven't looked into what this is made up of yet String continueShoppingUrl = ; //haven't looked into what this is made up of yet Thanks and Regards, G venkata phanindra
        Hide
        Chris Howe added a comment -

        I was going to walk Rohit through this but we couldn't get Writely setup quickly enough. This should get whoever might want to work on this about 75% to creating the checkout cart document (after you have the document, you still need to encode it and other stuff). I would do this as a patch, but it is incomplete and hasn't even been tested with a color editor.

        1) Add paymentService to ProductStorePaymentSetting
        2) Add paymentService to service_paymentmethod.xml
        <service name="googleCheckout" engine="java" location="org.ofbiz.accounting.payment.GoogleCheckoutServices" invoke="googleCheckoutProcessor">
        <description>Google Checkout Processing Interface</description>
        <implements service="paymentProcessInterface"/>
        <!-- any additional attributes that Google Checkout Requires, merchant private data?? -->
        </service>

        (
        ShippingMethodsType methods, DefaultTaxTable defaultTaxTable,
        List alterTaxTableList, MerchantCalculations couponInfo,
        String editCartUrl, String continueShoppingUrl)

        GoogleCheckoutServices.java

        package org.ofbiz.accounting.payment;

        import com.google.checkout.*; // this probably needs to be specific to what you're calling in the google api as well as adding the classes that are called from ofbiz

        public static Map googleCheckoutProcessor(DispatchContext dctx, Map context) {
        LocalDispatcher dispatcher = dctx.getDispatcher();
        GenericDelegator delegator = dctx.getDelegator();
        List orderItems = context.get("orderItems");
        List googleItemList = (List) new List();
        Iterator orderItemsIter = orderItems.iterator();
        while (orderItemsIter.hasNext()){
        GenericValue orderItem = (GenericValue) orderItemsIter.next();
        String itemName = orderItem.getString("productId");
        String itemDesc = orderItem.getString("description");
        Double qty = orderItem.getDouble("quantity");
        int quantity = qty.intValue();
        float unitPrice = orderItem.getDouble("unitPrice");
        String currency = "USD" // would be orderItem.getString("currency"); but google checkout only supports USD at the current time
        /* taxTableSelector = null;
        privateItemData = null;
        */
        Item googleItem = CheckoutCartBuilder.createShoppingItem(itemName, itemDesc, quantity, unitPrice, currency, null, null);
        if (googleItem != null)

        { googleItemList.add(googleItem); }

        }
        ShoppingCart googleCart = CheckoutCartBuilder.createShoppingCart(googleItemList, null, null);

        (

        ShippingMethodsType methods = ; //haven't looked into what this is made up of yet
        DefaultTaxTable defaultTaxTable = ; //haven't looked into what this is made up of yet
        List alterTaxTableList = ; //haven't looked into what this is made up of yet
        MerchantCalculations couponInfo = ; //haven't looked into what this is made up of yet
        String editCartUrl = ; //haven't looked into what this is made up of yet
        String continueShoppingUrl = ; //haven't looked into what this is made up of yet

        MerchantCheckoutFlowSupport merchantSupport = CheckoutCartBuilder.createMerchantSupport(methods, defaultTaxTable,
        alterTaxTableList, couponInfo, editCartUrl, continueShoppingUrl);
        Document googleDoc = CheckoutCartBuilder.createCheckoutShoppingCart(googleCart, merchantSupport);
        }

        Show
        Chris Howe added a comment - I was going to walk Rohit through this but we couldn't get Writely setup quickly enough. This should get whoever might want to work on this about 75% to creating the checkout cart document (after you have the document, you still need to encode it and other stuff). I would do this as a patch, but it is incomplete and hasn't even been tested with a color editor. 1) Add paymentService to ProductStorePaymentSetting 2) Add paymentService to service_paymentmethod.xml <service name="googleCheckout" engine="java" location="org.ofbiz.accounting.payment.GoogleCheckoutServices" invoke="googleCheckoutProcessor"> <description>Google Checkout Processing Interface</description> <implements service="paymentProcessInterface"/> <!-- any additional attributes that Google Checkout Requires, merchant private data?? --> </service> ( ShippingMethodsType methods, DefaultTaxTable defaultTaxTable, List alterTaxTableList, MerchantCalculations couponInfo, String editCartUrl, String continueShoppingUrl) GoogleCheckoutServices.java package org.ofbiz.accounting.payment; import com.google.checkout.*; // this probably needs to be specific to what you're calling in the google api as well as adding the classes that are called from ofbiz public static Map googleCheckoutProcessor(DispatchContext dctx, Map context) { LocalDispatcher dispatcher = dctx.getDispatcher(); GenericDelegator delegator = dctx.getDelegator(); List orderItems = context.get("orderItems"); List googleItemList = (List) new List(); Iterator orderItemsIter = orderItems.iterator(); while (orderItemsIter.hasNext()){ GenericValue orderItem = (GenericValue) orderItemsIter.next(); String itemName = orderItem.getString("productId"); String itemDesc = orderItem.getString("description"); Double qty = orderItem.getDouble("quantity"); int quantity = qty.intValue(); float unitPrice = orderItem.getDouble("unitPrice"); String currency = "USD" // would be orderItem.getString("currency"); but google checkout only supports USD at the current time /* taxTableSelector = null; privateItemData = null; */ Item googleItem = CheckoutCartBuilder.createShoppingItem(itemName, itemDesc, quantity, unitPrice, currency, null, null); if (googleItem != null) { googleItemList.add(googleItem); } } ShoppingCart googleCart = CheckoutCartBuilder.createShoppingCart(googleItemList, null, null); ( ShippingMethodsType methods = ; //haven't looked into what this is made up of yet DefaultTaxTable defaultTaxTable = ; //haven't looked into what this is made up of yet List alterTaxTableList = ; //haven't looked into what this is made up of yet MerchantCalculations couponInfo = ; //haven't looked into what this is made up of yet String editCartUrl = ; //haven't looked into what this is made up of yet String continueShoppingUrl = ; //haven't looked into what this is made up of yet MerchantCheckoutFlowSupport merchantSupport = CheckoutCartBuilder.createMerchantSupport(methods, defaultTaxTable, alterTaxTableList, couponInfo, editCartUrl, continueShoppingUrl); Document googleDoc = CheckoutCartBuilder.createCheckoutShoppingCart(googleCart, merchantSupport); }
        Hide
        Rohit Sureka added a comment -

        hi,

        Google has recently released its sample code compatible with JDK1.4. i guess this will resolve some of the compatibilty issues previously discussed relating to the jdk 1.5 code from google.

        rohit

        Show
        Rohit Sureka added a comment - hi, Google has recently released its sample code compatible with JDK1.4. i guess this will resolve some of the compatibilty issues previously discussed relating to the jdk 1.5 code from google. rohit
        Hide
        BJ Freeman added a comment -

        This was the gcheck.war from
        http://code.google.com/apis/checkout/samplecode.html
        i renamed it to a zip file so it could be easily exported.

        Show
        BJ Freeman added a comment - This was the gcheck.war from http://code.google.com/apis/checkout/samplecode.html i renamed it to a zip file so it could be easily exported.
        Hide
        BJ Freeman added a comment -

        I am attaching the google java code.
        i renamed the war file to zip.
        it has the java code in it as weil as the classes.
        a lot of thier code is not needed., but here for refernce.

        Show
        BJ Freeman added a comment - I am attaching the google java code. i renamed the war file to zip. it has the java code in it as weil as the classes. a lot of thier code is not needed., but here for refernce.

          People

          • Assignee:
            Jacques Le Roux
            Reporter:
            Rohit Sureka
          • Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development