Description
Currently, the NotificationInterface
only supports, "success", "pending" and "failed" status values:
https://github.com/thephpleague/omnipay-common/blob/master/src/Common/Message/NotificationInterface.php
But Omnipay itself has support for authorize, refund and void methods as well:
https://github.com/thephpleague/omnipay-common/blob/master/src/Common/AbstractGateway.php#L184
To have the same level of support in both, NotificationInterface
and in the gateways, we need at least these additional payment status constants:
- "authorized"
- "refunded"
- "void" (or "cancelled")
"pending" is not the same as "authorized" as gateways return "pending" if the payment status isn't clear yet while "authorized" if the money can be captured now. There are also payment status values sent by gateways that can't be mapped to one of those status values. Thus, getTranscationsStatus()
should return a value for "don't change current status", maybe NULL. We've seen in Jason's PayOne gateway (https://github.com/academe/OmniPay-Payone/blob/master/src/Message/ShopTransactionStatusServerRequest.php#L191) that mapping every unknown payment status to "failed" will lead to a false status because PayOne sends several updates with different notification values after the initial payment.