Error Codes Handling

In the following link, you can find the Microsoft Excel document with the error codes handled inside the PiA SDK, along with further description on how they are used.

PiA SDK - Netaxept - Response codes


Note: The error codes are returned back to the application, through the delegate function func piaSDK(_ PiaSDK: PiaSDKController, didFailWithError error: NPIError)

In the error case, the returned error - NPIError - object will be non nil, which has getters for error code and error message. The error codes are mapped inside an enum NPIErrorCode, but each explanation message can be retrieved by calling localizedDescription. If you want custom error messages, you can create your custom map based on the codes.


Note:

We recommend that you keep all error codes internal without showing them to your users. Instead, you should provide generic messages encouraging them to retry the transaction, to select another payment method, or to contact your customer service. Beside the Netaxept error codes, there are handled internal SDK errors, such as:

  • GENERIC_ERROR, code 300 : Terminal call has completed with an unexpected error. Please make the Netaxept Query call to get more detailed information.

  • NPITerminalValidationError, code 301 : Operation denied by transaction filter. May occur in the following cases:

    • Credit card type denied
    • Velocity filter
    • Blocked IP

    NOTE TO DEVELOPER:

    • Check transaction filter parameters on Netaxept admin
    • Conversion tips: suggest user to retry transaction with another card / payment method
  • NPIRequestFailed, code 101 : Regular iOS network error. May occur in the following cases:

    • Internet connectivity issues
    • Timeout error
    • Failed serialisation in models
  • NPIThreeDSecureError, code 102 : Errors related to 3DS webview before loading, normally are:

    • Internet connectivity issues
    • Timeout error
  • NPIThreeDSecureNavigationError, code 103 : Errors related to 3DS webview loading

  • NPIVippsErrorStatusCode, code 302 - Depricated : Vipps payment failure with Vipps status code parsed from redirect URL. Check error codes from the Vipps documentation.

  • NPIWalletAppNotInstalled, code 303 : The wallet app is not installed on the device.

  • NPIWalletURLInvalid, code 304 : The wallet URL returned from payment registration with merchant backend is invalid.

  • NPIWalletRedirectURLUnknown, code 305 : The redirect url (passed from UIApplication open:url) is unknown and could not be parsed. This can be caused if the SDK was invoked with a URL thats not from a wallet app redirect or, there has been API change in the wallet app. In the second case, make sure the SDK is the latest version and contact us.

  • NPITransactionInfoNull, code 306 : The TransactionInfo object passed to SDK is null.

  • NPIRedirectURLNull, code 307 : The RedirectURL passed to SDK is null.

  • NPIUnknownTerminalError, code 308 : There is an unknown terminal error.

  • NPIUnidentifiedWebViewRedirectURL, code 309 : Webview was redirected to an unidentified URL.

  • NPIThreeDSecurePageNotFound, code 310 : 3D secure page not found.

  • NPIInvalidWebViewURL, code 311 : Invalid Payment URL for PayPal/Paytrail.