Offline Payment modified.

This commit is contained in:
Cüneyt Şentürk 2017-11-17 02:09:11 +03:00
parent a3dbdaffad
commit 5b9d9d1b03
4 changed files with 85 additions and 0 deletions

View 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;
}
}

View 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',
];
}
}

View File

@ -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,
];*/
}
}

View File

@ -11,6 +11,9 @@ use Modules\OfflinePayment\Events\Handlers\OfflinePaymentAdminMenu;
use App\Events\PaymentGatewayListing;
use Modules\OfflinePayment\Events\Handlers\OfflinePaymentGateway;
use App\Events\PaymentGatewayConfirm;
use Modules\OfflinePayment\Events\Handlers\OfflinePaymentConfirm;
class OfflinePaymentServiceProvider extends ServiceProvider
{
/**
@ -36,6 +39,7 @@ class OfflinePaymentServiceProvider extends ServiceProvider
$this->app['events']->listen(AdminMenuCreated::class, OfflinePaymentAdminMenu::class);
$this->app['events']->listen(PaymentGatewayListing::class, OfflinePaymentGateway::class);
$this->app['events']->listen(PaymentGatewayConfirm::class, OfflinePaymentConfirm::class);
}
/**