Sage pay and Sage 50 shopping basket Integration

Well you would think that this is well understood and well documented as sage are a pretty big payment gateway for credit card transactions. But it appears no, the fine details of the integration seem to be spread across multiple versions of documentation and worse than that across versions that look almost identical but have subtle changes in them. Even going through Sage’s support does not seem to shed light on these issues and all you get sent is yet another version of the documentation. Eventually you get all the pieces and manage to put everything together.

The latest Sagepay protocol is v3.00 at the time of writing and v3.00 supports two methods to send your items to sagepay, one is a text based format with colon delimiters, the other an XML format.

Note 1 : Sage 50 at the time of writing absolutely does not in any way imaginable support the basketXML format so don’t even bother using it. Sage 50 in fact only supports protocol v2.33 (which apart from basketXML is identical).

Note 2: If you want to send items over so that they integrate with your stock system in Sage 50 you might be very tempted to try to use basketXML as it has a productSKU field which seems exactly what you were looking for, but as per note 1 it wont work and the correct way to do it (and it depends on where you got the documentation from if you have this little jem) is in the description field place the product SKU/unique identifier in square brackets eg [PRO001]My Product:1:1.99:0:1.99:199 .

Note 3: To set the delivery charge you need to add a extra item to the basket text field, but ignore the documentation and do not set any unused fields to — set them to 0 instead, so if you have delivery with no tax it is Delivery:1:5.99:0:5.99:5.99 NOT Delivery:—:—:—:—:5.99 as per the instructions.

Note 4: Delivery charges, the name of the delivery charges you pass in the basket eg “Delivery” “Carriage” needs to match the name in sage 50 in the accounts set up or the import wizard will not know what to do with it. I believe other extras can be passed across in the same way for other non stock type charges.

Delivery charges don’t integrate correctly with sage 50, you have to set them up as a line item. Not impressed with the entire set up

Only 1 comment left Go To Comment

  1. thomas /

    I’m going through the same headache that you were. A year later, the situation is exactly the same. The documentation on the Sagepay website *still* says to use dashes and doesn’t mention that the product code can be entered in square brackets preceding the description. It also fails to specify that the quantity field needs to be an integer.

    Did you ever find a solution to the Delivery / Carriage problem?

    Thanks for the article, I just wish I’d found it about a week ago.

Leave a Reply