I'm currently doing some testing with this module, and am having trouble getting it to work. I don't get anything informative in the watchdog log, but doing a few var_dumps here and there, I can see that the $amount value getting fed to uc_securepayau_charge() via the uc_securepayau_payment_gateway() hook, is a float.

According to the securepay xml documentation, its suppose to be an integer, in cents.
http://www.securepay.com.au/resources/Secure-XML-API/Integration-Guide-p...

Is anyone else seeing this issue?

Thanks.

CommentFileSizeAuthor
#1 uc_securepayau-944686.patch1.47 KBalexkb

Comments

alexkb’s picture

StatusFileSize
new1.47 KB

I've made a small patch on HEAD (but should also work on the 1.x-dev version) for fixing this, as well as displaying a more meaningful message in the watchdog log.

Basically, it's expected that $amount is a float, but the problem in my case (not sure if its caused by another module like uc_vat), is that the $amount has some random fraction of a cent, i.e. instead of 20.00 its 20.00001.

The fix for the amount issue, is a bit of a hack, as it's likely not uc_securepayau's fault, but frankly, I don't have time right now to work out the cause.

If anyone has any other idea's about how to fix this more elegantly, please reply.

univate’s picture

Even just casting the amount to an int would probably do the job here.

'amount' => (int)($amount*100),
alexkb’s picture

Thanks Univate - will your suggestion be committed into your module? perhaps along with the watchdog log change too.

univate’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.