laravelnvp

Payum Laravel Package - Route not found


I'm using Payum/PayumLaravelPackage Package and I'm having a problem with this package.

I have this method:

public function prepareExpressCheckout()
{
    $storage = $this->getPayum()->getStorage('Payment');

    $details = $storage->create();
    $details['PAYMENTREQUEST_0_CURRENCYCODE'] = 'EUR';
    $details['PAYMENTREQUEST_0_AMT'] = 1.23;
    $storage->update($details);

    $captureToken = App::make('payum.security.token_factory')->createCaptureToken('paypal_ec', $details, 'done');

    return \Redirect::to($captureToken->getTargetUrl());
}

And I have the Route:

Route::get('done', 'PaypalController@done');

And Laravel gives me an error Route [done] not defined. How is it possible? And by the way, I've been searching for a long time for a simple paypal nvp library. is there any recommended library?


Solution

  • My suspicion is that the third parameter is expecting a route name, not a URL. Your routes.php route is not a named route.

    Route::get('done', ['as' => 'done', 'uses' => 'PaypalController@done']);