Changing the default contract
To modify the default contract without using the user interface, you need to export the default contract and make changes to the contract XML file and then import the modified contract.
Procedure
- Type the following SQL to retrieve the contract_id and
store_id.
select contract_id, store_id from storedef where store_id = (select storeent_id from storeent where identifier = 'ConsumerDirect');
- Export the default contract as an XML file. .
Use the contract_id that was retrieved from step 1 to export to ConsumerDirectDefaultContract.xml file in the WC_installdir\xml\trading\xml directory
The ContractExport command is not registered in the struts-config.xml.
- Add the following content to the struts-config-ext.xml
file before the </action-mappings> tag:
<action parameter="com.ibm.commerce.contract.commands.ContractExportCmd" path="/ContractExport" type="com.ibm.commerce.struts.BaseAction"> <set-property property="authenticate" value="0:0"/> <set-property property="https" value="0:1"/> </action>
- Either refresh the Struts Configuration Registry in Administration Console or restart the server.
- Add the following content to the struts-config-ext.xml
file before the </action-mappings> tag:
- Modify the default contract to include Payment method.
- Edit the file ConsumerDirectDefaultContract.xml. At
the end of the
</BuyerContract>
tag, add the Payment TC.<!-- Payment TC --> <PaymentTC mandatory = "false" changeable = "false" > <PaymentMethod> <PaymentPolicyRef policyName = "PayLater"> <StoreRef name = "ConsumerDirect"> <Owner> <OrganizationRef distinguishName = "ou=b2c,o=seller organization,o=root organization"/> </Owner> </StoreRef> </PaymentPolicyRef> <PaymentMethodDisplayString name = "Pay Later"/> </PaymentMethod> </PaymentTC>
- Run the SQL to get the policyName.
select policyname from policy where policy_id=?;
- Run the SQL to get the StoreRef.
select identifier from storeent where store_id=?;
- Run the SQL to get the distinguishName.
select dn from orgentity where orgentity_id in (select member_id from storeent where storeent_id=storeent_id);
The
PaymentMethodDisplayString
is the payment method display name when you select the Payment method in the order flow.The properties column of the policy table for Payment policy is similar to this,
You will find the StandardVisa.jsp (the propertyattrPageName=StandardVisa&paymentConfigurationId=default&display=false&compatibleMode=false
attrPageName
value) in the store\ShoppingArea\CheckoutSection\StandardCheckoutSubsection directory. If you do not find then you need to copy it to this location. - Edit the file ConsumerDirectDefaultContract.xml. At
the end of the
- In the file ConsumerDirectDefaultContract.xml file, modify
the minorVersionNumber by increasing it by one l.
<ContractUniqueKey name = "ConsumerDirect Default Contract" majorVersionNumber = "1" minorVersionNumber = "1" origin = "Manual"> <ContractOwner> <OrganizationRef distinguishName = "o=seller organization,o=root organization"/> </ContractOwner> </ContractUniqueKey>
- Import the default contract. Using the utility from step 2, import an Active Contract using the file ConsumerDirectDefaultContract.xml, and the target store is the store_id from step 1.
- To verify if the new payment method is created, create
an order in the Order Summary page. You will find the payment method
as follows: