dev-think-one /
laravel-gocardless-payment
| 1 | <?php |
||
| 2 | |||
| 3 | namespace GoCardlessPayment\Console\Commands; |
||
| 4 | |||
| 5 | use GoCardlessPayment\Actions\Imports\ImportMandateAction; |
||
| 6 | use Illuminate\Console\Command; |
||
| 7 | |||
| 8 | class ImportMandate extends Command |
||
| 9 | { |
||
| 10 | protected $signature = 'gocardless-payment:import:mandate |
||
| 11 | {id : Mandate id} |
||
| 12 | '; |
||
| 13 | |||
| 14 | protected $description = 'Import mandate to local storage by id'; |
||
| 15 | |||
| 16 | 3 | public function handle() |
|
| 17 | { |
||
| 18 | 3 | $mandateId = $this->argument('id'); |
|
| 19 | |||
| 20 | try { |
||
| 21 | 3 | $model = ImportMandateAction::make($mandateId)->execute(); |
|
| 22 | 1 | } catch (\Exception $e) { |
|
| 23 | 1 | $this->error("Mandate not imported. [{$e->getMessage()}]"); |
|
| 24 | |||
| 25 | 1 | return static::FAILURE; |
|
| 26 | } |
||
| 27 | |||
| 28 | 2 | $this->info("Imported mandate [{$model->getKey()}] for customer [{$model->customer_id}]."); |
|
|
0 ignored issues
–
show
|
|||
| 29 | |||
| 30 | 2 | return static::SUCCESS; |
|
| 31 | } |
||
| 32 | } |
||
| 33 |
Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.