diff --git a/datacash/codes.py b/datacash/codes.py new file mode 100644 index 0000000..165ff27 --- /dev/null +++ b/datacash/codes.py @@ -0,0 +1,627 @@ +RESPONSE_CODES = { + 1: 'Transaction accepted and logged.', + 2: 'Communication was interrupted. The argument is e.g. 523/555\r\n (523 bytes written but 555 expected).', + 3: 'A timeout occurred while we were reading the transaction details.', + 5: 'A field was specified twice, you sent us too much or invalid data,\r\n a pre-auth lookup failed during a fulfill transaction, the swipe field\r\n was incorrectly specified, or you omitted a field. The argument will\r\n give a better indication of what exactly went wrong.', + 6: 'Error in communications link; resend.', + 7: "Transaction declined. The arguments are as return code 1, except\r\n the first argument is the bank's reason for declining it (e.g. REFERRAL,\r\n CALL AUTH CENTRE, PICK UP CARD etc.) or the result from a failed fraud\r\n check (e.g. FRAUD DECLINED reason code)", + 9: 'The currency you specified does not exist', + 10: 'The vTID or password were incorrect', + 12: 'The authcode you supplied was invalid', + 13: 'You did not supply a transaction type.', + 14: 'Transaction details could not be committed to our database.', + 15: 'You specified an invalid transaction type', + 19: 'You attempted to fulfill a transaction that either could not be\r\n fulfilled (e.g. auth, refund) or already has been.', + 20: 'A successful transaction has already been sent using this vTID and\r\n reference number.', + 21: "This terminal does not accept transactions for this type of card\r\n (e.g. Diner's Club, American Express if the merchant does not take\r\n American Express, Domestic Maestro if multicurrency only).", + 22: 'Reference numbers should be 16 digits for fulfill transactions,\r\n or between 6 and 30 digits for all others.', + 23: 'The expiry dates should be specified as MM/YY\r\n or MM-YY.', + 24: 'The supplied expiry date is in the past.', + 25: 'The card number does not pass the standard Luhn checksum test.', + 26: 'The card number does not have the expected number of digits.', + 27: 'You did not supply an issue number when we expected one, or the\r\n issue number you supplied was non-numeric or too long', + 28: 'The start date was missing or malformed (must be MM/YY)', + 29: 'The supplied start date is in the future', + 30: 'Start date after expiry date', + 34: 'The amount is missing, is not fully specified to x.xx format', + 40: 'Must be either "business" or "personal"', + 41: 'Cheque number was missing or was not 6 digits', + 42: 'The sort code was missing or was not 6 digits', + 44: 'The account number was missing or was not 8 digits', + 51: 'A transaction with this reference number is already going through\r\n the system.', + 53: 'There are matching TIDs available, but they are all in use.', + 56: 'Card used too recently', + 57: 'The velocity_check value must be numeric and between 0 and 120', + 59: "You either:\r\n \ndo not take the card type at all (eg. Amex card when you have\r\n no Amex TIDs)\ntake this currency for some card types, but not this one. (e.g.\r\n you wanted to process Domestic Maestro in USD)\ndo not take this card type and currency combination for the\r\n specified environment. (e.g. you specified capturemethod of 'cnp'\r\n when you are only setup for 'ecomm' transactions, or you specified\r\n capturemethod of 'cont_auth' or attempted a Historic CA transaction\r\n when you are not set up for CA transactions for the supplied card\r\n type and currency)\n\n", + 60: 'The XML Document is not valid with our Request schema. The reason\r\n is detailed in the element of the Response document.', + 61: 'An error in account configuration caused the transaction to fail. Contact DataCash Technical Support', + 62: 'Please use the DataCash XML API', + 63: 'The transaction type is not supported by the Acquirer', + 70: 'The reference specified for either a setup or presetup transaction\r\n is invalid, if no Direct Debit service subscription exists, if an\r\n invalid amount is specified in a drawdown, an invalid duedate is specified\r\n or a drawdown is against an inactive setup.', + 71: "A value other than true has been specified for the active attribute\r\n for an existing setup transaction, a value other than 'conversion'\r\n has been specified for the type attribute in a AUDDIS conversion transaction,\r\n or both the type and active attributes have been specified.", + 73: 'The presetup is invalid, non-existent, was submitted more than 28\r\n days ago or there is a difference in mode between the presetup and\r\n confirm.', + 74: "The 'drawdown' transaction is invalid; refer to the element for the reason the transaction was rejected.", + 75: 'mismatch in modes between setup and revoke transaction', + 80: 'Some of the supplied CPC specific data has not passed the corresponding\r\n validation rule. For example, commodity codes have to be 4 digits.', + 81: 'One of the mandatory fields has not been supplied.', + 82: 'The VAT rates used must match a valid UK VAT rate.', + 83: 'The supplied commodity code does not match one of the standard codes.\r\n These are listed in the back of the integration documentation.', + 84: "The transaction VAT rates are checked against the supplied unit\r\n costs, quantities, discounts and vat rates. This response code indicates\r\n that the values don't match.", + 85: 'Before you can submit corporate purchasing card information you\r\n need to get your account enabled. Contact DataCash\r\n Technical Support to get this set up.', + 86: 'Only Visa Purchasing cards can be used for Corporate Purchasing\r\n Card transactions.', + 87: 'The sum of the line totals does not match the total amount specified.', + 90: 'Invalid Value. A value passed in does not match the required format.', + 91: 'The required field, as returned in the element,\r\n is required and has not been supplied.', + 92: 'Recurring Transactions/Continuous Authority are not supported on\r\n this card type.', + 93: 'Invalid Card. The card supplied is going to expire before the first\r\n payment is made.', + 94: 'There is a problem with the dates supplied. The \r\n element details what the problem is:\r\n \nThe date of the first payment must be from tomorrow onwards,\nThe date of the first regular payment must be at least one day\r\n after the one off initial payment,\nThe date of the last payment must be at least one day after\r\n last regular payment,\nThe start date is invalid,\nThe start date is invalid first/last transaction is invalid.\n\n', + 95: 'There is a problem with the cancellation transaction. This can be\r\n one of:\r\n \nthe reference supplied does not match a recurring transaction\r\n account,\nthe account has already been cancelled,\nthe account is no longer live i.e. it has completed.\n\n', + 96: 'A last payment can only be specified when there is a set number\r\n of recurring payments.', + 97: 'Your account has not been enabled to process continuous authority\r\n transactions. Contact DataCash\r\n Technical Support to get this set up.', + 98: 'Recurring Transactions/Continuous Authority not supported for this\r\n acquirer. Recurring transactions are only supported for a subset of\r\n the acquiring banks. Contact your account manager for further details.', + 99: 'The account reference supplied with the cancellation transaction\r\n is not valid. It has to be an eight digit number.', + 100: 'The merchant is not set up to do 3-D Secure transactions.', + 101: 'Check the element to see which required element\r\n has not been supplied.', + 102: "The mandatory 'type' attribute is missing or has an incorrect value.", + 103: '3-D Secure transactions are only applicable in the ecomm environment.', + 104: 'Error in bank authorization, where APACS30 Response message refers\r\n to different TID to that used in APACS30 Request message; resend.', + 105: 'Error in bank authorization, where APACS30 Response message refers\r\n to different message number to that used in APACS30 Request message;\r\n resend.', + 106: 'Error in bank authorization, where APACS30 Response message refers\r\n to different amount to that used in APACS30 Request message; resend.', + 107: "Either the security_code or the eci values have been supplied. When\r\n the Card Holder_registered value is set to 'no' these elements are\r\n not applicable.", + 108: '3DSecure is not available for Duet cards.', + 120: 'Your account must be setup to accept Direct Credit transactions\r\n before you can submit them. Contact DataCash\r\n Technical Support for more details.', + 121: 'Direct Credit transactions must specify a unique merchant reference\r\n for each transaction.', + 122: 'Direct Credit transactions can only be done using GBP amounts.', + 123: 'Direct Credits can only be applied to UK issued cards.', + 124: 'The optional card name can be upto 18 characters long.', + 125: 'Contact support.', + 126: 'The payment account can not to found for the supplied card.', + 127: '-', + 128: 'The transaction being cancelled has already been cancelled.', + 129: 'The transaction being cancelled has already been submitted to BACS.', + 130: 'You should not use the Extended Policy as well as the Standard Policy\r\n at the same time.', + 131: 'The ExtendedPolicy complex element must contain each of the following\r\n child elements:\r\n \ncv2_policy\naddress_policy\npostcode_policy\n\n', + 132: 'The CV2 number must be 3 or 4 digits in length.', + 133: 'Your acquiring bank does not support Extended Policy.', + 134: 'The Account Name should be no more than 18 characters and contain\r\n only alpha numerics and spaces. It is invalid to supply both accountname\r\n and cardname.', + 135: 'Check the element to see the list of Bank Validation\r\n failures.', + 136: 'Sort Code and Account Number do not appear to be standard BACS details', + 137: 'The reference supplied with this ddrefund transaction failed to\r\n find a match for the original DDI transaction', + 140: 'Your account has not been enabled to process Direct Debit continuous\r\n authority transactions. Contact DataCash\r\n Technical Support to get this set up.', + 141: 'Non-GBP currencies cannot be used for direct debit.', + 142: 'The reference supplied does not match a Direct Debit instruction.', + 143: 'You have specified but\r\n you are not using a set number of regular transactions.', + 144: 'DD Setup not active', + 145: 'DD Setup is in accreditation mode', + 146: 'DD Setup is in disabled mode', + 150: "The payer should now be authenticated via the issuer's ACS", + 151: "A transaction type other than 'auth' or 'pre' was received in the\r\n 3-D-Secure Enrolment Check Request", + 152: 'An authcode was supplied in the 3-D Secure Authorization Request,\r\n this is not allowed', + 153: "The mandatory 'verify' element was not supplied in the 3-D Secure\r\n Enrolment Check Request", + 154: "The mandatory 'verify' element was supplied, but its value was something\r\n other than 'yes' or 'no'", + 157: 'The merchant is not setup to do 3-D Secure transactions', + 158: 'The card scheme is not supported in the 3-D Secure environment', + 159: 'The enrolment verification with scheme directory server failed', + 160: 'Received an invalid response from the scheme directory server', + 161: 'The 3-D Secure Authorization Request was not authorized and returned\r\n a referral response', + 162: "The payer's card is not enrolled for 3-D Secure", + 163: 'Not enabled for this card scheme with that acquiring bank', + 164: 'The acquirer is not supported by 3-D Secure', + 165: 'Not enabled to do 3-D Secure transactions with this acquirer', + 166: "The format of the 'purchase_datetime' field supplied in the 3-D\r\n Secure Enrolment Check Request is invalid", + 167: 'An invalid reference was supplied in the 3-D Secure Authorization\r\n Request', + 168: 'The transaction could not be submitted for authorization as no valid\r\n 3-D Secure Enrolment Check Request was found', + 169: 'A magic card as not been supplied in transaction where 3-D Secure\r\n subscription mode is test', + 170: 'The DataCash MPI software has no directory server URL details for\r\n this scheme', + 171: 'A PARes message has been supplied in 3-D Secure Authorization Request.\r\n This is not allowed', + 172: 'The required PARes message was not supplied in 3-D Secure Authorization\r\n Request', + 173: 'Card is not is cache and so no 3-D Secure Enrolment Check Request\r\n is submitted', + 174: 'The PARes response message from the Issuer could not be verified', + 175: 'A PARes message has been received in 3-D Secure Authorization Request,\r\n but no Matching PAReq message was found', + 176: 'The PARes message received in the 3-D Secure Authorization Request\r\n is invalid', + 177: 'The PAReq message received from the 3-D Secure Enrolment Check Request\r\n is invalid', + 178: "The PAReq and PARes messages do not match on one of these key fields:\r\n 'message_id', 'acqBIN', 'merID', 'xid', 'date', 'purchAmount', 'currency'\r\n or 'exponent'", + 179: "The PARes message received was valid but the payer was not authenticated\r\n by the card issuer's ACS", + 180: 'The DataCash MPI does not support recurring transactions', + 181: 'A 3-D Secure Authorization Request found there was no matching referral\r\n to be authorized', + 182: 'A 3-D Secure Authorization Request found that the timelimit for\r\n an authorization on a transaction that had previously received a \r\n response had been exceeded', + 183: "A 3-D Secure Enrolment Check Request had the verify element set\r\n to 'no' meaning no 3-D Secure verification is to be done.", + 184: 'A 3-D Secure Enrolment Check Request with a response of 150, 158,\r\n 162, 163, 173 or 183 has exceeded the timelimit, and a 3-D Secure\r\n Authorization Request will no longer be accepted', + 185: 'A 3-D Secure Enrolment Check Request with a response of 161 has\r\n exceeded the timelimit, and a 3-D Secure Authorization Request will\r\n no longer be accepted', + 186: 'Presence of IReq indicates invalid VEReq', + 187: 'Unable to Verify', + 188: 'Unable to Authenticate', + 189: ' 3DS International Maestro card not enrolled', + 190: 'Your vTID is capable of dealing with transactions from different\r\n environments (e.g. MoTo, e-comm), but you have not specified from\r\n which environment this transaction has taken place.', + 191: "Fields used in the 'fire & forget' Credit Card CA model are\r\n not applicable to the Historic model. Check the \r\n element to see which field has been supplied incorrectly.", + 192: 'The reference given did not match a live CA account.', + 193: 'When sending a transaction with capturemethod set to cont_auth to\r\n acquirer Natwest or HSBC you must include an appropriate capturemethod\r\n attribute giving the CA environment.', + 194: 'Environment attribute is only valid for Credit Card transactions\r\n using capturemethod cont_auth.', + 195: 'Txn_refund of CA transaction must specify capturemethod, which cannot\r\n be cont_auth as refunds are not applicable in a CA environment.', + 199: 'Type txn_refund not applicable to VGIS Transactions', + 200: 'The information specified in the VGIS message does not match the\r\n information in the TxnDetails', + 201: 'One of the mandatory fields has not been supplied.', + 202: 'The VGIS message has failed to parse correctly. Either the document\r\n was not compressed and encoded correctly or the source document was\r\n malformed.', + 204: 'Only Visa Purchasing cards can be used for Corporate Purchasing\r\n Card transactions.', + 205: 'The invoice totals (GrossValue, NetValue, TaxValue) do not correlate.', + 206: 'The tax calculations in the VGIS message do not total correctly.', + 207: 'The value of an element in the VGIS message XML document is invalid.', + 208: 'The VGIS message XML document was more than 1Mb in size after decompression.', + 209: 'An error occurred during decompression of the VGIS message XML document.', + 210: 'Specifying in a cancel txn that a reversal should take place is\r\n only applicable in Card Holder Present environments.', + 211: "All Card Holder Present transactions must include the 'capturemethod'\r\n element.", + 212: "The 'Terminal' element must only be used for Card Holder Present\r\n transactions, which must also include the 'capturemethod' element.", + 213: "The 'Terminal' element must be used for Card Holder Present transactions.", + 214: "At least one of the 'Terminal' element's attributes must be 'true'.", + 215: 'The cashback value specified in the transaction is not valid.', + 217: 'Cash back can only be allowed in a Card Holder Present environment.', + 218: 'Acquirers do not carry out address verification or security code\r\n checking when the Card Holder is present.', + 219: 'The ReD rich data set is not applicable in the Card Holder Present\r\n environment', + 220: 'The pre-fulfill (and erp-fulfill) model is not allowed in CHP environment', + 221: 'Maestro and Electron card types are not allowed with capturemethod\r\n keyed', + 222: 'If an authcode value is supplied in CHP environment the method attribute\r\n must also be supplied', + 223: 'If an authcode value is supplied in CNP environment the method attribute\r\n must not be included', + 224: 'The hotcardfile element is only applicable in CHP environment', + 225: 'LID transactions cannot specify CHP environment', + 226: 'Track 2 data can only be supplied with swiped and parked transactions.', + 227: 'Either the track 2 data was not correctly base64 encoded, or the track2 data was not in one of the expected formats.', + 228: 'Track 2 data must be supplied with swiped and parked txns.', + 229: 'ICC data should only be supplied if capturemethod is parked', + 230: 'A parked transaction must supply all of the mandatory ICC fields: reason_online_code, arqc, api, atc, unpredictable, tvr, crypto_tran_type.', + 231: 'The amount should be the total of the sale plus any cash back. It is therefore invalid to have a cash back value in excess of the transaction amount.', + 232: 'Cash back (as opposed to cash advance) is only available for Domestic Maestro, Solo, Visa Delta and Visa Electron card types.', + 233: 'The reason_online_code field should not be supplied unless processing in a Card Holder Present environment.', + 234: 'Recurring transactions are not supported in a Card Holder Present environment', + 235: 'ICC Data provided contained invalid information.', + 236: 'Receipt number must be numeric', + 237: 'This transaction type does not support the receipt_no element', + 238: 'The auth_datetime attribute cannot be a future date/time and must not be older than 14 days', + 239: 'Lloyds and HBoS merchants must be configured with a VB640 dataset before CP transactions can be settled', + 240: 'Track2 data cannot be provided for authorised txns', + 241: 'Cash Advance - Max Cash amount exceeded', + 242: 'Cash Advance not allowed for this card type', + 243: 'Cash Advance not supported for this acquirer', + 244: 'Cash Advance not allowed in this environment', + 245: 'Cash Advance not supported in this currency', + 246: 'Invalid Cash Advance data', + 247: 'Missing currency parameter', + 250: 'No valid previous transaction was found', + 251: 'Before you can submit preregistered card txns you need to get your\r\n account enabled. Contact DataCash\r\n Technical Support to get this set up.', + 252: 'Prereg: Invalid reference - vTID group mismatch', + 255: 'BatchInput: Not authorised', + 256: ' BatchInput: Too many files', + 257: 'A single BatchInputTxn must not exceed 1MB in file size', + 258: 'BatchInput: Input format not recognised', + 259: 'BatchInput: The compressed and encoded batch data is corrupt', + 260: ' BatchInput: Data file parse failure', + 261: 'BatchInput: Malformed data file header', + 262: 'A BatchInputTxn must state the number of transactions contained in the batch data file.\r\n This number is checked against the number it actually contains, and if these numbers do not\r\n match up, the transaction is rejected. Additionally, it is invalid to supply a data file with no transactions. ', + 263: 'A BatchInputTxn must state the gross value of transactions contained in the batch data file,\r\n irrespective of currency, or whether they are credits or debits. This number is checked against the\r\n number it actually contains, and if these numbers do not match up, the transaction is rejected.\r\n Since a total amount is required, where a transction does not require an amount, it should be\r\n considered as zero (0) for the purposes of this check.', + 264: 'BatchInput: Batch file format violation ', + 265: 'The DataCash Payment Gateway checks the validity of certain values in a data file before accepting\r\n it for further processing. Illegal values will cause the whole file to be rejected. ', + 266: 'Batch files may pass the preliminary check performed by the DataCash Payment Gateway,\r\n but be rejected when later scheduled for processing. Failure to provide values for mandatory\r\n fields will result in rejection.', + 267: 'Batch files may pass the preliminary check performed by the DataCash Payment Gateway,\r\n but be rejected when later scheduled for processing. Attempting to specify more than one\r\n vTID in an XML batch will result in rejection. ', + 268: 'Batch files may pass the preliminary check performed by the DataCash Payment Gateway,\r\n but be rejected when later scheduled for processing. Attempting to perform "query"\r\n historic txns via BatchInput will result in rejection.', + 270: 'Not authorised to perform query txns', + 271: 'Cannot query transactions of this kind', + 272: 'BatchInput: Unprocessed', + 273: 'BatchInput: Processing', + 274: 'Cannot locate transaction to query', + 275: 'The batch input file has failed during the processing phase and cannot be re-processed.', + 276: 'No preprocessed database entry was found for the specified file and transaction ref', + 280: 'The datacash reference should be a 16 digit number. The first digit (2, 9, 3 or 4)\r\n indicates the format used and whether the txn was processed in a live or test environment.', + 281: 'The new format of datacash reference includes a luhn check digit.\r\n The number supplied failed to pass the luhn check.', + 282: 'The site_id extracted from the datacash reference does not match the current environment', + 283: 'The mode flag extracted from the datacash reference does not match the current environment', + 290: 'A leg number has been duplicated or is missing', + 291: 'The merchant has not been configured for Airlines transactions', + 292: 'A passenger reference has already been used for this MID', + 293: 'The sum of passenger ticket amounts does not match the total transaction amount', + 294: 'When using the two-stage transaction model, airline passenger and flight\r\n\t information may only be supplied once, at the pre or fulfill stage.', + 295: 'A pre/erp transaction was processed using a non-airlines TID, so cannot be fulfilled with Airlines data', + 296: ' A pre/erp was marked as being for Airlines use, but the fulfill does not contain Airlines Data', + 297: 'The transaction contained data pertaining to an extended service incompatible with Airlines transactions', + 298: 'The txn_refund model is not supported for Diners Airline transactions', + 299: 'The supplied capturemethod is not supported for Airlines transactions', + 301: 'Purchasing Address Record only valid for Amex cross border transactions', + 310: 'A vTID must be subscribed to the fraud checking service offered by The 3rd Man before submitting information to be passed on to them.', + 311: 'Transactions supplying data for The 3rd Man fraud checking must not mix the styles in which they supply data.', + 312: 'T3M: Validation Error', + 313: 'Error with T3M batching', + 314: 'T3M:PayPal Validation Error', + 315: 'T3M:Fraud only Validation Error', + 316: 'Invalid response from T3M', + 317: 'No response from T3M', + 318: 'Error returned from T3M', + 319: 'No external connection resource available', + 320: 'The merchant reference supplied for the OTR does not match the validation rules for the acquirer', + 321: 'There are no validation criteria set up for this acquirer for using the merchant ref as the OTR', + 330: 'You are not set up to do Smart Voucher transactions, or your subscription\r\n has expired and/or is not yet valid. Contact DataCash\r\n Technical Support to get set up for this service.', + 331: 'The transaction does not contain a required field. The information\r\n element will indicate by one of the following messages which field\r\n is missing.\r\n \nMissing purchase value\r\n Missing redeem value\r\n Missing account transaction value\r\n No product code found\r\n No voucher number found\r\n No account number found\r\n \n', + 332: "A capturemethod value other than 'ecomm' has been supplied with\r\n the transaction. As 'ecomm' is the only capturemethod applicable to\r\n Smart Voucher transactions any other value will get this error message.", + 333: 'The voucher number supplied with the transaction is invalid. Voucher\r\n numbers must be numbers between 16 and 19 digits in length and must\r\n pass the Luhn checksum. The information element will contain one of\r\n the following.\r\n \nNon-numeric characters in voucher number\r\n Voucher number wrong length\r\n Voucher number does not pass luhn\r\n \n', + 334: 'The product code supplied with the transaction is invalid. Product\r\n codes must be 9 digit numbers\r\n \nNon-numeric characters in product code\r\n Product code wrong length\r\n \n', + 335: 'The account number supplied with the transaction is invalid. Account\r\n numbers must be numbers between 16 and 19 digits in length and must\r\n pass the Luhn checksum.\r\n \nNon-numeric characters in account number\r\n Account number wrong length\r\n Account number does not pass luhn\r\n \n', + 336: 'The voucher or account value supplied with the transaction is invalid.\r\n Smart Voucher values must be a number specified up to 2 decimal places.', + 337: 'A partspend transaction cannot purchase a voucher for more than\r\n the value being redeemed.', + 338: 'The transaction includes a request for a service that is not supported\r\n by the Smart Voucher functionality. For example a Smart Voucher transaction\r\n including ReD or The Third Man information would cause this response,\r\n as indicated by one of the information elements.\r\n \nReD service is incompatible with Smart Voucher\r\n ReD service (use of transactionsource) is incompatible with\r\n Smart Voucher\r\n T3M service is incompatible with Smart Voucher\r\n \n', + 339: 'The product code contained in the transaction response received\r\n from Smart Voucher did not match the requested product code ', + 340: 'The voucher value contained in the transaction response received\r\n from Smart Voucher did not match the requested partspend purchase\r\n value ', + 345: 'A vTID must be subscribed before being able to cancel\r\n\t transactions by merchant reference', + 346: 'When cancelling transactions using the merchant reference, it\r\n\t must relate to a single transaction.', + 347: 'Certain types of transaction cannot be cancelled using the\r\n\t merchant reference. The DataCash reference must be used\r\n\t instead.', + 348: 'When performing cancellations using the merchant reference\r\n\t instead of the DataCash reference, it is not permitted to\r\n\t supply the DataCash reference as well.', + 350: 'There was a problem connecting to the Age Verification\r\n\t server', + 351: 'The Age Verification server sent back no response', + 352: 'The Age Verification server sent back a response which could\r\n\t not be parsed', + 353: 'The Age Verification server sent back an error response', + 354: 'The merchant is not subscribed to use the Age Verification\r\n\t service', + 355: "The merchant's configuration does not contain sufficient\r\n\t information", + 356: 'The request is missing a mandatory data field', + 357: 'The request contains a data field that does not belong in the\r\n\t message', + 358: 'The request contains a data field in an incorrect format', + 359: 'The Age Verification server sent back a response which did\r\n\t not reconcile with the request', + 370: 'The allocated reference supplied has already been used in a\r\n\t transaction. Allocated references can only be used once.', + 371: 'The allocated reference supplied has expired. Allocated\r\n\t references are valid for 5 minutes from when they are returned\r\n\t by the Payment Gateway.', + 372: 'The reference supplied does not correspond to an allocated\r\n\t reference.', + 373: 'Allocate references are only permitted for Card Holder\r\n\t Present CardTxns.', + 374: 'Allocated references cannot be cancelled. This response would\r\n\t generally indicate that a transaction failed to reach the\r\n\t Payment Gateway, and no processing was performed.', + 380: 'The merchant has not been configured to submit GCX reference\r\n\t codes for Dynamic Currency Conversion', + 381: 'The request contains extended data which is not supported for GCX transactions', + 382: 'Attempt to process a GCX transaction for a method which is not one of pre, auth or refund ', + 383: 'Attempt to process a GCX transaction for an unsupported card scheme', + 384: 'Attempt to process a GCX transaction for an unsupported acquirer', + 385: 'Attempt to process GCX transaction without a GCX reference', + 390: 'Merchants need to be subscribed to the Click2Pay service in order to use it', + 391: 'There was a problem connecting to the Click2Pay server', + 392: 'The Click2Pay server returned no response', + 393: 'Click2Pay server returned non-SOAP response', + 394: 'Click2Pay server returned an error response', + 395: 'Click2Pay request contained an illegal field', + 396: ' Payment has been processed, but the Item detail returned from Click2Pay\r\n\t contained an unrecognised currency. Please contact DataCash Support', + 421: 'Primary and secondary URLs were unobtainable or requests timed out', + 422: 'Problem with datawire servers', + 423: 'VXN Error returned from Datawire', + 424: 'Invalid XML or garbled XML returned', + 425: 'Encoded characters are not supported', + 426: 'Merchant not currently subscribed', + 427: 'One of the supplied input types is not supported for Omnipay', + 428: 'Omnipay clearinghouse does not process Domestic Maestro transactions', + 430: 'The Elavon service has returned a fault response', + 431: 'AVS postcode not supplied', + 440: 'Out of external connections', + 450: 'Euroline System Error', + 451: 'Bank systems failure', + 452: 'Request and response parameters did not match', + 453: 'Merchant requires entry in euroline_account to process SEB/Euroline transactions', + 454: 'Euroline configuration error', + 455: 'A request has been made to generate a message that is neither request or response', + 456: 'It is not possible for the SEB Euroline service to establish an external connection', + 457: 'Problem with input data means that it is not possible to send an authorisation request for this transaction', + 460: 'The merchant is not subscribed to use the service', + 461: 'The merchant is subscribed to use the service but has no active TIDs for natwest EUR', + 462: 'An ELV transaction contained an unexpected element', + 470: 'Maestro transactions for Card Holder not present are not supported for the given clearinghouse', + 471: 'This transaction must be a 3dsecure transaction', + 472: 'International Maestro is not permitted in a Mail order / telephone order environment.', + 473: 'Keyed International Maestro transaction not permitted', + 480: 'The Merchant Id provided is invalid ', + 481: 'The merchant is expected to provide a Merchant Id with each transaction', + 482: 'The merchant is not set to provide Merchant Id for a transaction', + 510: 'The merchant attempted to use a GE Capital card with a BIN that does not belong to them', + 530: 'The merchant has sent an EoD transaction, but has not configured the vTID for Dynamic EoD', + 531: 'The merchant has sent an EoD transaction outside the time window configured for the vTID', + 532: 'A valid EoD transaction has already been received within this transaction window', + 533: 'A vTID configured to for Dynamic EoD does not have an EoD window configured', + 534: 'A vTID configured for Static EoD transaction does not have an eod configured', + 570: 'This transaction has not had a successful do_express_checkout performed against it', + 571: 'The customer has not yet logged into PayPal,\r\n preventing the transaction from being processed further', + 572: 'A response was expected but not received from Paypal. The status can be established by sending a query transaction.', + 573: 'Paypal did not receive the request corresponding to this transaction', + 574: 'The transaction is recorded in Paypal\'s system as "In Progress"', + 575: 'The transaction is recorded in Paypal\'s system as "Failed"', + 576: 'The transaction status is recorded in Paypal\'s system as "Unsuccessful"', + 577: 'A communication error occurred while attempting to update transaction status', + 578: 'Paypal:Unable to determine transaction status at Paypal', + 580: 'Direct Debit: amount may not be supplied in DDI setup request', + 600: 'The card used in MPI only transaction denoted by the historical reference must be enrolled', + 601: 'No 3-D Secure enrollment transaction can be located for the historical reference supplied', + 602: '3-D Secure enrollment check already validated for the reference supplied', + 603: 'No 3-D Secure authentication transaction can be located for the historical reference supplied', + 604: 'The MPI transaction denoted by the historical reference has already been authorised', + 605: 'threedsecure_authorization_request cannot be performed on the transaction denoted by the historical reference supplied.', + 606: 'The PARes is invalid. An additonal block will be returned were there is more information.', + 607: 'The validity period for the 3-D Secure scheme has elapsed', + 608: 'The currency provided in the authorisation request does not match that supplied in the enrolment check.', + 609: 'The currency provided in the authorisation request does not match that supplied in the enrolment check.', + 610: 'Either this scheme+currency combination is not supported by this vTID, or this scheme is not supported by 3DS.', + 611: 'There are no terminals configured on this account', + 612: 'There are no terminals capable of processing this transaction', + 613: 'No default credentials found for the configured acquirer_bin', + 620: 'This method is not supported for Fexco DCC transactions', + 621: 'No Merchant configuration for this currency combination', + 622: 'Invalid exchange_rate for Fexco DCC service', + 623: 'txn_refunds are not supported for Fexco DCC transactions', + 624: 'Merchant not subscribed for Fexco DCC service', + 640: 'You are mandated for 3-D Secure but have not submitted a 3-D\r\n\t Secure transaction or specified that you wish to override the mandate.', + 641: 'You are mandated for 3-D Secure and have specified in the\r\n\t transaction that you wish to override the mandate however this is not\r\n\t currently permitted.', + 650: 'No successful connection obtained or error returned indicating issue with remote host (after attempting BOTH primary and secondary sites)', + 651: 'Request and response parameters did not match', + 652: 'No external tickets available for this service', + 653: 'Bank systems failure', + 654: 'Chase: Error in response', + 655: 'The merchant is not configured for Chase', + 656: 'Auth reversal cannot be performed on auth that is more than 3 days old', + 657: 'This card scheme supplied is not supported by Chase', + 658: 'Chase: Insufficient Data to generate request message', + 659: 'Chase: Auth reversal cannot be processed on expired auth', + 660: 'Chase: HTTP error in response', + 661: 'The response code from Chase indicated that there is a problem with the transaction that prevents it being authorised or declined', + 670: 'Invalid NAB Merchant ID', + 671: 'NAB suffered a database error whilst processing the transaction', + 672: 'NAB encountered an error whilst processing the transaction', + 673: 'NAB suffered a fatal unknown error', + 674: 'NAB was unable to process the transaction', + 675: 'NAB is undergoing system maintenance', + 676: 'Invalid NAB password supplied', + 677: 'NAB was unable to process the transaction', + 678: 'NAB was unable to process the transaction', + 679: 'NAB has disabled the merchant acccount used for this transaction.', + 680: 'NAB was unable to process the transaction', + 681: 'An unknown error has occurred processing the NAB transaction', + 682: 'Merchant incorrectly configured for NAB', + 683: 'No external tickets available for this service ', + 684: 'NAB: HTTP error in response', + 685: 'No successful connection obtained or error returned indicating issue with remote host', + 686: 'Decryption/Encryption Error at NAB', + 687: 'NAB Gateway Timeout, no response received from bank', + 688: 'NAB complete transaction was for a greater amount than the preauth', + 689: 'NAB payment amount is below the minimum specified by merchant', + 690: 'NAB payment amount is above the maximum specified by merchant', + 691: 'Transaction timed out while in the NAB queue', + 692: 'Invalid response received from NAB', + 693: 'Incorrect response received from NAB', + 694: 'Pre-auth not found by NAB', + 695: 'NAB pre-auth already completed', + 810: 'Information was found in the HPS requests that is not applicable to the request type', + 811: 'The submitted HPS request was missing mandatory data', + 813: 'A problem was encountered while sending a request to or receiving a response from the HPS', + 815: 'The supplied DataCash reference cannot be used to perform a payment', + 816: 'The HPS did not find configuration for your merchant account.', + 817: 'The dynamic capture field data specified is too long.', + 818: 'The Dynamic Data Field value is too long.', + 820: 'HPS: Awaiting customer card details.', + 821: 'HPS: At least one auth attempted. Awaiting payment details.', + 822: 'HPS: The maximum number of retry transaction was breached.', + 823: 'HPS: The merchants customer did not complete within the session timeout.', + 824: 'HPS: Payment in flight. Awaiting customer ACS submission.', + 825: 'HPS: Merchant not configured for full-hps', + 826: 'HPS: The transaction has already been marked as final.', + 827: 'HPS: Invalid capturemethod.', + 828: 'HPS: Awaiting authorization.', + 829: 'HPS: Invalid payment method for Full HPS txns.', + 830: 'No external tickets available for this service', + 831: 'Invalid response received from Westpac', + 832: 'Incorrect response received from Westpac', + 833: 'No successful connection obtained or error returned indicating issue with remote host', + 834: 'Westpac: HTTP error in response', + 835: 'Transaction in an unknown state', + 836: 'Westpac server rejected the transaction', + 837: 'Duplicate merchant reference sent to Westpac', + 838: 'Unexpected response from Westpac', + 839: 'Error encountered at Westpac - transaction has not been processed', + 840: 'Transaction could not be cancelled at Westpac', + 845: 'HPS: Paypal - Customer sent to the PayPal login page.', + 846: 'HPS: Paypal - Waiting for customer to confirm payment.', + 847: 'HPS: Paypal - Payment have confirmed funds available.', + 848: 'HPS: Paypal - Invalid PayPal method.', + 849: 'HPS: Paypal - Invalid PayPal payment action.', + 850: 'HPS: Paypal - Invalid PayPal setup elements.', + 851: 'HPS: Paypal - The Paypal txn was voided.', + 860: 'An APG session has been setup, waiting for the customer to return.', + 861: 'The APG transaction failed.', + 912: 'Amexiso: Airlines service subscription required in order to provide IAC data', + 913: 'Amexiso: ThreeDSecure transaction on American Express cards can only be processed by Amexiso', + 914: 'Amexiso: Invalid response from Amex', + 920: 'Wirecard: An unknown error occurred while processing the transaction', + 921: 'No external tickets available for this service', + 922: 'No successful connection obtained or error returned indicating issue with remote host', + 923: 'Wirecard: Invalid response received from Wirecard', + 924: 'Wirecard: HTTP error on response', + 925: 'Wirecard: Encryption failure at Wirecard', + 926: 'Wirecard: Card issuer temporarily not reachable', + 927: 'Wirecard: Processing temporarily not available', + 928: 'Wirecard: Wirecard reported timeout while processing transaction', + 929: 'Wirecard: Terminal not available', + 930: 'Wirecard: Terminal not ready', + 931: 'Wirecard: Amount larger than allowed', + 932: 'Wirecard: Amount smaller than minimum amount', + 933: 'Wirecard: Transaction processing not possible on terminal', + 934: 'Connection to Wirecard timed out. Transaction in unknown state', + 935: 'Wirecard: Airlines record may only be submitted as part of a fulfill transaction', + 936: 'Wirecard: Unexpected response received from Wirecard', + 937: 'Wirecard: Fulfill failed', + 991: 'The supplied token does not comply with the token format specification', + 992: 'Unknown token supplied', + 993: 'The merchant is not configured for the Tokenization service', + 994: 'The supplied Token has expired', + 995: 'The card number supplied is currently being tokenised by another transaction, please try again', + 996: 'The supplied shared secret does not comply with the shared secret format specification', + 997: 'Tokenization: Token generation resulted in a collision', + 1001: 'No external tickets available for this connection', + 1002: 'The transaction was rejected by PayGate', + 1003: 'An unknown error occurred while processing the transaction', + 1004: 'Invalid response received from Paygate', + 1005: 'No successful connection obtained or error returned indicating issue with remote host', + 1006: 'HTTP error on response', + 1007: 'Partial fulfill not supported for PayGate', + 1011: 'No external tickets available for this service', + 1012: 'EuroCommerce transactions can not be fulfilled for greater than original pre.', + 1013: 'Transaction is in pending state at EuroCommerce. Please contact EuroCommerce for more details.', + 1014: 'Unknown error at EuroCommerce.', + 1015: 'Unknown response from EuroCommerce.', + 1017: 'Transaction is in pending state at EuroCommerce. Please contact EuroCommerce for more details.', + 1018: 'Treansaction is in unknown state. Please contact EuroCommerce for more details.', + 1019: 'Please check Account Code/Account Password.', + 1020: 'HTTP error communicating with EuroCommerce.', + 1021: 'HTTP error communicating with EuroCommerce.', + 1022: 'HTTP error communicating with EuroCommerce.', + 1023: 'HTTP error communicating with EuroCommerce.', + 1031: 'FDS:Unexpected response from FDS', + 1033: 'FDS:Unable to establish connection', + 1034: 'FDS:Unknown response received from FDS', + 1035: 'FDS:Unknown Bank Failure', + 1036: 'FDS:Merchant narrative is not support for FDS', + 1046: 'The method element of the KeyRequestTxn was missing or contained a value other than "keyrequest"', + 1047: 'The version element of the KeyRequestTxn was missing or contained an unsupported value', + 1048: 'The ca_id element of the KeyRequestTxn was missing or contained an unsupported value', + 1049: 'The iv_id element of the KeyRequestTxn was missing or was incorrectly formatted', + 1050: 'Either the enc_id element was missing or it referenced an ENC key that is not assigned to the current vTID', + 1051: 'The sessionkey element was either missing or could not be decrypted by the DPG', + 1052: 'The card_details of type enc_track2_data could not be decrypted by the DPG', + 1053: 'The enc_PAN element could not be decrypted by the DPG', + 1054: 'The requested card data appears to be a payment card and cannot be decrypted', + 1055: 'A transaction date and time must be provided went sending an encrypted transaction', + 1100: 'No referenced transaction found', + 1101: 'Only referred transactions can be authorised', + 1102: 'Only pre or auth transaction can be authorised', + 1103: 'Must supply updated authcode to authorise transaction', + 1104: 'The default timeout value is set to 6hours but can be amended per Vtid by contacting DataCash Support.', + 1105: 'The transaction referenced was both referred by the acquiring bank, and challanged by the Retail Decisions (ReD) Service. This transaction cannot be authorised through the use of an authorize_referral_request or fulfill transaction, nor have the challenge accepted with an accept_fraud transaction. If a new authorisation code is obtained for the acquiring bank, the merchant can continue with the transaction by resubmitting the entrie transaction and providing the new authorisation code.', + 1106: 'Historic reference already in use', + 1126: 'Transaction rejected by the RSG', + 1127: 'Transaction marked for review', + 1128: 'Referenced transaction cannot be accepted', + 1130: 'Invalid RSG service specified', + 1131: 'Transaction has expired and cannot be completed', + 1133: 'The RSG service can only be used in the ecomm, cnp or cont_auth environments', + 1134: 'Not subscribed to the RSG service', + 1135: 'Referenced transaction not found', + 1136: 'Fire and Forget Continuous Authority transactions not supported with the RSG service', + 1137: 'Historic Continuous Authority transactions not supported with the RSG service', + 1138: 'Other fraud screening services cannot be used in conjunction with the RSG service', + 1139: 'Method unsupported for the RSG service', + 1140: 'Transaction marked for review', + 1150: 'The TID specified in the XML does not exist on the VTID', + 1151: 'Cannot fulfill a referred parked pre', + 1152: 'Continuous Authority setup transactions cannot be marked for T3M offline fraud screening', + 1153: 'Continuous Authority historic payments cannot be T3M fraud screened', + 1154: 'Continuous Authority cancellations cannot be T3M fraud screened', + 1160: 'No external tickets available for this service', + 1161: 'MiGS: HTTP Error on response', + 1162: 'MiGS: Unknown bank failure', + 1163: 'MiGS: Unexpected response from MiGS', + 1164: 'MiGS: Unknown response from MiGS', + 1165: 'MiGS: Only 3rd Party 3-D Secure is supported for MiGS', + 1166: 'No successful connection obtained or error returned indicating issue with remote host', + 1167: 'This method is not supported for MiGS', + 1170: 'The merchant is not configured for the Currency Conversion Service', + 1171: 'The merchant is not able to trade in the card origin currency', + 1172: 'The provided currency is not recognized', + 1173: 'The provided card bin issuing country is not supported', + 1174: 'The transaction cannot be processed because no exchange rate is available', + 1175: 'The transaction cannot be processed because no commission rate is available', + 1176: 'The transaction cannot be processed because there is no matching CCSRateRequest transaction', + 1177: 'The transaction cannot be processed because it partially fulfils a CCS pre transaction', + 1178: 'The card and exchange currencies are the same - cannot convert', + 1179: 'The HPS txn referred to has not yet completed cardcapture', + 1180: 'The transaction cannot be processed because the CCSRateRequest does not match', + 1181: 'The transaction cannot be processed because the CCSRateRequest has already been used', + 1182: 'The CCS system only supports ecomm transactions', + 1183: 'The transaction cannot be processed because the rate offer has expired', + 1184: 'Currency Conversion: the rate offer belongs to a different merchant', + 1185: 'Transaction cannot be processed because only pre and auth are supported', + 1186: 'Transaction cannot be processed because the merchant ref has already been used', + 1187: 'Transaction cannot be processed because the merchant ref is associated with a different offer.', + 1188: 'TID acquirer does not support CCS.', + 1189: 'Currency Conversion: cannot supply BaseCurrency and Amount', + 1190: 'Currency Conversion: cannot supply ExchangeCurrency and bin', + 1191: 'cannot contact Fexco webservice - please try again later', + 1192: 'DCC declined by Fexco', + 1193: 'Merchant not configured with Fexco service', + 1194: 'DCC declined by Fexco', + 1195: 'A problem was encountered while sending a request to or receiving a response from Fexco', + 1196: 'Split shipment is not permitted on a CCS transaction', + 1197: 'Amount cannot be specified for a CCS txn_refund', + 1220: 'Merchant not subscribed for Extended References', + 1221: 'No external reference supplied', + 1222: 'Format of external reference is incorrect', + 1223: 'External reference should have a length of 50 or fewer', + 1224: 'No payment ID supplied', + 1225: 'Payment ID should be a number between 1 and 18 digits', + 1226: 'Extended References cannot be supplied as part of a historic transaction', + 1230: 'Location code must be alphanumeric up to 50 characters', + 1231: 'The merchant has more than one valid location code for this transaction and none was specified', + 1232: 'Location code may not be provided for MPI-only transaction', + 1233: 'Location code may not be provided for COI-filtered transaction', + 1280: 'PreCall:Request contained elements that are not applicable to precall transactions', + 1281: 'No shared secret configured for authentication', + 1282: 'Authentication using SHA1 password failed', + 1283: 'PreCall:No default/base rule configured for merchant', + 1284: 'PreCall:Airline leg limit exceeded', + 1400: 'Concardis: Invalid response from Concardis', + 1401: 'No external tickets available for this service', + 1402: 'The Concardis response was corrupted', + 1403: 'Concardis: invalid service', + 1404: 'Concardis: unable to determine POS Terminal ID Coded', + 1420: 'Merchant not permitted to submit MiscCustomerInfo', + 1421: 'Card details cannot be submitted in both HPS Setup Requests and in Payment Requests', + 1422: 'MiscCustomerInfo XML block cannot be empty', + 1423: 'Card details in setup session request have expired', + 1440: 'Merchant is not configured for APG transactions', + 1441: 'Unsupported APG method', + 1442: 'Field not supported in APG transaction', + 1443: 'Required field missing from APG transaction', + 1444: 'Could not connect to the APG', + 1445: 'HTTP error while communicating to the APG', + 1446: 'Could not parse the APG response', + 1447: 'The APG rejected the transaction', + 1448: 'The APG accepted the transaction', + 1449: 'The APG indicated that the transaction has failed', + 1450: 'Reference provided must relate to live Continuous Authority account', + 1451: 'Predicted transaction date too soon', + 1452: 'Update response received without updated details', + 1453: 'PAN does not match that stored in ca_account', + 1454: 'vTID not configured for RTES', + 1455: 'MID not configured for RTES', + 1456: 'Card Scheme not supported by RTES', + 1457: 'Only historic model cont auth supported', + 1458: 'RTES Requery is currently unsupported', + 1490: 'Merchant is not subscribed for APG LDD service', + 1500: 'Not configured for this authentication mechanism', + 1501: 'Verification of Signature failed', + 1502: 'Unable to Verify the signature', + 1510: 'Custom data must be between 1 and 30 alphanumeric characters', + 1520: 'Verify method not supported by clearinghouse', + 1521: 'Ancillary data not supported for verify transaction', + 1522: 'Non-zero amount not supported for verify transaction', + 1523: 'This type of followup transaction cannot be applied to a verify transaction.', + 1524: '3DSecure not supported for verify transactions through this clearinghouse', + 1630: 'BIN Lookup: vTID is not subscribed to BIN Lookup Service', + 1651: 'The risk block for this transaction is mandatory', + 1652: 'The RSG service is mandatory but is not enabled, please contact support', + 1653: 'This acquirer is not supported for MasterCard Payment of Winnings, please contact support.', + 1654: 'This card scheme is not supported for MasterCard Payment of Winnings, please contact support.', + 1661: 'The extended_capabilities attribute must be true in a contactless environment.', + 1662: 'Missing Contactless elements', + 1663: 'Refunds are not supported from a contactless environment', + 1664: 'Cancels are not supported from a contactless environment', + 1665: 'The supplied terminal_attributes_used element is not compatible with this capturemethod - CHP: Contactless', + 1681: 'An error was encountered while attempting to get an exchange rate offer to process a refund', + 1682: 'Cannot supply token with bin', + 1683: 'Cannot supply token with bin or exchange currency', + 1791: 'The merchant is not enabled for the PayPass service', + 1792: 'The specified method is not valid for this transaction type', + 1793: 'The transaction is missing a mandatory element', + 1794: 'The transaction contains an invalid element', + 1795: 'Request to PayPass failed', + 1796: 'The provided reference does not belong to a valid setup_paypass_online transaction', + 1797: 'The provided resource URL is not a valid PayPass URL', + 1801: 'The referenced HPS session has collected card details from PayPass and is awaiting authorisation', + 1802: 'The referenced HPS PayPass transaction has failed', + 10145: '3DS MPI System Error', + 12001: 'There are more than one active passwords already registered against your vTID at the time the txn was received.', + 12002: 'The IP address of the system submitting the vtidconfiguration request is not registered against your vTID.', + 12210: 'Error loading the PayPass comms module or one of its methods', + 12211: 'Error loading PayPass payment details' +} \ No newline at end of file diff --git a/datacash/facade.py b/datacash/facade.py index a29c414..8d33152 100644 --- a/datacash/facade.py +++ b/datacash/facade.py @@ -5,7 +5,7 @@ from datacash import gateway from datacash.models import OrderTransaction - +from datacash.codes import RESPONSE_CODES class Facade(object): """ @@ -54,14 +54,8 @@ def get_friendly_decline_message(self, response): return 'The transaction was declined by your bank - please check your bankcard details and try again' def get_friendly_error_message(self, response): - # TODO: expand this dict to handle the most common errors - errors = { - 56: ('This transaction was submitted too soon after the ' - 'previous one. Please wait for a minute then try again'), - 19: 'Unable to fulfill transaction', - } default_msg = 'An error occurred when communicating with the payment gateway.' - return errors.get(response.status, default_msg) + return RESPONSE_CODES.get(response.status, default_msg) def extract_address_data(self, address): data = {}