Check details before being passed to gateway.


https://forum.kartris.com/Topic1163.aspx
Print Topic | Close Window

By Neil - Thu 4 Aug 2011
We have had a few issues with details being passed to our Gateway (SagePay) causing transactions to fail.

An example is here (delivery surname field too long) ...



==================================================

Callback Failure: VendorTxCode: XXXXXX<br/>Status: INVALID<br/>Status Detail: 3119 : The DeliverySurname value is too long.<br/>Amount: 56.18 GBP<br/>VPSTxId: {XXXXXXXXXXXXXXXXXXXXXXXXX}<br/>TxAuthNo: <br/>Address: , Post Code: , CV2: <br/>Gift Aid: No<br/>3DSecureStatus: &CardType=&Last4Digits=<br/>CAVV: <br/>

==================================================


Could these fields be checked before being passed to the gateway so the customer can correct them? I assume this would need to be done for each gateway?
By Paul - Fri 5 Aug 2011
It would be tough to extend per-gateway level validation to the checkout form; we'd have to have some framework to apply rules from the gateway to the checkout form, so we could validate lengths of field and so on there.

Maybe a simpler and better way would be to truncate the values to acceptable lengths before they're sent to the payment gateway. If Kartris is happy to accept a longer value, then it will go in fine, but will get trimmed on submission to Sagepay. In this case, the customer can then edit the value at sagepay.

Just out of interest, how long is the last name? I'd imagine sagepay has fairly long values, though clearly not quite as long as we allow.
By Neil - Fri 5 Aug 2011
It appears to be 22 characters long. Doesn't seem that long does it really?!