app/Http/Controllers/PaypalController.php
/**
     * Responds with a welcome message with instructions
     *
     * @return \Illuminate\Http\Response
     */
Responds with a welcome message with instructions
@return \Illuminate\Http\Response
Responds with a welcome message with instructions @return \ Illuminate \ Http \ Response
public function success(Request $request)
    {
        $provider = new ExpressCheckout;
        $response = $provider->getExpressCheckoutDetails($request->token);
        if (in_array(strtoupper($response['ACK']), ['SUCCESS', 'SUCCESSWITHWARNING'])) {
            request()->session()->flash('success','You successfully pay from Paypal! Thank You');
            session()->forget('cart');
            session()->forget('coupon');
            return redirect()->route('home');
        }
        request()->session()->flash('error','Something went wrong please try again!!!');
        return redirect()->back();
    }
public function success ( Request $ request ) { $ provider = new ExpressCheckout ; $ response = $ provider -> getExpressCheckoutDetails ( $ request -> token ) ; if ( in_array ( strtoupper ( $ response [ 'ACK' ] ) , [ 'SUCCESS' , 'SUCCESSWITHWARNING' ] ) ) { request ( ) -> session ( ) -> flash ( 'success' , 'You successfully pay from Paypal! Thank You' ) ; session ( ) -> forget ( 'cart' ) ; session ( ) -> forget ( 'coupon' ) ; return redirect ( ) -> route ( 'home' ) ; } request ( ) -> session ( ) -> flash ( 'error' , 'Something went wrong please try again!!!' ) ; return redirect ( ) -> back ( ) ; }
Responds with a welcome message with instructions
 @return \Illuminate\Http\Response
Responds with a welcome message with instructions @return \ Illuminate \ Http \ Response
// return $response;