Php 错误:必须显式设置信用卡详细信息,或者必须有支持获取信用卡请求的操作
我使用Payum稳定版本0.13和Zend framework v2通过AuthorizeNet进行支付。 我的测试代码:Php 错误:必须显式设置信用卡详细信息,或者必须有支持获取信用卡请求的操作,php,zend-framework2,authorize,payum,Php,Zend Framework2,Authorize,Payum,我使用Payum稳定版本0.13和Zend framework v2通过AuthorizeNet进行支付。 我的测试代码: $storage = $this->getServiceLocator() ->get('payum') ->getStorage('LowbiddoPayment\Entity\AgreementDetails'); $details = $storage->creat
$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.
我怎样才能修好它?
谢谢 PayumModule(尚未)提供内置的获取信用卡操作。所以有两条路要走
- 你可以自己询问信用卡信息。像创建一个表单,而不是渲染它。用户填写并提交。你得到了这些信息,并将其与其他信息一起传递给Payum。Authorize.Net AIM要求输入“card\u num”、“exp\u date”字段
- 另一种方法是创建特定于zend的AcquiredCreditCardAction,并使用addAction方法将其添加到付款对象中。下面是一个为Symfony获取信用卡操作的示例: