-2

Code below

public function PayCCAvenue(Request $request)
{
    $parameters = [
        'tid' => '1233221223322',
        'order_id' => '1232212',
        'amount' => '1200.00',
        'firstname'=>'test',
        'email'=>'email@fffm.com',
        'phone'=>'7736190194',
        'productinfo'=>'sfszgvfsg'

    ];
    // gateway = CCAvenue 
    $order = Payment::gateway('CCAvenue')->prepare($parameters);
    //dd(Payment::process($order));
    return Payment::process($order);
}

After return Payment::process($order); page goes blank. dd(Payment::process($order)); giving result. tried different laravel packages. same issue

Smithiam
  • 162
  • 1
  • 16
Sujith
  • 17
  • 11
  • See [WSOD](https://stackoverflow.com/questions/1475297/phps-white-screen-of-death) and [How do i get PHP errors to display](https://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display) – Xatenev Feb 28 '19 at 12:42
  • try giving read write permissions to storage. in my experience laravel does doe a dd but not the fancy exception screen it has if the read write permissions are messed up – mrQubeMaster Feb 28 '19 at 13:35
  • @mrQubeMaster laravel exception screen working perfectly for other exceptios i checked by creating a division by zero exception. $a=1/0; return Payment::process($order); also given 777 permison for storage. still blank screen. – Sujith Mar 02 '19 at 05:26
  • @Xatenev: laravel debugging on .again added error reporting on. ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); in php.ini display_errors = On; but no error log related to this issue found. – Sujith Mar 02 '19 at 05:33
  • I think problem is in routing because I give a route redirection before executing the code(**return redirect()->route('bookingafterPayment')**) . the route not redirected. and it doesn't show any error. but when i remove the bookingafterPayment route in web.php it shows route missing error. ; – Sujith Mar 02 '19 at 06:45

1 Answers1

0

Old Code

   public function payment(Request $request)
   {
       if ($request->payment_method == 1) {

          $this->paypalPAyment($request);

       } else if($request->payment_method == 1){

          $this->PayCCAvenue($request);

       }

    }


    public function PayCCAvenue(Request $request)
    {
        $parameters = [
            'tid' => '1233221223322',
            'order_id' => '1232212',
            'amount' => '1200.00',
            'firstname'=>'test',
            'email'=>'email@fffm.com',
            'phone'=>'7736190194',
            'productinfo'=>'sfszgvfsg'

        ];
        // gateway = CCAvenue 
        $order = Payment::gateway('CCAvenue')->prepare($parameters);
        //dd(Payment::process($order));
        return Payment::process($order);
    }

Working code

  public function payment(Request $request)
       {
           if ($request->payment_method == 1) {

              $this->paypalPAyment($request);

           } else if($request->payment_method == 1){

                  $parameters = [
                    'tid' => '1233221223322',
                    'order_id' => '1232212',
                    'amount' => '1200.00',
                    'firstname'=>'test',
                    'email'=>'email@fffm.com',
                    'phone'=>'7736190194',
                    'productinfo'=>'sfszgvfsg'

            ];
            // gateway = CCAvenue 
            $order = Payment::gateway('CCAvenue')->prepare($parameters);
            //dd(Payment::process($order));
            return Payment::process($order);

           }

        }

No idea why laravel page redirection was not worked when the code was in separate function.

Sujith
  • 17
  • 11