Skip to content

Extended payment status constants in NotificationInterface #153

Open
@aimeos

Description

@aimeos

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions