Access to add and change pages is restricted. See: https://cwiki.apache.org/confluence/display/OFBIZ/Wiki+access

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Get Code

Download the most recent patch titled googleCheckout.patch from OFBIZ-71

Apply the patch to your development deployment.  This will create several folders and files under hot-deploy/googleCheckout 

SSL

Since we will be consuming services from Google over secure socket layer (SSL) we will need to add two certificates from google to our trusted key store, otherwise our call to Google will fail with the following error:

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target 


Obtain and Compile InstallCert.java

Andreas Sterbenz created a small program that will obtain the ssl certificate from a website and place it into keystore in the current directory.  There is probably an easier way of doing this.  This is just the first answer I came across that worked.

  • Download the program from Andreas's Blog.
  • Compile
    % javac InstallCert.java
    

Obtain SSL Certificates

  • Obtain the SSL certificate for sandbox.google.com
    % java InstallCert sandbox.google.com
    

  • Obtain the SSL certificatate for checkout.google.com
    % java InstallCert checkout.google.com
    

Export Certificates to file

  • Export the certificate for sandbox.google.com from the keystore created by InstallCert
    % keytool -export -file sandbox.cer -alias sandbox.google.com-1 -keystore jssecacerts -storepass changeit
    

  • Export the certificate for checkout.google.com from the keystore created by InstallCert
    % keytool -export -file checkout.cer -alias checkout.google.com-1 -keystore jssecacerts -storepass changeit
    

  • Copy both certificates to framework/base/config/
    % copy *.cer %OFBIZ_HOME%/framework/base/config
    

  • Change into the correct directory
    % cd %OFBIZ_HOME%/framework/base/config
    

Import Certificates into OFBiz Trust Store

  • Import the certificate for sandbox.google.com into ofbiztrust.jks
    % keytool -import -alias sandbox.google.com-1 -file sandbox.cer -keypass changeit -storetype jks -keystore ofbiztrust.jks -storepass changeit
    

  • Import the certificate for checkout.google.com into ofbiztrust.jks
    % keytool -import -alias sandbox.google.com-1 -file sandbox.cer -keypass changeit -storetype jks -keystore ofbiztrust.jks -storepass changeit
    

Configure

Configurations are don in hot-deploy/googlecheckout/config/googleCheckout.properties

##your merchantId - sandbox will be different than live

Use 

  • After updating the properties file, restart OFBiz
  • in your ecomerce application, create a request-uri; for example:
    <request-map uri="google">
      <security auth="false" https="false"/>
      <event type="service" invoke="transmitRequest"/>
      <response type="view" name="success" value="google"/>
    </request-map>
    



  • create a view-map that points to the redirect screen in the google component:
    <view-map name="google" type="screen" page="component://googlecheckout/widget/GoogleCheckoutScreens.xml#redirect"/>
    



  • place an link with the google checkout button that points to your google uri next to where ever you have a checkout link
    <a href="<@ofbizUrl>google</@ofbizUrl>"><img src="googleButton.gif"/></a>
    



  • No labels