thephpleague / omnipay-sagepay

Sage Pay driver for the Omnipay PHP payment processing library
MIT License
54 stars 78 forks source link

No isSuccessful() in the notification handler #124

Closed judgej closed 5 years ago

judgej commented 5 years ago

For Sage Pay Server, the last the merchant site hears from the gateway is the result sent in the notification callback. There is no complete* method used when the user finally returns to the merchant site, since no data is returned with the user - it is all in the site's data store.

The standard Omnipay NotificationInterface does not require an isSuccessful() method, but arguably one is needed here so the merchant site can make a decision based on whether the transaction was successful or not.

This is easily supported by moving the isSuccessful() method from the Response message class to the ResponseFieldsTrait, so it is shared with both the Direct response and the AcceptNotification server request.

judgej commented 5 years ago

Fixed and released. Additional small test to be pushed, which can wait for the next release.