Technote

(FAQ)
Indicating and customizing order error message when there is a payment error in WebSphere Commerce v6 payment plugin
Problem
When a payment fails, you want to display a specific error message on the display page, instead of a generic error message from the payment plugin.
Solution
You can customize the error message using the following procedure. The prerequisite is to deploy APAR # JR25568. Contact Support to obtain the APAR.

  1. Define your customized NLV message properties file.

    For example, create a new file CybersourceErrorMessages.properties under

    WC_installdir\properties\com\ibm\commerce\payments\plugin\cybersource\util

    In this file, create your message mapping from message key to message for display. For this case, you want to display the reason code of transaction failure returned by PSP, so you can add: TRANSACTION_FAILED = Transaction failed. Reason Code is {0}.

    To support multiple languages, create different property files under the same directory for different languages. For example, CybersourceErrorMessages_en.properties for English.

  2. Throw the PluginException exception.

    In your payments plug-in implementation, you can throw the PluginException exception with message key as that defined in the NLV properties. For example, you can set the message key as "TRANSACTION_FAILED". Also, because there is a message argument for reason code defined in the properties file, set the format arguments for this exception. This sample code illustrates how you can do this.

    approveTransaction.setReasonCode("111");
    PluginException fe = new PluginException();
    String[] reason = {approveTransaction.getReasonCode()};
    fe.setResourceBundleName("com.ibm.commerce.payments.plugin.cybersource.util.CybersourceErrorMessages");
    fe.setMessageKey("TRANSACTION_FAILED");
    fe.setFormatArguments(reason);
    throw fe;

    Expected result: The order page displays the following error message.

Cross Reference information
Segment Product Component Platform Version Edition
Commerce WebSphere Commerce Professional Edition
   

Document Information

Current web document: http://www.ibm.com/support/docview.wss?uid=swg21256470