'required', 'payment_hash' => 'required', ]; } public function getPaymentHash() { $input = $this->all(); return PaymentHash::where('hash', $input['payment_hash'])->first(); } public function shouldStoreToken(): bool { return (bool) $this->store_card; } public function prepareForValidation() { if ($this->has('store_card')) { $this->merge([ 'store_card' => ($this->store_card === 'true' || $this->store_card === true) ? true : false, ]); } if ($this->has('pay_with_token')) { $this->merge([ 'pay_with_token' => ($this->pay_with_token === 'true' || $this->pay_with_token === true) ? true : false, ]); } } public function shouldUseToken(): bool { return (bool) $this->token; } }