request = $request; } public function handle(PayuTransaction $transaction) { $valid = Checksum::with($transaction->gateway->salt()) ->match($this->request->all(), $this->request->input('hash')); $transaction->update([ 'response' => $this->request->all(), 'status' => $valid ? PayuTransaction::STATUS_SUCCESSFUL : PayuTransaction::STATUS_INVALID, ]); $fresh = $transaction->fresh(); $dispatch = $valid ? new TransactionSuccessful($fresh) : new TransactionInvalidated($fresh); event($dispatch); } }