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



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire