Installing a payment plug-in

To install an custom payment plug-in into the Rational Application Developer workspace, follow these directions. The instructions use the example of a plug-in called SamplePlugin.

Procedure

  1. Stop the WebSphere Commerce Test Server.
  2. Import the plug-in EJB JAR file for the plug-in you want to install in your workspace:
    OptionDescription
    Binary code If the custom plug-in code is available in binary form (a plug-in JAR file was provided), import the plug-in EJB JAR file into the workspace as an EJB project and the plug-in module should be automatically added into the WebSphere Commerce Server.
    Source code If the custom plug-in code is available as source code, you can do either of the following options, although the first one is recommended:
    • Import the payment plug-in EJB files into the WebSphereCommerceServerExtensionsData project. The WebSphereCommerceServerExtensionsData project is a predefined project for customized enterprise beans that is available to you for generating deployed code for the lightweight test environment.
    • Create a new EJB project for the payment plug-in in the WebSphere Commerce Developer workspace. Then, import the plug-in source code into this new EJB project.
    • Add any JAR files that the payment plug-in project depends on into the plug-in project's build path. The JAR files provide a set of classes a payment plug-in developer will need to develop a payment plug-in
  3. If the plug-in came as source code, build the plug-in project.
  4. Generate the plug-in EJB deployment code and rebuild it.
  5. Copy the plug-in deployment descriptor from the EJB plug-in project (or location where the file has been provided) into the ppc\plugins configuration directory. Create a subdirectory with the plug-in name. For example:
    • WC_eardir\xml\config\payments\ppc\plugins\SamplePlugin\PluginDeployment.xml
  6. Ensure that the name of the plug-in inside the deployment descriptor matches the name of the directory in which you placed the deployment descriptor.
  7. Add the following lines to the PaymentSystemPluginMapping.xml file as shown. The file location is: WC_eardir\xml\config\payments\ppc\plugins\PaymentSystemPluginMapping.xml.
    <PaymentSystemName name="SampleSystem" >
      <Mapping paymentConfigurationId="default"
      PluginName="SamplePlugin" >
      </Mapping>
      </PaymentSystemName> 
    

    This creates a mapping between a system name called SampleSystem to the plug-in SamplePlugin you just imported into your directory.

  8. Update the payment rules configuration so that a payment method is mapped into the payment system name SampleSystem, as you have defined in step 5.
  9. Start the WebSphere Commerce Test Server.
  10. To verify successful installation, deploy the plug-in and place a test order using it. To deploy the plug-in:
    1. Start WebSphere Commerce Developer.
    2. Open the Java EE perspective.
    3. Select Enterprise Applications > WC > Deployment Descriptor.
    4. Select the Module tab.
    5. Under Modules, click Add, select the module for payment plug-in, and click Finish.
    6. Right-click the WebSphere Commerce Test Server and select Publish.
  11. Stop WebSphere Commerce .
  12. Packaging custom Java EE assets.
    Package and deploy the entire EJB Modules using the Single Module update. Do not use partial application.
  13. Deploy the changed assets.