@hjortur17 Usually you create an order in a "new" or "unpaid" state, redirect to the off-site payment gateway (passing the order ID), then your website marks the order as paid when returning from the gateway after a successful payment.
How to use Laravel Session?
Hi, I'm building a booking system in Vue, and I have a web payment on a other site. What I need to do is store my data in the session while the customer goes over to the other site and pay's and then he will be redirect to my site and then a from will be posted and store the booking.
I just can't figure out the best way to store the data in the session. I was thinking to use session key to send over to the payment site and when the customer is redirected I will match the key with the key on my site and post the form. Any good ways, to do this?
Here is my data in vue:
booking: {
carNumber: null,
carSize: "Bíltegund",
carMake: null,
carType: null,
carColor: null,
name: null,
socialId: null,
email: null,
phone: null,
dropOffDate: this.dropOffDate,
pickUpDate: this.pickUpDate,
dropOffTime: "Hvenær mættiru á Leifstöð",
pickUpTime: "Hvenær viltu sækja bílinn?",
flightNumber: null,
},
Did it like this. I created my own sessionKey
if ($request->input('reference') === $request->session()->get('form.sessionKey')) {
$booking = Booking::create([
'carNumber' => $request->session()->get('form.carNumber'),
'carSize' => $request->session()->get('form.carSize'),
'carMake' => $request->session()->get('form.carMake'),
'carType' => $request->session()->get('form.carType'),
'carColor' => $request->session()->get('form.carColor'),
'name' => $request->session()->get('form.name'),
'socialId' => $request->session()->get('form.socialId'),
'email' => $request->session()->get('form.email'),
'phone' => $request->session()->get('form.phone'),
'dropOffDate' => $request->session()->get('form.dropOffDate'),
'dropOffTime' => $request->session()->get('form.dropOffTime'),
'pickUpDate' => $request->session()->get('form.pickUpDate'),
'pickUpTime' => $request->session()->get('form.pickUpTime'),
'flightNumber' => $request->session()->get('form.flightNumber'),
'numberOfDays' => $request->session()->get('form.numberOfDays'),
'priceForDays' => $request->session()->get('form.priceForDays'),
'paidPrice' => $request->session()->get('form.paidPrice'),
'korta_authcode' => $request->input('authcode')
]);
// $booking->services()->attach($request->session()->get('form.selectedServicesId'));
// \Mail::to($request->session()->get('form.email'))
// ->cc('[email protected]')
// ->bcc('[email protected]')
// ->bcc('[email protected]')
// ->send(new BookingConfirmed($booking));
return redirect('/');
} else {
dd($request->all());
}
Please or to participate in this conversation.