Error handling
Presentation
Errors in the mobile SDK are returned through the LyraException
has the following parameters:
Parameter | Description |
---|---|
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). |
Le champ detailedError
indique la cause précise de l'erreur.
Error types
Errors that occur during development must be differentiated from those that may occur during the SDK execution.
Development errors
Dans ce cas, le SDK lance une exception de type LyraException, qui doit être capturée par le développeur.
Cela peut se produire dans les cas suivants :
Après l'appel à la méthode initialize() :
Si le format du paramètre publicKey est incorrect, une exception
MOBP_001-INVALID_KEY
sera levée.Si le format du paramètre apiServerName est incorrect, une exception
MOBP_012-UNKNOWN_API_SERVER_NAME
sera levée.
Après l'appel à la méthode process() :
- If the SDK has not been initialized first, an exception
MOBP-002-INITIALIZATION_REQUIRED
will be displayed.
Runtime errors
For other errors, the information will be transmitted in the LyraException object via the onError()callback function, as described in the integration guide.
Error codes
An error code has the following format [PREFIX]_[CODE]:
[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 |
AUTH | Authentication error. | AUTH_149 |
INT | Integration error (on the merchant side) | INT_007 |
PSP | Error on the payment gateway side | PSP_001 |
ACQ, AUTH, INT and PSP errors
These error codes concern communications with the payment servers (to the payment platform, your merchant server, etc.). See Error Codes for details of this error type.
Error handling recommendation
Whatever the error case, we recommend:
- to always display a message to inform the user that the payment did not done.
- to carefully trace
errorCode
, thedetailedErrorCode
et leurs messages associés afin de pouvoir analyser les incidents que vous pouvez rencontrer et les résoudre de manière autonome. En cas d'erreur, vous ne devez JAMAIS considérer que le paiement a été effectué.
MOB errors
These errors appear if an error occurs on the mobile SDK side.
ERROR CODE | Definition |
---|---|
MOB_001 | Invalid public key |
MOB_002 | SDK initialization is required before calling process |
MOB_003 | Invalid formToken |
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_008 | Payment refused |
MOB_009 | Payment cancelled |
MOB_010 | Server timeout error, check IPN |
MOB_011 | Unknown API Server Name |
MOB_012 | Unknown Order Status |
MOB_013 | Payment cannot be cancelled |
MOB_014 | Payment by Apple Pay not available |
MOB_999 | Unexpected error |
Error code details
MOB_001
Code | MOB_001 |
DEFINITION | Invalid public key |
The public key provided upon SDK initialization is incorrect. You may be trying to perform a test transaction with a production key or vice versa. See: Prerequisites
MOB_002
Code | MOB_002 |
DEFINITION | SDK initialization is required before calling process |
Vous tentez d'appeler la méthode process
avant d'avoir appelé la méthode init
. Voir : Guide d'intégration Android et Guide d'integration iOS sur l'initialisation du SDK.
MOB_003
Code | MOB_003 |
DEFINITION | Invalid formToken |
The form ID appears to be incorrect. Make sure you have followed the instructions provided in the integration guides. If you don't see a possible error cause, contact technical support.
MOB_004
Code | MOB_004 |
DEFINITION | Invalid formToken version |
The version of the form identifier is not good. To ensure you have the correct version, call the getFormTokenVersion
method of the SDK and send the results into the formTokenVersion
parameter of createPayment
.
MOB_005
Code | MOB_005 |
DEFINITION | Impossible to communicate with server |
Getting in touch with technical support.
MOB_006
Code | MOB_006 |
DEFINITION | Network is not available |
The device does not appear to be connected to the Internet. Send a message to the user to make sure they are logged in.
MOB_007
Code | MOB_007 |
DEFINITION | Invalid response of Lyra Rest API |
Getting in touch with technical support.
MOB_008
Code | MOB_008 |
DEFINITION | Payment refused |
The number of additional attempts is reached and the payment is refused.
MOB_009
Code | MOB_009 |
DEFINITION | Payment cancelled |
The payment has been deliberately canceled. The buyer has deliberately left the payment screen or the Lyra.cancelProcess()
has been called.
MOB_010
Code | MOB_010 |
DEFINITION | Server timeout error, check IPN |
The payment server did not respond within 60 seconds. This may be due to a temporary slowdown, so it is strongly recommended to retrospectively check the IPN, and cancel the transaction to maintain consistency.
MOB_011
Code | MOB_011 |
DEFINITION | Unknown API Server Name |
The value sent in the apiServerName
field is not recognized, probably due to an input error.
MOB_012
Code | MOB_012 |
DEFINITION | Unknown Order Status |
This error is raised if the payment gateway returns a payment status that is different from RUNNING, PAID, PARTIALLY_PAID or UNPAID.
MOB_013
Code | MOB_013 |
DEFINITION | Payment cannot be cancelled |
The payment cannot be canceled after a call to Lyra.cancelProcess()
.
MOB_014
Code | MOB_014 |
DEFINITION | Payment by Apple Pay not available |
This error is raised after calling to Lyra.cancelProcess()
with the option [LyraPaymentOptions.paymentMethodType: LyraPaymentMethods.applePay]
and payment by Apple Pay not available.
MOB_999
Code | MOB_999 |
DEFINITION | Unexpected error |
An unexpected error has occurred. Please contact the support team.
Lorsque vous contactezl'assistance technique, communiquez :
- 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
anddetailedErrorCode
that you encounter if it’s the case
This information makes it easier to analyze and understand your problem.