-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a3dbdaf
commit 5b9d9d1
Showing
4 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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', | ||
]; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
modules/OfflinePayment/Events/Handlers/OfflinePaymentConfirm.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
];*/ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters