HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/zelfverkopen.komma.pro/app/Console/Commands/PayByMail.php
<?php

namespace App\Console\Commands;

use App\KommaApp\Icepay\Paybymail\PaybymailService;
use Illuminate\Console\Command;

class PayByMail extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'icepay:paybymail {gender : 0 for undefined, 1 for male, 2 for female} {salutation : For example mr} {customerLastName} {customerEmail} {amountToPay : In euros} {orderId : Own order id for your own reference}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Interacts with ICEPAY\'s pay by mail';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     */
    public function handle()
    {
        $service = new PaybymailService();

        $gender = (bool) $this->argument('gender');
        $salutation = (string) $this->argument('salutation');
        $customerLastName = (string) $this->argument('customerLastName');
        $customerEmail = (string) $this->argument('customerEmail');
        $amountToPay = (int) $this->argument('amountToPay');
        $orderId = (int) $this->argument('orderId');

        $url = $service->createPaymentURL((int) $gender, $salutation, $customerLastName, $customerEmail, $amountToPay, $orderId);
        $this->info('URL: '.$url);

    }
}