Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

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:

Panel

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 


...

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

Obtain SSL Certificates

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

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

Export Certificates to file

  • Export the certificate for sandbox.google.com from the keystore created by InstallCert
    Code Block
    
    % 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
    Code Block
    
    % keytool -export -file checkout.cer -alias checkout.google.com-1 -keystore jssecacerts -storepass changeit
    

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

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

Import Certificates into OFBiz Trust Store

  • Import the certificate for sandbox.google.com into ofbiztrust.jks% keytool jks
    Code Block
    
    % 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 jks
    Code Block
    
    % 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

...

...

  • After updating the properties file, restart OFBiz
  • in your ecomerce application, create a request-uri; for example:
    Code Block
    
    <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:
    Code Block
    
    <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
    Code Block
    
    <a href="<@ofbizUrl>google</@ofbizUrl>"><img src="googleButton.gif"/></a>