Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/Wallet/Mandate.php
- This file was moved from src/app/Console/Commands/WalletMandate.php.
<?php | <?php | ||||
namespace App\Console\Commands; | namespace App\Console\Commands\Wallet; | ||||
use App\Console\Command; | |||||
use App\Http\Controllers\API\V4\PaymentsController; | use App\Http\Controllers\API\V4\PaymentsController; | ||||
use Illuminate\Console\Command; | |||||
class WalletMandate extends Command | class Mandate extends Command | ||||
{ | { | ||||
/** | /** | ||||
* The name and signature of the console command. | * The name and signature of the console command. | ||||
* | * | ||||
* @var string | * @var string | ||||
*/ | */ | ||||
protected $signature = 'wallet:mandate {wallet} {--disable}{--enable}'; | protected $signature = 'wallet:mandate {wallet} {--disable}{--enable}'; | ||||
/** | /** | ||||
* The console command description. | * The console command description. | ||||
* | * | ||||
* @var string | * @var string | ||||
*/ | */ | ||||
protected $description = 'Show expected charges to wallets'; | protected $description = 'Show expected charges to wallets'; | ||||
/** | /** | ||||
* Create a new command instance. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function __construct() | |||||
{ | |||||
parent::__construct(); | |||||
} | |||||
/** | |||||
* Execute the console command. | * Execute the console command. | ||||
* | * | ||||
* @return mixed | * @return mixed | ||||
*/ | */ | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
$wallet = \App\Wallet::find($this->argument('wallet')); | $wallet = \App\Wallet::find($this->argument('wallet')); | ||||
if (!$wallet) { | if (!$wallet) { | ||||
$this->error("Wallet not found"); | |||||
return 1; | return 1; | ||||
} | } | ||||
$mandate = PaymentsController::walletMandate($wallet); | $mandate = PaymentsController::walletMandate($wallet); | ||||
if (!empty($mandate['id'])) { | if (!empty($mandate['id'])) { | ||||
$disabled = $mandate['isDisabled'] ? 'Yes' : 'No'; | $disabled = $mandate['isDisabled'] ? 'Yes' : 'No'; | ||||
Show All 19 Lines |