我正在开发支付网关的模块,该模块可以在两个不同的步骤中进行授权和捕获。到目前为止,我可以通过运行下面的代码授权顺序:Magento:发票和获取授权订单
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。因此,它禁用了在后端捕获付款的选项。任何想法如何防止这种情况发生,而不硬编码? – awavi