[ 
http://issues.apache.org/jira/browse/OFBIZ-71?page=comments#action_12425689 ] 
            
Chris Howe commented on OFBIZ-71:
---------------------------------

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);
}

> Ofbiz with google checkout.
> ---------------------------
>
>                 Key: OFBIZ-71
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-71
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: New Feature
>          Components: ecommerce
>            Reporter: Rohit Sureka
>         Attachments: gcheckout.zip, gcheckout_jdk1.4.zip
>
>
> 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  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to