app/Http/Controllers/PaypalController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index(Request $request)
    {
        $product = Product::find($request->product_id);
        $auth = $this->authentication();
        $payer = $this->payer();
        $transaction = $this->transaction($product->price);
        $redirectUrls = $this->redirectUrls(route('paypal_return'), route('paypal_cancel'));
        $payment = $this->payment($payer, $transaction, $redirectUrls);
        @$payment->create($auth);
        return redirect($payment->getApprovalLink());
    }
public function index ( Request $ request ) { $ product = Product :: find ( $ request -> product_id ) ; $ auth = $ this -> authentication ( ) ; $ payer = $ this -> payer ( ) ; $ transaction = $ this -> transaction ( $ product -> price ) ; $ redirectUrls = $ this -> redirectUrls ( route ( 'paypal_return' ) , route ( 'paypal_cancel' ) ) ; $ payment = $ this -> payment ( $ payer , $ transaction , $ redirectUrls ) ; @ $ payment -> create ( $ auth ) ; return redirect ( $ payment -> getApprovalLink ( ) ) ; }
Display a listing of the resource.
Display a listing of the resource .