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