2015-01-05 26 views
1

我用Payum穩定版本0.13和Zend框架V2爲make支付通過AuthorizeNet動作。 我的測試代碼:錯誤:信用卡資料必須要明確設置或必須有一個支持ObtainCreditCard要求

$storage = $this->getServiceLocator() 
     ->get('payum') 
     ->getStorage('LowbiddoPayment\Entity\AgreementDetails'); 

    $details    = $storage->create(); 
    $details['currency'] = 'USD'; 
    $details['amount']  = 100; 
    $details['card_num'] = new SensitiveValue('4111111111111111'); 
    $details['exp_date'] = new SensitiveValue('10/16'); 
    $details['description'] = 'Test'; 
    $storage->update($details); 

    $this->getServiceLocator() 
     ->get('payum.security.token_factory') 
     ->setUrlPlugin($this->url()); 

    $doneUrl = $this->url()->fromRoute('payment_done', array('id' => $orderId), array('force_canonical' => true)); 

    $captureToken = $this->getServiceLocator() 
     ->get('payum.security.token_factory') 
     ->createCaptureToken('authorize-net-aim', $details, $doneUrl); 

我有這樣的錯誤

/vendor/payum/payum/src/Payum/AuthorizeNet/Aim/Action/CaptureAction.php:58 

Credit card details has to be set explicitly or there has to be an action that supports ObtainCreditCard request. 

我怎樣才能解決呢? 謝謝!

回答

1

PayumModule不提供(還)內置ObtainCreditCardAction。所以有兩種方法可以去。

+0

謝謝。我選擇了第一個變體。它幫助了我。 – Lina