LOC (Line of credit) plug-in
The LOC plug-in enables merchants to use lines of credit as a payment method. It enables buyers to delay the payment settlement for orders and is intended to integrate with accounts receivable systems used by customers. The LOC plug-in mimics the function of an actual line of credit. By default, it does not connect to an accounts receivable system. To connect to an account receivable system, you must write your own version of the plug-in.
In a B2B store, the contract terms and conditions allow payments or refunds using a credit line if the business account has a credit line. The creation, modification, or deletion of the credit line is managed by a business account in HCL Commerce.
To use a credit line as a payment method, a buyer negotiates with a seller and creates an account with the seller in HCL Commerce with the appropriate credit line settings. When a buyer places an order in a store and specifies the line of credit payment method, the account is checked to see if active credit line exists between the buyer and seller. If the credit line is active, the payment instruction is recorded for the order and payment is authorized. The credit line is checked to ensure that it is still active when the order is fulfilled, when the deposit for the payment occurs, and when a refund is issued. The account holder is responsible for payment settlement on an outstanding balance on a credit line. If a credit line is used for payment, the seller debits the account for an order at the time of payment capture and the account is credited during payment settlement. To enable a credit line for a business account, refer to Enabling a credit line for a B2B store.
Processing flow
The following scenario summarizes how the LOC plug-in handles credit-line transactions:
- A customer logs in to a B2B store, browses a catalog, and adds an item to a shopping cart. The price is defined by a contract and the contract includes an account with a defined credit line. The credit line is active.
- The customer proceeds to check out and sees that there is a credit line option as a payment method. The customer selects LOC as the payment method.
- The customer submits the order.
- The Payment rules engine creates a payment instruction in the database.
- The Payment plug-in controller identifies the LOC plug-in as the plug-in to use by checking the PaymentSystemPluginMapping.xml configuration file. This configuration file identifies the plug-in to use for a specific payment system and payment configuration ID. A store is associated with a payment configuration ID in the POLICY database table.
- The LOC plug-in checks if the required data is included in the payment instruction. (If data is missing or incorrect the plug-in produces an invalid parameter error.) The data is included so the payment instruction is considered valid and the Payment plug-in controller performs the approve transaction.
- A new payment is created in the database.
- The LOC plug-in checks the parameters.
- The database is updated with information received from the LOC plug-in. The Payment plug-in controller returns an indication that the payment was approved successfully.
- The customer receives a confirmation message Order has been successfully processed.
Contents and location
The LOC plug-in package contains:
- A stateless session bean:
- com.ibm.commerce.payments.plugin.loc.beans.LOCPluginBean
- com.ibm.commerce.payments.plugin.loc.beans.LOCPlugin
- com.ibm.commerce.payments.plugin.loc.beans.LOCPluginHome
- PluginDeployment.xml - the payment plug-in
deployment descriptor for the LOC plug-in
The following XML file is the deployment descriptor that is used by the LOC plug-in.
<?xml version="1.0" encoding="UTF-8"?> <Plugin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../base/PaymentPlugin.xsd"> <PluginInformation jndi="ejb/com/ibm/commerce/payments/plugin/loc/beans/LOCPluginHome" home="com.ibm.commerce.payments.plugin.loc.beans.LOCPluginHome" name="LOCPlugin" version="1.0.0" vendor="IBM" independentCredit="true" virtualTerminal="none"> </PluginInformation> </Plugin>
The JAR file for the plug-in and plug-in deployment descriptor are in the following directories:
- WC_eardir/Payments_Plugin_LOC.jar
- workspace_dir/WC/xml/config/payments/ppc/plugins/LOC/PluginDeployment.xml
The required parameters for the LOC plug-in are:
- account
- credit line number (CreditLineNumber)
- buyer organization name (BuyerOrgName)
- buyer organization distinguished name (BuyerOrgDN)
Plug-in restrictions
The LOC plug-in does not support currency conversion and cannot detect if the currency in the order is the same as defined in the account. The currency that is provided by the order capture process is the currency that is used by the LOC plug-in.
The LOC plug-in does not support the QueryablePlugin interface in the Payment plug-in specification.
LOC plug-in security
The LOC plug-in delegates the encryption and storage of sensitive data in the database. The plug-in does not have any access control. The plug-in grants the accesses that are permitted by the Payment rules engine.
LOC plug-in payment and credit state handling
The LOC plug-in moves payment and credit states according to the Payment plug-in specification. There are no particular exceptions to how the plug-in moves payment and credit states.
LOC plug-in messages
The LOC plug-in does not use any special messages resource bundle and therefore has no additional properties files for message translation. It uses the standard messaging functions that are described in the Payment plug-in specification.