Tutorials > Payments > Configure the SimpleOffline plug-in with two payment methods

< Previous


Configure two payment business policies for the store

In this part of the tutorial, you configure the VISA and PayInStore payment methods for the store. We take the ConsumerDirect store as an example.


Procedure

  1. Use the following SQL query to find the store entity ID for ConsumerDirect:

     select storeent_id from storeent where identifier = 'ConsumerDirect' 
    

    STOREENT_ID
    10101

    Since VISA is an existing payment method in ConsumerDirect, you can check the existing setting for the payment policy by using the following query:

     select policy_id, policyname, policytype_id, storeent_id, properties from policy where policytype_id = 'Payment' and storeent_id = 10101 and policyname ='VISA'  
    

    POLICY POLICYNAME POLICYTYPE_ID STOREENT_ID PROPERTIES
    10202 'VISA' 'Payment' 10101 'attrPageName=StandardVisa&paymentConfigurationId=default&display=true&compatibleMode=false'

    Because you are using the myGroup payment configuration group, you should update the properties column for this policy:

     update policy set properties = 'attrPageName=StandardVisa&paymentConfigurationId=myGroup&display=true&compatibleMode=false' where policy_id = 10202 
    

    Important:

    • Before executing the last SQL statement, issue the following directive:

       set define off; 
      

      Otherwise, the ampersand symbol ("&") that the statement contains will cause unexpected behavior.

    • Execute the last SQL statement in the DB2 Command Line Processor. Because it contains the ampersand symbol ("&"), executing the statement in the command window will cause unexpected behavior.

  2. PayInStore is not an existing payment method in ConsumerDirect. Therefore, you should set up the PayInStore payment method.

    • First create the payment policy in the POLICY table. Determine one payment policy ID which is not existing in the table:


      select max(policy_id)+1 as policy_id from policy

    POLICY_ID
    11510

  3. Insert one payment policy for PayInStore into the POLICY table:

     insert into policy ( policy_id, policyname, policytype_id, storeent_id, properties ) values (11510, 'PayInStore', 'Payment', 10101,  'attrPageName=StandardPayLater&paymentConfigurationId=myGroup&display=true&compatibleMode=false') 
    

    • Before executing the last SQL statement, issue the following directive:

       set define off; 
      

      Otherwise, the ampersand symbol ("&") that the statement contains will cause unexpected behavior.

    • Execute the last SQL statement in the DB2 Command Line Processor. Because it contains the ampersand symbol ("&"), executing the statement in the command window will cause unexpected behavior.

    The StandardPayLater.jsp attribute page is the page snippet used for the PayInStore payment method in the storefront. We have configured this payment method for ConsumerDirect to use myGroup. (For more detail, refer to the defined payment business policy properties file.)

  4. Insert the translated descriptions for the payment policy in the POLICYDESC table. In this tutorial, only the English description is inserted.

     insert into policydesc ( policy_id, language_id, description, longdescription ) values ( 11510, -1, 'Pay In Store', 'Pay money in the store')  
    

    The value for the description is displayed in the storefront as the visible name of the payment method.

  5. Set up the business policy commands for the new policy to use the payment plug-in controller:

     insert into policycmd ( policy_id, businesscmdclass ) values ( 11510, 'com.ibm.commerce.payment.actions.commands.DoPaymentActionsPolicyCmdImpl')  insert into policycmd ( policy_id, businesscmdclass ) values ( 11510, 'com.ibm.commerce.payment.actions.commands.EditPaymentInstructionPolicyCmdImpl')  insert into policycmd ( policy_id, businesscmdclass ) values ( 11510, 'com.ibm.commerce.payment.actions.commands.QueryPaymentsInfoPolicyCmdImpl' )  
    

    If you are using the old payment policy commands used in WebSphere Commerce v5.x or earlier, refer the file Set up WebSphere Commerce Payments for the store for more details.

  6. Restart the WCS instance to pick up all the new configurations.

  7. Place an order in the storefront to use the new payment methods.

You have now finished all of the configurations for the VISA and PayInStore payment methods for the ConsumerDirect store. You can use similar steps to configure any payment method.

< Previous


+

Search Tips   |   Advanced Search