Product (version) Codes passed to SagePay Payment Gateway


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

By JBeardon - Thu 16 Aug 2012
Hi Guys
We have a site using SagePay as the payment gateway and want to import sagepay transactions into Sage Line 50. So that we can us Sage for stock control, we need to have stock  codes (ie version codes) present in the order information that is passed to SagePay.

At the moment it would appear that none of these codes are being passed to the payment gateway. Sage have advised that they need to be in square brackets at the front of the product line when passed over to Sagepay.

Can you advise if this is in-built functionality. If so, what do I need to do to enable it or if not, is there any way of getting the codes over to Sagepay.
Thanks
John
By Neil - Thu 16 Aug 2012
Not sure about the details passed to Sagepay, but we do a similar thing for accountancy purposes by just running a query against the invoice rows table in the database.

If you do a select on the invoice rows table you can see the order numbers and pull the version codes and other info (prices etc).
By JBeardon - Thu 16 Aug 2012
Many thanks Neil.
That may be of some use.

Hopefully it will not be too much of a problem to use the direct SagePay imports as we have already gone to a great deal of effort getting that side to work. It would be a shame for it to be 'scuppered' by something so basic.

If not, I will certainly look at your solution.

Thanks
John
By JBeardon - Wed 29 Aug 2012
I was quite hoping for a response from the Kartris guys regarding this.
By Paul - Sat 1 Sep 2012
The sagepay plugin does format an order description, which is a text built up of the order contents, although this doesn't include the version code, only the version name and product name (or just one, if it is a single version type product, since these are the same).

I'll see if we can get this added into the plugin...
By Medz - Wed 5 Sep 2012
Hi John, attached is an updated SagePay.dll that includes the Version CodeNumber in the product description field passed to SagePay. Can you let me know if this works for you? I've just appended the version codenumber inside square brackets at the beginning of the product description field. Its not mentioned anywhere in their documentation so I just did it based on whats written in your post.

[codenumber]productdescription
By JBeardon - Thu 6 Sep 2012
Many thanks Medz. I will give it a go and report back.
By JBeardon - Thu 6 Sep 2012
That worked Guys but we do have another problem :-(

When the shipping cost is being passed to SagePay, it appears on a line titled 'Shipping, discounts and other adjustments' - see attached screen shot.

This doesn't cause an issue apart from if the user wants to import transactions from SagePay into Sage Line 50. From what I can gather, Sage Line 50 is expecting to see the line title to be Delivery instead. The problem this causes is that when the import takes place, Sage actually sees the shipping value as a discount and takes it from the order total.

I am seeing if the accountant can work out if this is a Sage configuration issue but looking at page 22 of the SagePay/Sage integration guide, I don't think this is the case. This page also mentions the product code in square brackets so I've attached it for your reference.

Will report back regarding the Delivery charges/Sage import.

Many thanks
John
By Medz - Fri 7 Sep 2012
Ok. This one separates the shipping charges and puts it in a separate line as "Delivery". It then puts the remaining amount (if theres any) -> 

order total - (total basket items value + shipping price)

as "Discounts and other adjustments" line.

Can you check if this one does it?

Regards,

Medz
By JBeardon - Tue 2 Oct 2012
Sorry for the delay Medz.
We should be testing this tomorrow so will get back to you with results.

Many thanks for your help
John
By JBeardon - Thu 8 Nov 2012
Hi Medz 
Sorry for the delay on getting back to you on this. We have been battling with SagePay and Sage to try and get someone to give us a definitive answer regarding the format required, which apparently is not what is published in their integration guide.

The latest DLL you kindly produced is almost there, but for the Delivery line, they also require a quantity and the Tax amounts to be shown.

Apologies for this, but Sage and SagePay are proving to be a pain to deal with on this and have only just come back with this answer.

If there is anything you can do to amend the dll and include the info required, it would be greatly appreciated.

Thanks
John
By JBeardon - Thu 15 Nov 2012
UPDATE - IMPORTANT
I have now eventually spoken to someone within Sagepay who has been honest and truthful regarding this issue. The Sagepay integration guide is generic and provides no details whatsoever regarding the Sage/Sagepay integration. They will be correcting this in the future as unsurprisingly it is causing a lot of issues!

He has provided the definitive format of what needs to be included for the delivery line to import into Sage correctly.



 This is what is produced by the DLL you amended for us to include the product code in square brackets and separate the delivery.

Basket items

Quantity

Item value

Item tax

Item total

Line total

[TT123]Bag

4

7.08

1.42

8.5

34

Delivery

-

-

-

-

4.95

 

This is what it should look like, each field needs to have a value in it, no dashes (-):

 

Basket items

Quantity

Item value

Item tax

Item total

Line total

[TT123]Bag

4

7.08

1.42

8.5

34

Delivery

1

4.95

0

4.95

4.95

 

 This format will still work for generic sagepay integration, but will also have the benefit of allowing Sage Line 50 users to download SagePay transactions into their accounts package, integrate with Sage stock management and also handle the delivery correctly.


If you could amend the DLL to produce this for us we would be eternally grateful and it would also be of great assistance to other Sage users.


Thanks


John

 

 

By Medz - Thu 22 Nov 2012
Hi John, attached is the updated Kartris Interfaces DLL and SagePay DLL that contain these changes. The interface DLL goes to the 'bin' folder of your Kartris root and the actual sagepay DLL to 'Plugins/SagePay/'. These DLLs are the ones that will be included in the upcoming Kartris 2.0 release. Since you're still using Kartris v1.xxx, you need to add the line below to your checkout script in order for it to work properly ->

objOrder.ShippingExTaxPrice = CurrenciesBLL.FormatCurrencyPrice(CUR_ID, objBasket.ShippingPrice.ExTax, False)



You need to insert the new line before or after this line in Checkout.aspx.vb ->

objOrder.ShippingPrice = CurrenciesBLL.FormatCurrencyPrice(CUR_ID, objBasket.ShippingPrice.IncTax, False)


Let me know if it works for you.

Regards,

Medz