Configuring two payment business policies for your store
In this part of the tutorial, you configure the VISA and Pay InStore payment methods for your store. The Deprecated featureMadisons starter store is used as an example.
Procedure
-
Use the following SQL query to find the store entity ID for Deprecated featureMadisons:
select storeent_id from storeent where identifier = 'Madisons';
Since VISA is an existing payment method in Madisons, you can check the existing setting for the payment policy by using the following query:STOREENT_ID 10001 select policy_id, policyname, policytype_id, storeent_id, properties from policy where policytype_id = 'Payment' and storeent_id = 10001 and policyname ='VISA';
Because you are using the myGroup payment configuration group, you should update the properties column for this policy by using the following query:POLICY POLICYNAME POLICYTYPE_ID STOREENT_ID PROPERTIES 10002 'VISA' 'Payment' 10001 'attrPageName=StandardVisa&paymentConfigurationId=default&display=true&compatibleMode=false' update policy set properties = 'attrPageName=StandardVisa&paymentConfigurationId=myGroup&display=true&compatibleMode=false' where policy_id = 10002;
Important:- Before you run the last SQL statement, issue the following directive:
Otherwise, the ampersand symbol ("&") that the statement contains causes unexpected behavior.set define off;
- Execute the last SQL statement in the DB2 command line processor. Because it contains the ampersand symbol ("&"), running the statement in the command window causes unexpected behavior.
- Before you run the last SQL statement, issue the following directive:
- Pay in Store is not an existing payment method in Madisons.
Set up the Pay in Store payment method:
- First, create the payment policy in the POLICY table.
Determine one payment policy ID that is not already in use by using
the following query:
select max(policy_id)+1 as policy_id from policy;
POLICY_ID 10905 - Insert one payment policy for PayInStore into the POLICY
table:
insert into policy ( policy_id, policyname, policytype_id, storeent_id, properties ) values (10905, 'PayInStore', 'Payment', 10001, 'attrPageName=StandardPayLater&paymentConfigurationId=myGroup&display=true&compatibleMode=false');
Important:- Before you run the last
SQL statement, issue the following directive:
Otherwise, the ampersand symbol ("&") that the statement contains causes unexpected behavior.set define off;
- Execute the last SQL statement in the DB2 command line processor. Because it contains the ampersand symbol ("&"), executing the statement in the command window causes unexpected behavior.
The StandardPayLater.jsp attribute page is the page snippet that is used for the PayInStore payment method in the storefront. This payment method for Madisons is configured to use myGroup. For more information, see defined payment business policy properties.
- Before you run the last
SQL statement, issue the following directive:
- First, create the payment policy in the POLICY table.
Determine one payment policy ID that is not already in use by using
the following query:
- 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 ( 10905, -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.
- Set up the business policy commands for the new policy
to use the payment plug-in controller:
insert into policycmd ( policy_id, businesscmdclass ) values ( 10905, 'com.ibm.commerce.payment.actions.commands.DoPaymentActionsPolicyCmdImpl'), ( 10905, 'com.ibm.commerce.payment.actions.commands.EditPaymentInstructionPolicyCmdImpl'), ( 10905, 'com.ibm.commerce.payment.actions.commands.QueryPaymentsInfoPolicyCmdImpl' );
If you are using the old payment policy commands that are used in WebSphere Commerce v5.x or earlier, refer the file Setting up WebSphere Commerce Payments for your store for more details.
- Restart your WebSphere Commerce instance to pick up all the new configurations.
- Place an order in the storefront to use the new payment methods. Select Pick Up at Store check box in the Shopping Cart, and then select Pay in-store check box in the Address page.