2

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?

Eliya Cohen
  • 10,716
  • 13
  • 59
  • 116
  • What triggers the error? Going to the `/done` URL? Have you tried naming the route? http://laravel.com/docs/5.1/routing#named-routes – ceejayoz Jun 22 '15 at 18:17
  • @ceejayoz It's shown when I'm on the route who's routing to `prepareExpressCheckout()` Method. when I tried to `dd()` before the return, the error was still exists.. so the error is in the `$captureToken = ..` Line... – Eliya Cohen Jun 22 '15 at 18:22

1 Answers1

1

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']);
ceejayoz
  • 176,543
  • 40
  • 303
  • 368