1

I'm writing some tests to go with additional validation on the OmniPay core AbstractRequest. I accept this may not be the best place to ask, but I am seeking answers from people who have had direct coding experience of the range of payment gateways that OmniPay supports.

Basically, should OmniPay accept a negative value as a valid amount? The amount is used for authorisation and payments mainly, but maybe there are other transaction types that may need to support negative amounts. Or are there?

If negative amounts are not supported in the core by default, then is there a preferred way to implement that particular validation rule so that an OmniPay driver can easily turn it off with the minimum of effort. A "negative_values_allowed" boolean property of the AbstractRequest perhaps? Or maybe a method to handle validateNegativeAmount() is preferable?

Jason
  • 4,411
  • 7
  • 40
  • 53
  • I'm going to go with "no they don't" at this stage. I have implemented the test with reference to a "negative_amount_allowed" property, so negative amounts can be easily supported by an OmniPay driver for a specific gateway. I would, however, still like to find a definitive answer to this question. – Jason Dec 06 '14 at 17:57
  • I have coded to about 20 different gateways and I can say that I support the "no they don't" answer. However there are hundreds of gateways out there and it's potentially possible that one gateway does support it. Most would call that a refund, though. – delatbabel Feb 13 '15 at 20:53
  • From a security standpoint, it seems unlikely, since -x would allow taking money from the merchant (different from a void or refund of an existing transaction). – Kzqai Dec 11 '15 at 08:27

0 Answers0