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
- Stop the WebSphere Commerce Test Server.
-
Import the plug-in EJB JAR file for the plug-in you want to install in your workspace:
Option Description 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
- If the plug-in came as source code, build the plug-in project.
- Generate the plug-in EJB deployment code and rebuild it.
-
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
- 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.
-
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.
-
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. - Start the WebSphere Commerce Test Server.
-
To verify successful installation, deploy the plug-in and place a test order using it. To
deploy the plug-in:
- Start WebSphere Commerce Developer.
- Open the Java EE perspective.
- Select .
- Select the Module tab.
- Under Modules, click Add, select the module for payment plug-in, and click Finish.
- Right-click the WebSphere Commerce Test Server and select Publish.
- Stop WebSphere Commerce .
-
Packaging custom Java EE assets.
Package and deploy the entire EJB Modules using the Single Module update. Do not use partial application.
- Deploy the changed assets.