Offline Payment modified.
This commit is contained in:
parent
a3dbdaffad
commit
5b9d9d1b03
22
app/Events/PaymentGatewayConfirm.php
Normal file
22
app/Events/PaymentGatewayConfirm.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Events;
|
||||||
|
|
||||||
|
class PaymentGatewayConfirm
|
||||||
|
{
|
||||||
|
public $gateway;
|
||||||
|
|
||||||
|
public $invoice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new event instance.
|
||||||
|
*
|
||||||
|
* @param $gateway
|
||||||
|
* @param $invoice
|
||||||
|
*/
|
||||||
|
public function __construct($gateway, $invoice)
|
||||||
|
{
|
||||||
|
$this->gateway = $gateway;
|
||||||
|
$this->invoice = $invoice;
|
||||||
|
}
|
||||||
|
}
|
31
app/Http/Requests/Customer/InvoicePayment.php
Normal file
31
app/Http/Requests/Customer/InvoicePayment.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\Customer;
|
||||||
|
|
||||||
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
|
class InvoicePayment extends Request
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorize()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'invoice_id' => 'required|integer',
|
||||||
|
'payment_method' => 'required|string',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\OfflinePayment\Events\Handlers;
|
||||||
|
|
||||||
|
use App\Events\PaymentGatewayConfirm;
|
||||||
|
|
||||||
|
class OfflinePaymentConfirm
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Handle the event.
|
||||||
|
*
|
||||||
|
* @param PaymentGatewayConfirm $event
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function handle(PaymentGatewayConfirm $event)
|
||||||
|
{
|
||||||
|
/*if (strpos($event->gateway, 'offlinepayment') === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
'code' => $event->gateway,
|
||||||
|
'name' => $event->gateway,
|
||||||
|
'redirect' => false,
|
||||||
|
'html' => true,
|
||||||
|
];*/
|
||||||
|
}
|
||||||
|
}
|
@ -11,6 +11,9 @@ use Modules\OfflinePayment\Events\Handlers\OfflinePaymentAdminMenu;
|
|||||||
use App\Events\PaymentGatewayListing;
|
use App\Events\PaymentGatewayListing;
|
||||||
use Modules\OfflinePayment\Events\Handlers\OfflinePaymentGateway;
|
use Modules\OfflinePayment\Events\Handlers\OfflinePaymentGateway;
|
||||||
|
|
||||||
|
use App\Events\PaymentGatewayConfirm;
|
||||||
|
use Modules\OfflinePayment\Events\Handlers\OfflinePaymentConfirm;
|
||||||
|
|
||||||
class OfflinePaymentServiceProvider extends ServiceProvider
|
class OfflinePaymentServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -36,6 +39,7 @@ class OfflinePaymentServiceProvider extends ServiceProvider
|
|||||||
|
|
||||||
$this->app['events']->listen(AdminMenuCreated::class, OfflinePaymentAdminMenu::class);
|
$this->app['events']->listen(AdminMenuCreated::class, OfflinePaymentAdminMenu::class);
|
||||||
$this->app['events']->listen(PaymentGatewayListing::class, OfflinePaymentGateway::class);
|
$this->app['events']->listen(PaymentGatewayListing::class, OfflinePaymentGateway::class);
|
||||||
|
$this->app['events']->listen(PaymentGatewayConfirm::class, OfflinePaymentConfirm::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user