首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Magento支付方式-可以通过支付网关捕获,但退款和取消所做的工作

问Magento支付方式-可以通过支付网关捕获,但退款和取消所做的工作
EN

Stack Overflow用户
提问于 2011-06-21 03:28:57
回答 1查看 2.1K关注 0票数 0

希望这里的人可以给我一个想法,在付款方式的问题,我正在为Magento工作。

正如标题所说,问题是从管理员取消并退款。我在此模块中下的订单可以在开具发票时从网关捕获。

这是在模型名称空间/modulename/ model /Standard.php中完成的,它扩展了Mage_Payment_Model_Method_Abstract函数名:

在这个类中,我还有void、cancel和refund函数。但他们更新的人会叫他们。我已经尝试在这些方法中插入一些Mage::Log(),但是当订单被取消或者创建了creditmemo (从sales - invoice视图中)时,什么也没有发生。

那么,谁能给我一些提示,我错过了什么-很明显,我一定是忘了什么,但我真的看不到哪里。

standard.php类:

代码语言:javascript
复制
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;
}
}
EN

回答 1

Stack Overflow用户

发布于 2014-09-16 07:26:34

我希望这对某些人有帮助!

对于贷项通知单:您应该从发票创建贷项通知单,因为发票是从付款生成的,而不是由管理员用户创建的。在“订单视图(页面)”>“发票(选项卡)”>“从列表中选择发票”>“贷项通知单(按钮)”>“发票的新贷项通知单(页面)”中,您将看到两个按钮“退款”和“退款”。“退款”按钮将触发您的支付方法模型类方法processBeforeRefund(),refund(),processCreditmemo()。

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6416368

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档