Error types, codes, and objects

Learn about error types, codes, and objects.

Change event error object

When DigitalRiver.js detects an error with an element, it returns an error object with the change event. This object will contain a type, code, and message.

{
    "type": "validation_error",
    "code": "invalid_card_number",
    "message": "Your card number is invalid."
}

Create source error object

DigitalRiver.js returns this error object within the createSource method if an error occurs with the tokenization request. This object will contain a type and an array of detailed messages explaining the error.

{
    "type": "bad_request",
    "errors": [{
           "code": "invalid_parameter",
           "parameter": "owner.firstName",
           "message": "'' is not a valid owner.firstname."
    },
    {
            "code": "currency_unsupported",
            "parameter": "currency",
            "message": "currency 'xyz' is not supported."
    }]
}

Error types

The following table contains a list of DigitalRiver.js error types.

Error codes

The following table contains a list of DigitalRiver.js error codes.

You must only indicate that the payment has been declined and do not share the code or descriptions below with the customer.

Last updated