Web
...
Web Integrations
Web SDK
Payment Form Error Messages
displaying payment form error messages the web sdk is designed to provide feedback quickly and clearly to the consumer to display payment form error messages add a div with the id judopay errors on your page, ideally below the iframe \<div class="judopay errors">\</div>; the table below displays all errors that can be returned id error string 0 card number can only contain numbers 1 card number not valid 2 card type not recognised, please recheck your number 3 {1} is not supported 4 card number required 5 card is expired 6 card expiry date is not valid 7 expiry date required 8 {0} code too short for {1} card 9 {0} code too long for {1} card 10 {0} code can only contain numbers 11 {0} code required for {1} card 12 post/zip code is invalid 13 sorry, an error has occurred, you have not been charged 14 cardholder name is required 15 cardholder name can't be less than 4 characters 16 cardholder name can't contain numbers or special characters for error strings containing {0} and {1} , these will be changed into values depending on the current state of the iframe form for example { 0 } will change to the card verification code acronym this is named differently depending on the card type (e g cvc, cvv) { 1 } will refer to the detected card type, for example visa, mastercard, diners club international or discover if the iframe has detected a visa number, the following error message transform would occur {0} code too long for {1} card" > "cvc code to long for visa card a similar error with an american express card, the message would appear as cid code too long for american express card" web sdk error responses there are 2 possible error formats error responses from our transaction api (which the web sdk formats and returns) these are caused by the transaction itself, for example incorrect payment credentials failure of 3d secure 2 for more information on this type of error, see payment form error messages docid\ qfxawpaql 2evfp8y94d errors thrown by the web sdk code examples of causes can be scripts failing to load closing of a modal time outs for more information on this type of error, see here enhanced error messaging for web sdk for web sdk version 0 0 29 (or higher), the error response object has the following additional fields describing the error name status judodetails not all errors returned from the web sdk will have the new format described below this only refers to errors that originated from our transaction api (previous to version 0 0 29) having the following interface {message string} error object response fields field description message string a text description of the error name string represents a name for the type of error status number a http response status code judodetails object object giving additional context to the error for further details on the interface of the judodetails object, including examples, see payment form error messages docid\ qfxawpaql 2evfp8y94d this field is optional optional examples of the enhanced error response the enhanced error response provides an error object with additional fields to increase the description of the error, for example enhanced error response { message 'request failed with status code 400', name "error", status 400, judodetails { category 2, code 1, details \[{ code 4, fieldname 'amount', message 'sorry, but the amount specified must be greater than "0" ', detail "sorry, we're currently unable to process this request "}], message "sorry, we're unable to process your request please check your details and try again " } } enhanced error response { message 'request failed with status code 400', name "error", status 400, judodetails { category 4, code 158, message "sorry, but your card authentication has failed " } } judodetails object the judodetails object aims to provide additional context around the error see below for further information on the optional judodetails object that is now included in the error response judodetails interface field description message string a text description of the error code number a static numeric code associated with the specific error category number the type of error 1 requesterror 2 modelerror 3 configerror 4 duplicationerror / processingerror 5 exceptionerror details object object giving additional context to the error for examples on what this object may look like, see payment form error messages docid\ qfxawpaql 2evfp8y94d this field is optional optional for modelerror array of fielderrors describing one or more attributes for duplicationerror provides the receiptid and url of the duplicate transaction judodetails examples example category 1 { message "sorry, but we were unable to authenticate your request please check your details and try again ", code 403, category 1 } { message "we've been unable to decrypt the supplied encrypted payload please ensure the message has not been modified ", code 150, category 1 } response will contain one or more fielderrors in the details block example category 2 { details \[ { code 50, fieldname "postcode", message "please supply the postcode" }, { code 33, fieldname "cv2", message "sorry, the security code entered is invalid please check your details and try again " } ], message "sorry, we're unable to process your request please check your details and try again ", code 1, category 2 } example category 3 { message "sorry, but the amount you're trying to collect is greater than the pre auth ", code 46, category 3 } { message "sorry, but the amount you're trying to refund is greater than the original transaction ", code 49, category 3 } example category 4 { details { receiptid 717774858666278912, url\ https //gw1 karatepaysandbox com/transactions/717774858666278912" }, message "sorry, this payment has been stopped as it is a duplicate transaction ", code 86, category 4 } example category 4 { message "sorry, but your card authentication attempt was rejected by the issuer ", code 159, category 4 } example category 5 { message "the content type was not specified or is unsupported for the request made to the judopay api currently supported content type is limited to application/json ", code 0, category 5 }