Disabling WebSphere Commerce Payments from the AdvancedB2BDirect starter store

The AdvancedB2BDirect starter store uses WebSphere Commerce Payments by default. You can disable WebSphere Commerce Payments from the order flow (as available in the ConsumerDirect starter store). There are two options to achieve this:

  1. Do not display any payment method choices.
  2. Display payment method choices and make additional changes to remove errors from being thrown.

If you select the second option, then do the following to ensure that starter stores do not use WebSphere Commerce Payments:

  1. Open the instance_name.xml file in an editor.
  2. Add PaymentsEnabled=false to the PaymentManager section as shown:
    <PaymentManager
      PaymentsEnabled="false"
      DTDPath="../xml/PaymentManager/IBMPaymentServer.dtd"
      Hostname="localhost"
      PMAdminId="wcsadmin"
      ProfilePath="../conf/xml/payment"
      UseExternalPM="false"
      UseNonSSLPMClient="0"
      UseSocksServer="false"
      WebPath="/webapp/PaymentManager" WebServerPort="443"/>
    

Note: Ensure that you are using WebSphere Commerce 5.6.0.1 or later for the preceding steps to work correctly. If you are using WebSphere Commerce 5.6.0.0, then you will not be able to access your payment type when you enable this flag.

WebSphere Commerce Payments will be disabled for all the stores within the WebSphere Commerce instance. If this is not what you want, then do not enable this flag. WebSphere Commerce Payments will be disabled from the store but you will see some errors (warnings) as the commands try to connect to it by default.

Modifying JSP files to remove WebSphere Commerce Payments

Edit the OrderSubmitFormPaymentSection.jsp and OrderConfirmationDisplay.jsp files to remove WebSphere Commerce Payments:

  1. Open the OrderSubmitFormPaymentSection.jsp file from AdvancedB2BDirect/ShoppingArea/CheckoutSection/StandardCheckoutSubsection/.
  2. Edit the following section:
    <c:import url="${paymentFileName}">
       <c:param name="orderRn" value="${orderRn}"/>
       <c:param name="PaymentTCInfo_brand" value="${selectedPaymentTCInfo.brand}"/>
       <c:param name="PaymentTCInfo_cardNumber" value="${selectedPaymentTCInfo.cardNumber}"/>
       <c:param name="PaymentTCInfo_shortDescription" value="${selectedPaymentTCInfo.shortDescription}"/>
       <c:param name="PaymentTCInfo_cardExpiryMonth" value="${selectedPaymentTCInfo.cardExpiryMonth}"/>
       <c:param name="PaymentTCInfo_cardExpiryYear" value="${selectedPaymentTCInfo.cardExpiryYear}"/>
       <c:param name="accountNumber" value="${accountNumber}"/>
    </c:import>
    
    to look similar to the following section:
    <c:import url="${paymentFileName}">
       <c:param name="orderRn" value="${orderRn}"/>
       <c:param name="PaymentTCInfo_brand" value="${selectedPaymentTCInfo.longDescription}"/>
       <c:param name="PaymentTCInfo_shortDescription" value="${selectedPaymentTCInfo.shortDescription}"/>
       <c:param name="accountNumber" value="${accountNumber}"/>
    </c:import>
    
  3. Open the OrderConfirmationDisplay.jsp file from AdvancedB2BDirect/ShoppingArea/CheckoutSection/StandardCheckoutSubsection/.
  4. Locate PayStatusPMDataBean and delete it.

Defining a new payment business policy

Define a new payment business policy that does not use WebSphere Commerce Payments.

Defining a new payment business policy is described in the WebSphere Commerce Information Center. Refer to the following file: http://publib.boulder.ibm.com/infocenter/wc56help/index.jsp?topic=/com.ibm.commerce.payments.developer.doc/tasks/tpynewpp.htm

The key to defining a new payment business policy is to use the SimpleCmdImpl, instead of the PMCmdImpl (the PM commands use the WebSphere Commerce Payments).

The following example uses storeent_id=10001 and payment policy id=9091. The storeent_id should match your store ID, and the policy ID must be unique:

insert into policy( policy_id, policyname, policytype_id, storeent_id, properties )
values( 9091, 'SimplePaymentPolicy', 'Payment', 10001,
'attrPageName=CreditCardName' )

insert into policydesc( policy_id, language_id, Description, longDescription )
values( 9091, -1, 'Simple payment policy', 'CardName' )

insert into policycmd( policy_id, businessCmdClass )
values( 9091, 'com.ibm.commerce.payment.commands.DoPaymentSimpleCmdImpl' )

insert into policycmd( policy_id, businessCmdClass )
values( 9091, 'com.ibm.commerce.payment.commands.CheckPaymentAcceptSimpleCmdImpl' )

insert into policycmd( policy_id, businessCmdClass )
values( 9091, 'com.ibm.commerce.payment.commands.DoCancelSimpleCmdImpl' )

insert into policycmd( policy_id, businessCmdClass )
values( 9091, 'com.ibm.commerce.payment.commands.DoDepositSimpleCmdImpl' )

insert into policycmd( policy_id, businessCmdClass )
values( 9091, 'com.ibm.commerce.payment.commands.DoRefundSimpleCmdImpl' ) 

Restart the WebSphere Commerce Server after you complete making all the changes.

Feedback