New Zenner
- Join Date:
- Apr 2009
- Posts:
- 4
- Plugin Contributions:
- 0
Removing Attribute information from submission to Linkpoint
We were having trouble at our site with SGS-020003: Invalid XML errors caused by ampersands in an attribute form field (i.e. customers were entering an & in the field and the linkpoint API was trying to pass this on to Linkpoint in the XML, throwing an error).
Since my understanding is that this information is not processed by Linkpoint in any significant way, a quick fix was to suppress item information from being transmitted.
To do this,
- open /public_html/includes/modules/payment/linkpoint_api.php
- find the following switch: $skip_line_items_flag = false;
- change "false" to "true"
After you have saved the file, your order items will no longer be sent to linkpoint. This reduces the information that comes back to you on the invoice; but it means that problems with your customers' attributes will not stop the payment from being processed.
Another solution to this, which I don't have time to figure out how to code, would be to scrub attribute values for non-acceptable characters. Currently this is done with address fields (which can contain & without gagging the XML).
A bigger question might be whether it is wise for zencart to allow text-field attributes to be accepted without scrubbing them first. I haven't tried yet to see if you can put code in an attribute field, but the fact that you can have un-escaped & in them is worrisome (& in address fields is scrubbed before submission to linkpoint).