1

I am using an API from a payments-provider.

At some point, I show the user a page where he can authenticate himself (enter a code that the payment-provider will send him). Note that on this page, I render a div element that the payment-provider has given me through an API request I made previously (I used Guzzle for this).

After the user enters the code and clicks submit, the payment-provider redirects him to one of my pages - let's say /redirect. So, in my web.php I have a route:

Route::post('/redirect', 'OrdersController@redirect');

In my OrdersController I do this:

// do various stuff like updating the order status

return redirect("orders/$order->id");

There is another route in web.php:

Route::get('/orders/{order}', 'OrdersController@show');

And here is the show method:

return view('orders/show', [
    'order' => $order,
    'page_title' => 'Order Receipt',
]);

Two things go wrong:

  1. The user gets shown the orders/show view but it seems like it is in an iframe: enter image description here

  2. The URL of the page does not change. It does not show myapp.test/orders/435 for example. Instead, it still shows the URL of the previous page (the one where the user authenticated himself) - something like myapp.test/authenticate let's say.

Any ideas why this is happening?


Update with screenshot: enter image description here

padawanTony
  • 1,348
  • 2
  • 22
  • 41
  • 1
    `On this page, I render a div element that the payment-provider has given me through an API request I made previously` -> does it contain an iframe? – Vadim Sirbu Dec 06 '20 at 12:55
  • "_but it seems like it is in an iframe_" You could easily check if there's an iframe by looking at the HTML source of the page – brombeer Dec 06 '20 at 13:04
  • `return view('orders/show')` shouldn't be `return view('orders.show')`? A dot instead of slash? – KazikM Dec 07 '20 at 16:19
  • @VadimSirbu I have updated the description with a screenshot. My page gets displayed inside an iframe. – padawanTony Dec 10 '20 at 00:15
  • @brombeer you are right of course - I was too drowsy to think of that - description updated – padawanTony Dec 10 '20 at 00:16
  • @KazikM it's the same thing. – padawanTony Dec 10 '20 at 00:16
  • I have overcome this by using JS to redirect from within the view. Of course, this is a hack. The issue remains. Just FYI this issue is occurring while using Mastercard's Payment Gateway service. – padawanTony Dec 24 '20 at 00:51

0 Answers0