希望这里的人可以给我一个想法,在付款方式的问题,我正在为Magento工作。
正如标题所说,问题是从管理员取消并退款。我在此模块中下的订单可以在开具发票时从网关捕获。
这是在模型名称空间/modulename/ model /Standard.php中完成的,它扩展了Mage_Payment_Model_Method_Abstract函数名:
在这个类中,我还有void、cancel和refund函数。但他们更新的人会叫他们。我已经尝试在这些方法中插入一些Mage::Log(),但是当订单被取消或者创建了creditmemo (从sales - invoice视图中)时,什么也没有发生。
那么,谁能给我一些提示,我错过了什么-很明显,我一定是忘了什么,但我真的看不到哪里。
standard.php类:
class Namespace_Module_Model_Standard extends Mage_Payment_Model_Method_Abstract
{
const PAYMENT_TYPE_AUTH = 'AUTHORIZATION';
const PAYMENT_TYPE_SALE = 'SALE';
protected $_code = 'module';
protected $_isGateway = true;
protected $_canAuthorize = false;
protected $_canCapture = true;
protected $_canCapturePartial = true;
protected $_canRefund = true;
protected $_canRefundInvoicePartial = true;
protected $_canVoid = true;
protected $_canUseInternal = true;
protected $_canUseCheckout = true;
protected $_canUseForMultishipping = true;
protected $_canSaveCc = false;
//this function is not called when order is cancelled
public function cancel(Varien_Object $payment)
{
Mage::Log('order canceled');
return $this;
}
//same with this function - not called when creditmemo is made
public function refund(Varien_Object $payment, $amount)
{
Mage::Log('refund');
return $this;
}
//but this is called, when invoice is being made
public function capture(Varien_Object $payment, $amount)
{
return $this;
}
}发布于 2014-09-16 07:26:34
我希望这对某些人有帮助!
对于贷项通知单:您应该从发票创建贷项通知单,因为发票是从付款生成的,而不是由管理员用户创建的。在“订单视图(页面)”>“发票(选项卡)”>“从列表中选择发票”>“贷项通知单(按钮)”>“发票的新贷项通知单(页面)”中,您将看到两个按钮“退款”和“退款”。“退款”按钮将触发您的支付方法模型类方法processBeforeRefund(),refund(),processCreditmemo()。
https://stackoverflow.com/questions/6416368
复制相似问题