Closed (fixed)
Project:
Commerce Moneris
Version:
7.x-2.0-beta2
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Dec 2014 at 21:39 UTC
Updated:
29 Dec 2014 at 22:14 UTC
Jump to comment: Most recent
Comments
Comment #1
maciej.zgadzaj commentedNow that's gonna be fun.
To start with - "When an order is first paid in full" is exactly the event you want. And I'd say that with your normal configuration it will work fine. And by "normal configuration" I mean the same currency code being used by site and by the gateway. But when you changed gateway to CA, which uses different currency than US, then things went south.
What exactly happens: each Moneris gateway supports only one currency: USD and CAD respectively. When a request is sent to their API, there is no currency code in it at all. It's just assumed to be default currency.
Now, the module has the code in it which checks if the order(=site) currency is the same as gateway currency, and if not - it converts the amount from order/site currency to gateway currency. Which is good in terms of sending the correct amount, but doesn't work so well for checking the order balance later on, on which mentioned "When an order is first paid in full" rule is based.
Essentially, commerce_payment_order_balance() returns value only if all payment transactions for the order use the same currency and it has to be the same currency as the one for
order_total. If that's not the case,commerce_payment_order_balance()returns null, and the rule does not get fired.And that's probably your case - I'd guess you have site and products set up in USD, so when you changed gateway to CA it stopped working. Changing it back to US should make it work again.
But then again, it still needs either a better solution, or a better documentation...
Comment #2
maciej.zgadzaj commentedOk, I have removed the currency conversion completely in the most recent commit, it wasn't really a very good idea after all.
Instead I have added errors being returned when the order currency is different from specific gateway currency (as we shouldn't really allow for such payment transactions to be made).
Which also means that if the payment transaction is completed successfully, the "When an order is first paid in full" rule should fire ok now.
Just pushed to d.o., you might want to give the most recent 2.x-dev version a try?
Comment #3
joegl commentedI'm currently still in the beta version but I want to confirm that the Event "When an order is first paid in full" fires on capturing and does not fire during pre-auth so it works great for our current project! Thanks.