Errors in the mobile SDK are returned through the LyraException object which has the following parameters:
|errorCode||It allows you to identify the current error (in [PREFIX]_[CODE] format).|
|errorMessage||Explains the error corresponding to the code.|
|detailedErrorCode||Code of the underlying error causing the exception (or null).|
|detailedErrorMessage||Message of the underlying error (or null).|
The detailedError field indicates the exact cause of the error to help you identify the issue.
Errors that occur during development must be differentiated from those that may occur during the execution of the SDK.
In this case, the SDK will throw an exception of type LyraException . It must be captured by the developer.
Here are the cases when this can happen.
After calling the method initialize() :
If the publicKey parameter format is incorrect, an Exception MOBP_001-INVALID_KEY will be thrown.
If the apiServerName parameter format is incorrect, an Exception MOBP_012-UNKNOWN_API_SERVER_NAME will be raised.
After process() method call :
- If the SDK has not been initialized beforehand, a MOBP-002-INITIALIZATION_REQUIRED exception will be raised.
For other errors, the information will be transmitted in the LyraException object via the callback function onError() , as described in the integration guide.
An error code takes the [PREFIX]_[CODE] format where:
|[PREFIX]||Defines the application layer where the error occurred.|
|[CODE]||Numeric error code.|
There are different prefixes:
|PREFIX||DESCRIPTION||EXAMPLE OF AN ERROR|
|MOB||Mobile SDK error||MOB_004|
|ACQ||Error on the acquirer side||ACQ_001|
|INT||Integration error (on the merchant side)||INT_007|
|PSP||Error on the payment gateway side||PSP_001|
Note that new error codes may be added in the future (even if you do not update your SDK and mobile application). Thus, your implementation must take this into account, and integrate a generic error handling algorithm.
ACQ, AUTH, INT and PSP errors
These error codes concern the communication with the payment servers (to the payment gateway, your merchant server, etc.). Please see Error codes for information on this type of error.
Error handling recommendation
Regardless of the error case, we recommend that you always display a message to the user to inform them that the payment has not occurred. We advise you to trace the errorCode, the detailedErrorCode and their associated messages in order to be able to analyze the issues you may encounter and resolve them on your own. In the event of an error, you should NEVER assume that the payment has been made.
These errors appear if an error occurs on the mobile SDK side.
|MOB_001||Invalid public key|
|MOB_002||SDK initialization is required before calling the process|
|MOB_004||Invalid formToken version|
|MOB_005||Impossible to communicate with server|
|MOB_006||Network is not available|
|MOB_007||Invalid response of Lyra Rest API|
|MOB_010||Server timeout error, check IPN|
|MOB_011||Unknown API Server Name|
Error code details
|Definition||Invalid public key|
The public key provided upon SDK initialization is not correct. You may be trying to perform a test transaction with a production key or vice versa. Please see Prerequisites .
|Definition||SDK initialization is required before calling the process|
The form identifier appears to be incorrect. Make sure you have followed the instructions provided in the integration guides. If you do not see a possible error cause, call tech support*.
|Definition||Invalid formToken version|
The version of the form identifier is not good. To make sure you have the correct version, call the getFormTokenVersion method of the SDK and pass the results in the formTokenVersion parameter of createPayment.
|Definition||Impossible to communicate with server|
Please contact the support team*.
|Definition||Network is not available|
The device does not appear to be connected to the Internet. In this case, it can be useful to send a message to the user to make sure he or she is logged in.
|Definition||Invalid response of Lyra Rest API|
Please contact the support team*.
The payment was refused after the retry count was reached.
The payment was abandoned by the buyer. The buyer has voluntarily left the payment screen.
|Definition||Server timeout error, check IPN|
The payment server did not respond within 60 seconds. This may simply be due to a temporary slowdown. Therefore, it is strongly advised to check the IPN afterwards, and cancel the transaction to keep consistency.
|Definition||Unknown API Server Name|
The value sent in the apiServerName field is not recognized, probably due to a typing error.
An unexpected error has occurred. Please contact the support team*.
When you contact support, please communicate:
- Your 8-digit shop number
- The OS and SDK version
- Device used (iPhone 6S, PC, iPad Pro, etc.)
- The OS version
- Error date and time
- The errorCode and detailedErrorCode that you encounter (if applicable)
All this information will shorten the time it takes to analyze and understand your problem.