Reputation: 2139
I am using a payment package which returns an instance of RedirecResponse class, then the user is redirected to the payment page.
I need to use this in a mobile application. I don't know how to tell the application to open that paying page. I can't return the instance of RedirecResponse to the application, therefore I have to get the url of the payment page from the instance of RedirecResponse and then return it to the application, then application must open the browser.
The TargetUrl
property contains the url but Laravel returns the following error while accessing this:
Cannot access protected property Illuminate\Http\RedirectResponse::$targetUrl
How can I get the url from RedirectResponse?
Thanks
Upvotes: 0
Views: 1927
Reputation: 748
You can add $redirectResponse->getTargetUrl()
something like this to get redirect response.
Upvotes: 4