Modules/Payment/Http/Controllers/PaymentController.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 payment()
      {
        $config = [
            'mode'    => 'live',
            'live' => [
                'client_id'         => 'some-client-id',
                'client_secret'     => 'some-client-secret',
                'app_id'            => 'APP-80W284485P519543T',
            ],
            'payment_action' => 'Sale',
            'currency'       => 'USD',
            'notify_url'     => 'https://your-app.com/paypal/notify',
            'locale'         => 'en_US',
            'validate_ssl'   => true,
        ];
        $provider = new PayPalClient;
        $provider->setApiCredentials($config);
        $provider->setCurrency('EUR');
        $response=$provider->createOrder([
            "intent"=> "CAPTURE",
            "purchase_units"=> [
                "amount"=> [
                  "currency_code"=> "USD",
                  "value"=> "100.00"
                ]
            ]
        ]);
          return redirect($response['paypal_link']);
      }
public function payment ( ) { $ config = [ 'mode' => 'live' , 'live' => [ 'client_id' => 'some-client-id' , 'client_secret' => 'some-client-secret' , 'app_id' => 'APP-80W284485P519543T' , ] , 'payment_action' => 'Sale' , 'currency' => 'USD' , 'notify_url' => 'https://your-app.com/paypal/notify' , 'locale' => 'en_US' , 'validate_ssl' => true , ] ; $ provider = new PayPalClient ; $ provider -> setApiCredentials ( $ config ) ; $ provider -> setCurrency ( 'EUR' ) ; $ response = $ provider -> createOrder ( [ " intent " => " CAPTURE " , " purchase_units " => [ " amount " => [ " currency_code " => " USD " , " value " => " 100.00 " ] ] ] ) ; return redirect ( $ response [ 'paypal_link' ] ) ; }
Responds with a welcome message with instructions
 @return \Illuminate\Http\Response
Responds with a welcome message with instructions @return \ Illuminate \ Http \ Response