bozboz / payment
Requires
- guzzlehttp/guzzle: ^6.2
- omnipay/sagepay: ^2.3
- symfony/http-foundation: ^2.8
Requires (Dev)
- phpunit/phpunit: 4.*
This package is auto-updated.
Last update: 2021-06-04 10:21:01 UTC
README
Installation
- See http://gitlab.lab/laravel-packages/ecommerce
- Run
php artisan vendor:publish && php artisan migrate
- Edit
config/payment.php
Usage
The payment package contains implementations for SagePay and PayPal. It should be pretty easy to add Stripe, it's been done on TicketRunway which is an older version ofthe Laravel CMS but it should be fairly easy to adapt.
http://gitlab.lab/bozboz/ticketrunway/blob/master/app/Bozboz/Ecommerce/Payment/StripeGateway.php
All the different payment gateways are registered in PaymentServiceProvider::registerPaymentGateways
. This sets up the gateway with the relevant config ready for use. At the bottom of the method there are abstract gateways that are bound to implementations of actual gateways depending on whether test_payments
is set in the config or not.
The payment gateways use a package called Omnipay to do all the actual communication with the payment provider (https://omnipay.thephpleague.com/).
If using a gateway that requires making a callback from the payment provider to our server, e.g. ExternalGateway (i.e. TestIFrameGateway or IFrameSagePayGateway), the URLs 'checkout/callback' and 'checkout/billing' must be added to $except
in App\Http\Middleware\VerifyCsrfToken
and $whitelist
in App\Http\Middleware\FrontHoldingPage
.