Open Zauberfisch opened 10 years ago
it looks like Incomplete
is not actually the default value. PaymentProcessor->setup() is where a new Payment
object is created, and the status there is set to Pending
futher investigation on this matter reveals that in fact the Incomplete
status is not used in the payment module at all.
the cancel
handler in PaymentProcessor.php Line 310 actually creates a PaymentGateway_Failure
, which in turn sets the status for the cancelled payment to Failure
.
Further inconsistencies can be found in the payment modules:
Incomplete
for pending paymentsIncomplete
as cannot reach gatewayto sum it up: we need to clearly define which status means what.
and fix all modules according to that definition.
@Zauberfisch thanks for picking this up. I believe this line should not have been in the docs:
As you say we definitely need to clarify, initially a payment is created as Pending (awaiting actual payment to be made, appropriate for payment methods such as cheque/bank transfer).
The PayPal and PaymentExpress modules check the payment was completed by querying the API again and (iirc) this is where a payment might be marked as "Incomplete".
what would Incomplete mean than? is it another form of pending? or does Incomplete mean some kind of failure?
I guess "Incomplete" is comparable to "Failure". The payment might have been made, but has not been confirmed. Perhaps it is similar to "Pending" in that sense.
You just made it sound like its both ^^
also, what if the gate way returns status pending? some gateways also handle bank transfer or bank withdraw for you. so that means the payment gateway process might have been successful, but the payment is pending, because the gateway has to withdraw the money from the bank.
so the status is still pending. but the gateway process has to be logged as successful, to know that this part was successful. could this be considered incomplete?
Yes I think it could be considered "Incomplete" in that case.
ok, so how about we define it as follows:
Pending
, the payment has been initiated, but nothing has been recorded sinceIncomplete
, an update has been recorded, but the payment has neither failed nor was it successful, further updates are to be expectedFailure
, an error occurred and the payment was unable to completeSuccess
, the payment was successfulshould we add an additional status "Cancelled" as a separation between cancel and failure? Some Gateway providers support separation of those 2 states.
Sounds good, if a gateway has the additional "Cancel" status maybe that could be added to the module for that particular gateway rather than the Payment module itself.
from Payment.php Line 14 to 24:
note the inconsistency of status
Incomplete
. It is first described as the default, with meaning that nothing happened yet. A few lines below it says thatIncomplete
means cancelled.the documentation needs to be fixed, but first we need to clarify what
Incomplete
actually means.