To add a new payment policy for a store group, do the following:
- Assemble the required information to add your payment policy: payment policy ID, type ID, name, store group ID, properties, language ID, descriptions, and business command class.
- Using the following statement as your guide, run the SQL statements against
your WebSphere Commerce database:
insert into policy( policy_id, policyname, policytype_id, storeent_id, properties ) values( 9091, 'CustomOffline_COD', 'Payment', -1, 'cassetteName=CustomOffline&profileName=WC51_CustomOffline_COD&offlineMethod=COD' ) insert into policydesc( policy_id, language_id, Description, longDescription ) values( 9091, -1, 'Cash On Delivery', 'Cash On Delivery (CustomOffline)' ) insert into policycmd( policy_id, businessCmdClass ) values( 9091, 'com.ibm.commerce.payment.commands.DoPaymentPMCmdImpl' ) insert into policycmd( policy_id, businessCmdClass ) values( 9091, 'com.ibm.commerce.payment.commands.CheckPaymentAcceptPMCmdImpl' ) insert into policycmd( policy_id, businessCmdClass ) values( 9091, 'com.ibm.commerce.payment.commands.DoCancelPMCmdImpl' ) insert into policycmd( policy_id, businessCmdClass ) values( 9091, 'com.ibm.commerce.payment.commands.DoDepositPMCmdImpl' ) insert into policycmd( policy_id, businessCmdClass ) values( 9091, 'com.ibm.commerce.payment.commands.DoRefundPMCmdImpl' )
Notes:
- A payment policy for the CustomOffline method COD is included as bootstrap data for your instance. You do not need to manually add a payment policy for this payment method.
- You can replace the policy_id by any number that is not already in use by another business policy in the POLICY table.
- This example defines a new payment business policy for store group -1. You can change the reference number to define a new payment policy for a store rather than a store group.
- Payment business policies defined to a store group are available to all the stores in the same store group.
- A short and long description is added for the language_id -1 (US English). You can also add descriptions for other languages. See the LANGUAGE table for the language_id of other languages.
- You must enter the entries for the POLICYCMD table exactly as shown, except for the policy_id which must match the policy_id value specified for the policy table entry. You can deviate from this requirement if you plan to use your own implementation class for those commands.
- The properties field does not include the attrPageName properties. The Ship-to-Address and Bill-to-Address parameters required by this payment method are obtained through other means in WebSphere Commerce. Other payment methods may require an attrPageName property.
You can define a new payment policy for a new cassette, and through the profileName property, specify the Cashier profile you defined for that cassette. You can also use the attrPageName property to specify the name of a JSP file segment that other WebSphere Commerce components could include to render an HTML form that prompts the user for payment information required by the cassette. Refer to defined payment business policy properties for additional information on the profileName and attrPageName properties, and other properties that can be specified with the payment business policy.