vendredi 29 mars 2019

Laravel - Route can't be found when I added in a request validator

I have a function to handle payments on my site. When I change Request $request to PropertyPaymentRequest $request

Is there any reason why?

public function ProcessAdvertPayment(Property $property, PropertyPaymentRequest $request)
    {

        $payload = $request->input('payload', false);
        $nonce = $payload['nonce'];

        $payment = Braintree_Transaction::sale([
            'amount' => 1,
            'paymentMethodNonce' => $nonce,
            'creditCard' => ['number' => request('cardnumber'), 'expirationDate' => request('month') . '/' . request('year'), "cvv" => request('cvv')],
        ]);

        if($payment->success)
        {
            $property->payment()->create($request);
        }

        return response()->json($payment);
    }

Thanks



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2FJjc1h
via IFTTT

Aucun commentaire:

Enregistrer un commentaire