arca / payment-gateways
payment gateway integration in laravel
Requires
- php: ^8.1
- dnetix/redirection: ^2.1
- illuminate/contracts: ^9.0 || ^10.0 || ^11.0 || ^12.0
- spatie/laravel-package-tools: ^1.14.0
- transbank/transbank-sdk: ^3.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.8
- pestphp/pest: ^2.20
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2025-02-28 14:28:40 UTC
README
This package seeks to implement Chilean payment gateways and in general for Laravel allowing easy payment integration.
Payment gateways added:
- Webpay
- Getnet
- PayPal
- Flow
Support us
If you want another payment gateway, write without problem and I will try to implement it.
Installation
You can install the package via composer:
composer require arca/payment-gateways
You can publish and run the migrations with:
php artisan vendor:publish --tag="payment-gateways-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="payment-gateways-config"
This is the contents of the published config file:
return [ 'getnet' => [ 'commerce_name' => 'Getnet Nombre de Comercio', 'login' => env('GETNET_LOGIN', ''), 'tranKey' => env('GETNET_TRAN_KEY', ''), 'controller' => \Arca\PaymentGateways\Http\Controllers\GetnetController::class, ], 'webpay' => [ 'commerce_name' => 'Webpay Nombre de Comercio', 'commerce_code' => env('WEBPAY_CODE', ''), 'commerce_api_key' => env('WEBPAY_API_KEY', ''), 'controller' => \Arca\PaymentGateways\Http\Controllers\WebpayController::class, ], 'paypal' => [ 'commerce_name' => 'Paypal Nombre de Comercio', 'client_id' => env('PAYPAL_CLIENT_ID', ''), 'client_secret' => env('PAYPAL_CLIENT_SECRET', ''), 'controller' => \Arca\PaymentGateways\Http\Controllers\PaypalController::class, ], 'flow' => [ 'commerce_name' => 'Flow Nombre de Comercio', 'api_key' => env('FLOW_API_KEY'), 'secret_key' => env('FLOW_SECRET'), 'controller' => \Arca\PaymentGateways\Http\Controllers\FlowController::class, 'status' => [ '1' => 'pendiente de pago', '2' => 'pagada', '3' => 'rechazada', '4' => 'anulada', '-1' => 'Tarjeta inválida', '-11' => 'Excede límite de reintentos de rechazos', '-2' => 'Error de conexión', '-3' => 'Excede monto máximo', '-4' => 'Fecha de expiración inválida', '-5' => 'Problema en autenticación', '-6' => 'Rechazo general', '-7' => 'Tarjeta bloqueada', '-8' => 'Tarjeta vencida', '-9' => 'Transacción no soportada', '-10' => 'Problema en la transacción', '999' => 'Error desconocido', ], ], ];
You can publish the assets file with:
php artisan vendor:publish --tag="payment-gateways-assets"
Optionally, you can publish the views using
php artisan vendor:publish --tag="payment-gateways-views"
Events
php artisan make:listener YourListenerClass --event=PaymentApproved php artisan make:listener Your2ListenerClass --event=PaymentRejected
EventServiceProvider
protected $listen = [ PaymentApproved::class => [ YourListenerClass::class, ], PaymentRejected::class => [ Your2ListenerClass::class, ], ];
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.