2016-04-24 51 views
0

我有一个500错误与API调用:payum - HttpClientInterface在参数2没有给出通过

Catchable Fatal Error: Argument 2 passed to Payum\Paypal\ExpressCheckout\Nvp\Api::__construct() must implement interface Payum\Core\HttpClientInterface, none given, called in /var/www/myapp/src/App/UserBundle/Controller/SubscriptionController.php on line 65 and defined 

我认为这是在构造函数中https://github.com/Payum/PaypalExpressCheckoutNvp/blob/master/Api.php关注。 约有2个参数没有默认值... 有没有关于它的问题?

这是我作曲:

"payum/paypal-express-checkout-nvp": "^1.3", 
    "payum/payum-bundle": "^2.0", 
    "php-http/guzzle6-adapter": "^1" 

这里是我的控制器:

protected function getPaypalOptions() 
{ 
    return array(
     'username' => $this->container->getParameter('paypal.express_checkout.username'), 
     'password' => $this->container->getParameter('paypal.express_checkout.password'), 
     'signature' => $this->container->getParameter('paypal.express_checkout.signature'), 
     'return_url' => null, 
     'cancel_url' => null, 
     'sandbox' => $this->container->getParameter('paypal.sandbox'), 
     'useraction' => $useraction, 
     'cmd' => Api::CMD_EXPRESS_CHECKOUT, 
    ); 
} 


public function indexAction(Request $request) 
{ 
    $em = $this->getDoctrine()->getManager(); 
    $entity = $em->getRepository('AppUserBundle:Subscription')->findBy(
     array('companies' => $this->get('security.context')->getToken()->getUser()->getCompanies()), 
     array('id' => 'DESC') 
    ); 

    for ($i=0;$i<count($entity);$i++) 
    { 
     if ($entity[$i]->getProfileId()!='') { 
      $details['PROFILEID'] = $entity[$i]->getProfileId(); 

      $api = new Api($this->getPaypalOptions()); 

      $arrStatus = $api->getRecurringPaymentsProfileDetails($details); 
      $entity[$i]->paypalstatus = $arrStatus['STATUS']; 
     } 
    } 


    return $this->render('AppUserBundle:Subscription:index.html.twig', array(
     'entities' => $entity 

    )); 
} 
+0

您可以更新您的问题,以显示完整的SubscriptionControlle r.php与行号?我需要看看你对HttpClientInterface的调用, –

回答

0

我finaly降级到

"payum/paypal-express-checkout-nvp": "1.2" 

感谢

相关问题