-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Having an issue whenever there's a negative item (not line item) in the order - namely a discount. For example, refer to the below cart:
The above has a discount set to remove the shipping value from the order, but any discount will do the same thing. Tested with taking a flat $5 off the order.
Trying to pay throws a A negative amount is not allowed..
Drilling into it, it seems mostly an omnipay issue. Refer to Getting the items in the cart, which in turn calls a common method, checking if each item is negative. Give the example above:
Money\Money#1
(
[Money\Money:amount] => '29595'
[Money\Money:currency] => Money\Currency#2
(
[Money\Currency:code] => 'AUD'
)
)
Money\Money#1
(
[Money\Money:amount] => '1350'
[Money\Money:currency] => Money\Currency#2
(
[Money\Currency:code] => 'AUD'
)
)
Money\Money#1
(
[Money\Money:amount] => '-1350'
[Money\Money:currency] => Money\Currency#2
(
[Money\Currency:code] => 'AUD'
)
)
Because one value in that is negative, this check ($money->isNegative()) is thrown.
Slightly related to this is thephpleague/omnipay-paypal#198, where the PayPal plugin includes protected $negativeAmountAllowed = true;. I have confirmed adding this the the eway plugin works.
This begs the question though - is this really not an issue for anyone else using this plugin? I would've thought this would've been picked up sooner, so just trying to figure out if I'm doing something wrong. In any case, it would probably require a fork of the omnipay-eway package?
Any ideas @lukeholder or @nfourtythree ?
