Ticket #522 (new Feature Request)
Payment library method for retrieving transaction info
| Reported by: | atomless | Owned by: | zombor |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.3 |
| Component: | Libraries | Version: | SVN HEAD |
| Keywords: | payment | Cc: |
Description
The process method of all payment drivers are currently obliged to return a simple boolean indicating success or failure.
It would be usefull for the developer if there was a method to retrieve more detailed error information - for example if the transaction failed due to a cvv2 mismatch or an address mismatch or an invalid card number, expirey date or card holder's name.
Perhaps a generalised method could be created so that all drivers could return which error occured (out of a list of general errors that all drivers are capable of returning)?
Related to this issue is the fact that the response returned from even successful Paypal api transactions (express checkout and web payments pro) contains a bunch of usefull information that the developer may wish to record like transactionID (to be used for among other things a later refund) and this does not fit well into the payment driver mold of the process method only returning TRUE or FALSE.
The Paypal (express checkout) driver presents a further challenge to the consistency of the payment driver functionality.
Through the various stages of express checkout transactions data such as shipping details and buyer contact email address are returned.
A fundamental justification for express checkout transactions is to not have to ask the user for shipping/billing info so it would be great to be able to retreive it from the response.
However, setting the process method to return this data obviously again breaks the payment driver mold and adding a separate method to the Payment library to return shipping details, buyer email and paypal transactionID, in effect imposing the unique needs of the paypal driver onto the more general needs of the other drivers, also seems questionable.
Perhaps until a more generalised method for retrieving transaction errors is added to the payment library, an effective compromise would be to set the process methods of all the drivers could to return an array that will always contain success=>boolean as well as other fields particular to each driver?
