Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pending Success #433

Open
lukeholder opened this issue May 12, 2017 · 11 comments
Open

Pending Success #433

lukeholder opened this issue May 12, 2017 · 11 comments

Comments

@lukeholder
Copy link

What is the recommendation for gateway which wants to return a type of 'pending success'. These types of responses are usually returned and relate with the acceptNotification() method, where the real success to sent to the commerce application at a later time outside of the customer checkout flow.

What should the response object's isSuccessful()return when the request worked and the customer should be able to get a success response, but the payment is not actually made yet?

Based on how all other gateway drivers work at the moment, the isSuccessful() method is being used across all gateways as a flag to whether the transaction/payment as a whole was completed and paid.

Welcome thoughts please.

@lukeholder
Copy link
Author

May be related to #339

@barryvdh
Copy link
Member

When it's pending, it's not succesfull. Perhaps isPending() should be added to the interface?

@lukeholder
Copy link
Author

Something like isPending() would be great.

@lukeholder
Copy link
Author

Actually I see that there is already a isPending() in AbstractResponse

    /**
     * Is the response successful?
     *
     * @return boolean
     */
    public function isPending()
    {
        return false;
    }

The issue is most of the time the isSuccessful() is really only looking for an absence of an error.

The question is, can isPending and isSuccessful both be true?

@barryvdh
Copy link
Member

No

@lukeholder
Copy link
Author

lukeholder commented May 13, 2017

If they can't both be true then I am thinking we need a new pendingSuccessful() right? all others would be false.

@barryvdh
Copy link
Member

Pending is undefined, so it can still fail, we just don't know.

@aimeos
Copy link

aimeos commented May 13, 2017

The are more transaction status values that can be returned by the payment gateways. This is also related to thephpleague/omnipay-common#153

@lukeholder
Copy link
Author

@aimeos correct, but I am not talking about the notification, I am talking about the response for the initial purchase request.

@aimeos
Copy link

aimeos commented May 14, 2017

@lukeholder Yes, but the problem is in principle the same for accepNotification() and completePuchase()

@delatbabel
Copy link
Contributor

It is not uncommon for a gateway to return no result (empty data) for a pending success. Be aware of that. It's also not uncommon for a gateway to time out, which is also normally treated as "pending" because of PCI implications about maximum wait times between financial institutions.

I have seen cases of a notify being sent on a notifyUrl which arrives after the pending success, indicating the true success or failure status. I have also seen cases of the notify arriving before the pending success result -- in those cases the notify data is considered canonical, not the pending result. PaymentWall is a case in point that does this.

I have also seen one gateway that always returns pending for failed transactions, followed up by one or more notifys being sent to the notifyUrl which gives the failure message as well as detailed data about the failure reasons, fraud scores, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants