You can install the package via composer:
composer require rene-roscher/paymix
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';
[
'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',
]
],
];
The MIT License (MIT). Please see License File for more information.