mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
58 lines
1.1 KiB
PHP
58 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Gateways\Checkout3ds;
|
|
|
|
use App\Models\Client;
|
|
use App\Models\Company;
|
|
use App\Models\CompanyGateway;
|
|
use App\Models\PaymentHash;
|
|
use App\Utils\Traits\MakesHash;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class Checkout3dsRequest extends FormRequest
|
|
{
|
|
use MakesHash;
|
|
|
|
/**
|
|
* 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 [
|
|
//
|
|
];
|
|
}
|
|
|
|
public function getCompany()
|
|
{
|
|
return Company::where('company_key', $this->company_key)->first();
|
|
}
|
|
|
|
public function getCompanyGateway()
|
|
{
|
|
return CompanyGateway::find($this->decodePrimaryKey($this->company_gateway_id));
|
|
}
|
|
|
|
public function getPaymentHash()
|
|
{
|
|
return PaymentHash::where('hash', $this->hash)->first();
|
|
}
|
|
|
|
public function getClient()
|
|
{
|
|
return Client::find($this->getPaymentHash()->data->client_id);
|
|
}
|
|
}
|