thephpleague / omnipay-common

Core components for the Omnipay PHP payment processing library
MIT License
329 stars 242 forks source link

Make transaction ID available in response #242

Open aimeos opened 3 years ago

aimeos commented 3 years ago

Response:getTransactionId() returns null by default and most Omnipay drivers don't overwrite the method to return the ID. This PR makes the transaction ID available by default.

barryvdh commented 3 years ago

I think this depends on the implementation of the request? It's up to the gateways to provide the correct ID

aimeos commented 3 years ago

In cases where the gateway returns the transaction ID, yes. But most gateways don't do that and this PR makes it easier for deveolpers of Omnipay driver to create a fully working driver.

aimeos commented 3 years ago

@barryvdh For example, the Paypal_Rest gateway from the omnipay/paypal doesn't receive the transaction ID from the PayPal server but also doesn't overwrite the getTransactionId() of the response object to return those from the request object.