WCPayments plug-in exceptions
The following section describes how exceptions map between the WCPayments plug-in and WebSphere Commerce Payments, and how these exceptions map to WebSphere Commerce Payments return codes.
The Payment plug-in specification allows a payment plug-in to throw a number of exceptions under various error conditions (see the exception summary for com.ibm.commerce.payments.plugin). TheWCPayments plug-in is capable of throwing all of the exceptions listed in the exception summary, except for these exceptions:
- PaymentInstructionBlockedException
- TimeOutException
To indicate an error condition exists, WebSphere Commerce Payments uses primary return codes (PRC) to indicate the main error and secondary return codes (SRC) to provide additional information about the error. The responseCode value is the string of the PRC, and the reasonCode value is the string PRCxxxSRCxxx. The return codes are mapped to payment plug-in exceptions to provide information to the WebSphere Commerce Payments.
If theWCPayments plug-in receives a non-zero return code (indicating some error occurred in WebSphere Commerce Payments), the plug-in throws a specific exception and provides a reason code in the format PRCxxxSRCxxx for the payment transaction.
The following table lists the exceptions thrown by the WebSphere Commerce plug-in, with specific meanings in a WebSphere Commerce Payments context. It also lists the exceptions thrown by theWCPayments plug-in that are related to non-zero return codes received from WebSphere Commerce Payments.
Plug-in exception | Description | WebSphere Commerce Payments Primary Return Code |
---|---|---|
InternalErrorException | An internal error occurred in theWCPayments plug-in
or in WebSphere
Commerce Payments. This exception might be related to an internal error involving the database, a servlet, encryption, or the payment cassette. WebSphere Commerce Payments will not handle the transaction properly. |
10, 13,14, 17, 18, 21, 22, 30, 50, 53, 56, 57, 59, 60, 62 |
CommunicationException | TheWCPayments plug-in could not connect to WebSphere Commerce Payments. | Not applicable |
FinancialException | Communication with WebSphere
Commerce Payments took
place but some return codes were received that indicated errors. This exception occurs when the payments cassette connects to the payment back-end system and there was a communication problem. |
2, 8, 11, 12, 15, 34 |
InvalidPaymentInstructionException | The payment instruction is not valid. For example, a credit card number
is not valid. A return code was received indicating the information received
from the payment instruction was not valid. Generally thrown during an ACCEPTPAYMENT transaction. |
3, 4, 5, 6, 7, 9, 24, 31, 32, 54, 58 |
ApprovalExpiredException | The payment approval has expired. TheWCPayments plug-in throws this exception when it detects that a WebSphere Commerce Payment has changed to an "expired" state. | Not applicable. |
InvalidDataException | TheWCPayments plug-in detected an invalid parameter from the WebSphere Commerce Payments before it connected to WebSphere Commerce Payments. | Not applicable. |
ConfigurationException | TheWCPayments plug-in
found an incorrect configuration. The incorrect data exists in either the
payment plug-in descriptor or payment system mapping. This exception can indicate an authorization or authentication error. |
51, 52 |
FunctionNotSupportedException | TheWCPayments plug-in
encountered a function which it does not support. This exception can be thrown
when:
The transaction will not proceed or be committed in WebSphere Commerce Payments. |
23, 55, 61 |