One consistent PHP API for many payment gateways
open sourceMITfree
Omnipay is a framework-agnostic payment processing library for PHP, from The League of Extraordinary Packages, modelled on Active Merchant. You learn one API for purchases, authorisations, captures, refunds and off-site redirects, and switch payment gateways by changing a package rather than rewriting code. The core is omnipay/common, which every gateway package implements; dozens of gateways (PayPal, Stripe, Authorize.Net, Adyen and many more, official and community-maintained) come as separate Composer packages that talk to each provider's HTTP API through PHP-HTTP, with no dependency on the providers' own SDKs.
Problems it solves
- support several payment gateways in my PHP shop without writing each integration
- switch from one payment provider to another in PHP without rewriting the checkout
- take card payments in a PHP app through a gateway with a consistent API
Features
- one API for purchase, authorize, capture, refund and void across gateways
- dozens of gateway packages, official and community-maintained
- handles off-site redirects and returns from hosted payment pages
- uses PHP-HTTP, so any HTTP client can be plugged in (Guzzle by default)
- framework agnostic, with an example application
Limitations
- Not every gateway package supports every operation: one without a feature such as refunds throws BadMethodCallException1
