Omnipay
A framework agnostic, multi-gateway payment processing library
...It has a clear and consistent API, is fully unit tested, and even comes with an example application to get you started. You can learn one API and use it in multiple projects using different payment gateways. If you need to change payment gateways you won’t need to rewrite your code. Most official PHP payment gateway libraries are a mess. Most payment gateways have exceptionally poor documentation. So, why use Omnipay instead of a gateway’s official PHP package/example code? Because you are writing a shopping cart and need to support multiple gateways.