Haider
Haider

Reputation: 55

How to integrate paypal in laravel

when PayPal form request in controller error occurs this

Object of class Illuminate\Routing\Redirector could not be converted to string

Error in Controller I think this function create error setExpressCheckout()

$provider = new ExpressCheckout;
    
$response = $provider->setExpressCheckout($data);
    
$response = $provider->setExpressCheckout($data, true);
    
return redirect($response['paypal_link']);

Thanks in advance

Upvotes: 1

Views: 67

Answers (1)

Hafez Divandari
Hafez Divandari

Reputation: 9029

You may redirect to a domain outside of your application by calling the away method:

return redirect()->away($response['paypal_link']);

See Laravel docs for more info.

Upvotes: 1

Related Questions