NP Atobarai App Errors
Error handling​
There may be a number of reasons why an error occurs during the payment process.
- Expected errors: e.g., customer provided wrong contact details
- App configurations errors: like provided keys are incorrect
- NP Atobarai errors: NP Atobarai API can be down or return unexpected errors
- Integration errors: storefront doesn't provide proper data to mutations
- Saleor errors: Saleor may bo down or return unexpected errors
App is doing its best to detect each class of errors to give the best possible message to the integrator/staff.
There are two types of messages the app is setting at the moment:
- TransactionEvent.message field - especially when the app is setting "FAILURE"-like events, it can return also a message why it happened
dataerrors - errors especially valuable for storefront to debug (reading a message in the network response) or handle errors (reading and translating error codes)
Errors in payment gateway mutation data​
Errors that come from payment gateway data field will always have the following structure:
{
errors: [ // It will be array of errors, in case of multiple errors were caught
{
code: "WrongPhoneNumberFormatError", // This code can be used to react on the cause
message: "Phone number format is incorrect - it should start with +81" // This message CAN change and should be used for debugging
}
]
}
Due to a fact that both TransactionEvent.message and data are public fields available on the storefront, app will not return details due to security reasons.
Reporting fulfillment errors​
When handling reporting fulfillment (in trackingNumberUpdated webhook), the app will report errors as order notes.
The app also adds order notes when fulfillment reporting is skipped due to transaction validation issues:
- No completed transactions — "NP Atobarai skipped fulfillment reporting: No completed transactions found for the order". This can happen when the order has only "ghost" transactions (e.g. failed payment attempts).
- Multiple completed transactions — "NP Atobarai skipped fulfillment reporting: Multiple completed transactions found for the order". The app supports only a single completed transaction per order.