【发布时间】:2014-05-07 21:43:56
【问题描述】:
我正在为支付网关开发一个模块,该模块可以通过两个不同的步骤进行授权和捕获。到目前为止,我可以通过运行以下代码来授权订单:
class My_Gateway_Model_Method_Cc extends Mage_Payment_Model_Method_Cc
{
protected $_code = 'mycode';
protected $_canSaveCc = true;
protected $_canRefund = true;
protected $_isGateway = true;
protected $_canAuthorize = true;
protected $_canCapture = true;
protected $_canCapturePartial = false;
public function authorize(Varien_Object $payment, $amount){
/* code to call the payment gateway and authorize the charge */
}
public function capture(Varien_Object $payment, $amount){
/* some code to capture the payment */
}
}
问题是,当我下订单,然后我进入发票面板时,我会收到以下消息:
'将在不与支付网关通信的情况下创建发票'
开票时没有捕获授权付款的选项,也没有调用捕获方法。
【问题讨论】:
-
我已经浏览了代码,显然 Magento 在授权时将交易设置为关闭或关闭 == 1。因此,它禁用了在后端捕获付款的选项。任何想法如何在不硬编码的情况下防止这种情况发生?
标签: magento magento-1.7 magento-1.8