rene-roscher / paymix
Simplified Payments of many Providers
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/rene-roscher/paymix
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.