rene-roscher / paymix
This package is abandoned and no longer maintained.
No replacement package was suggested.
Simplified Payments of many Providers
1.4
2020-11-14 06:37 UTC
Requires
- php: ^7.1
- illuminate/support: *
- paypal/rest-api-sdk-php: ^1.14
Requires (Dev)
- orchestra/testbench: ^4.0
- phpunit/phpunit: ^8.0
README
Installation
You can install the package via composer:
composer require rene-roscher/paymix
Usage
php artisan vendor:publish --provider="RServices\PayMix\PaymixServiceProvider"
// Create Payment use $repo = \RServices\PayMix\PayMix::create('PAYPAL')->getRepository(); or $repo = \paymix('PAYPAL'); /** @return PaymentRepositoryInterface */ $repo->createTransaction(\RServices\PayMix\Objects\TransactionData::make(14.99, 'Movie XY', \Illuminate\Support\Str::random(6))); // redirect user to payment provider $repo->getPaymentUri();
// Callback /** @return string|PaymentResponseType */ $state = \RServices\PayMix\PayMix::create()->getRepository()->handleRequest(\request()); if ($state == \RServices\PayMix\Objects\PaymentResponseType::SUCCESSFULLY_PAID) return 'successfully paid the movie xy';
Configuration
[ 'paypal' => [ 'live' => [ 'client_id' => env('PAYMIX_PAYPAL_CLIENT_ID'), 'client_secret' => env('PAYMIX_PAYPAL_CLIENT_SECRET'), ], 'sandbox' => [ 'client_id' => env('PAYMIX_SANDBOX_PAYPAL_CLIENT_ID'), 'client_secret' => env('PAYMIX_SANDBOX_PAYPAL_CLIENT_SECRET'), ], 'config' => [ 'mode' => 'sandbox', 'log.LogEnabled' => TRUE, 'log.FileName' => storage_path('paypal.log'), 'log.LogLevel' => 'FINE', 'validation.level' => 'log', 'cache.enabled' => TRUE, 'cache.FileName' => storage_path('paypal-cache.log'), ], 'redirect_urls' => [ // Named-Route 'return_url' => 'payment.paid.successfully', 'cancel_url' => 'payment.paid.failured', ] ], ];
License
The MIT License (MIT). Please see License File for more information.