Download the PHP package lukasz-adamski/laravel-przelewy24 without Composer
On this page you can find all versions of the php package lukasz-adamski/laravel-przelewy24. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lukasz-adamski/laravel-przelewy24
More information about lukasz-adamski/laravel-przelewy24
Files in lukasz-adamski/laravel-przelewy24
Package laravel-przelewy24
Short Description Przelewy24 payments processor service provider for Laravel framework.
License MIT
Informations about the package laravel-przelewy24
Przelewy24 payment processor for Laravel
Laravel package which provides Przelewy24 payment processor support.
Installation
-
Install composer package using command:
-
Add Service Provider in
config/app.php
: -
Add Facade in
config/app.php
: -
Publish configuration file to your project:
- If you have
package_routes
setting enabled you need to except/webhook/przelewy24
route from CSRF verification inapp/Http/Middleware/VerifyCsrfToken.php
:
Environment
You can setup these environment variables to configure Przelewy24 API access:
PRZELEWY24_MODE
- Current API mode, by default this value is set tosandbox
to test implementation. On production you need to set this value tolive
,PRZELEWY24_MERCHANT_ID
- Your merchant identifier received from payment provider,PRZELEWY24_POS_ID
- Shop identifier to process payments. If you don't want to process incoming payments to given shop enter here merchant identifier and payments will not be classified to any shop,PRZELEWY24_CRC
- Random string received from payment provider to sign API requests.
Testing
To run predefined test set use:
Usage
Below you have example controller implementation:
Events
When transaction receiver from this package is enabled (package_routes
setting) you can listen for predefined events dispatched by default webhook controller:
\Adams\Przelewy24\Events\TransactionReceived::class
- transaction was successfully received (signature is valid). If you don't use automatic verification you need to do it manually to charge prepaid money,\Adams\Przelewy24\Events\TransactionVerified::class
- transaction was successfully received and verified via provider's API. After dispatching this event, prepaid money is already added to your account.
Example
-
Below you can see example code of
TransactionVerified
event listener created byphp artisan make:listener ReceivePayment
: - You also need to register new listener in
app/Providers/EventServiceProvider.php
file.