title: Got TokenMismatchException in VerifyCsrfMiddleware.php line 16 laravel 5
body: <p>I am making an ecommerce web application using Laravel 5.</p>
  
  <p>Now I am stuck at the payment integration. I am using <code>CCAvenue</code> as my payment integration, but there is no support provided from the ccavenue itself for laravel framework.</p>
  
  <p>So, after a bit of research, I got this package called <a href="https://github.com/softon/indipay" rel="nofollow noreferrer">Indipay</a>. This package works completely fine. However, I get <code>TokenMismatchException</code>. Though the transaction is successful and I do get the notification of the payment being received.</p>
  
  <p>Check the below image:</p>
  
  <p><a href="https://i.stack.imgur.com/pF85Y.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pF85Y.jpg" alt="enter image description here"></a></p>
  
  <p><strong>routes.php</strong></p>
  
  <pre><code>Route::post('/store/proceed-to-checkout', 'CheckoutController@proceedToCheckout');
  Route::get('/store/thank-you', 'PagesController@getThankYou');
  </code></pre>
  
  <p><strong>CheckoutController.php</strong></p>
  
  <pre><code>public function proceedToCheckout(Request $request)
  {
      $orderCode = Order::latest()-&gt;limit(1)-&gt;first();
      $newOrderCode = ($orderCode) ? ++$orderCode-&gt;order_code : 'ORD-000000001';
  
      $parameters = [
          'merchant_id' =&gt; $request-&gt;get('merchant_id'),
          'currency' =&gt; $request-&gt;get('currency'),
          'redirect_url' =&gt; $request-&gt;get('redirect_url'),
          'cancel_url' =&gt; $request-&gt;get('cancel_url'),
          'language' =&gt; 'EN',
          'order_id' =&gt; $newOrderCode,
          'actionId' =&gt; $request-&gt;get('actionID'),
          'TxnType' =&gt; $request-&gt;get('TxnType'),
          'amount' =&gt; $request-&gt;get('amount'),
          'tid' =&gt; time().rand(111,999)
      ];
  
      return Indipay::purchase($parameters);
  }
  </code></pre>
  
  <p><strong>PagesController.php</strong></p>
  
  <pre><code>public function getThankYou(Request $request)
  {
      $ordCode = Session::get('ordCode');
  
      $response = Indipay::response($request);
  
      dd($response);
  
      //return view('version-seven.pages.thank_you', compact('ordCode'));
  }
  </code></pre>
  
  <p><strong>Kernel.php</strong></p>
  
  <pre><code>&lt;?php namespace App\Http;
  
  use Illuminate\Foundation\Http\Kernel as HttpKernel;
  
  class Kernel extends HttpKernel {
  
      /**
       * The application's global HTTP middleware stack.
       *
       * @var array
       */
      protected $middleware = [
          'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode',
          'Illuminate\Cookie\Middleware\EncryptCookies',
          'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse',
          'Illuminate\Session\Middleware\StartSession',
          'Illuminate\View\Middleware\ShareErrorsFromSession',
          //'App\Http\Middleware\VerifyCsrfToken',
          'App\Http\Middleware\VerifyCsrfMiddleware',
      ];
  
      /**
       * The application's route middleware.
       *
       * @var array
       */
      protected $routeMiddleware = [
          'auth' =&gt; 'App\Http\Middleware\Authenticate',
          'auth.basic' =&gt; 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
          'guest' =&gt; 'App\Http\Middleware\RedirectIfAuthenticated',
          'admin' =&gt; 'App\Http\Middleware\AdminAuthentication',
      ];
  
  }
  </code></pre>
  
  <p>What could be the possible issue ? Can anybody help me out with this ??</p>
  
  <p>Any help is highly appreciated. Thank you.</p>