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