在Laravel上集成Paypal的难度

This is my first time to implement Paypal on my project. I am using srmklive/laravel-paypal and on the documentation I tested the following code

This is my controller:

class CheckoutController extends Controller
{
    protected $provider;
    public function __construct(){
        $this->provider = new ExpressCheckout();
    }

    public function getExpressCheckout(Request $request){
        $data = [];
        $data['items'] = [
          [
            'name' => 'Product 1',
            'price' => 9.99,
            'qty' => 1
          ],
          [
            'name' => 'Product 2',
            'price' => 4.99,
            'qty' => 2
          ]
        ];

        $data['invoice_id'] = 2;
        $data['invoice_description'] = "test";
        $data['return_url'] = url('/');
        $data['cancel_url'] = url('/cart');

        $total = 0;
        foreach($data['items'] as $item) {
            $total += $item['price']*$item['qty'];
        }

        $data['total'] = $total;

        //give a discount of 10% of the order amount
        $data['shipping_discount'] = round((10 / 100) * $total, 2);
        $response = $this->provider->setExpressCheckout($data);
        return redirect($response['paypal_link']);
    }
 }

This is my route:

Route::get('/paypal/ec-checkout', 'CheckoutController@getExpressCheckout')->name('checkout');

This is my link:

 <a href="{{ route('checkout') }}" class="btn btn-primary pull-right" style="margin-bottom:20px;">Checkout</a>

My problem is when I click the link it just loads forever and no errors are displayed. I am using Laravel 5.6