【问题标题】:Get order id in a custom payment method: Mage_Payment_Model_Method_Abstract在自定义付款方式中获取订单 ID:Mage_Payment_Model_Method_Abstract
【发布时间】:2012-10-11 12:07:33
【问题描述】:

我正在为商店开发一种新的付款方式,但我被困在可以退款的方式中。在此功能中,我需要找到一种方法来获取发票的订单 ID 以进行退款。我应该如何进行?

  class Company_Module_Model_Standard extends Mage_Payment_Model_Method_Abstract
  {
    (...)
    public function canRefund() // we need a way to get the orderId
    {
      $client = $this->_getCLient();
      $client->loadOrder($orderId); // <------ here I would need the order id or increment id
      $ret = $client->canRefund();
      return $ret;
    }
    (...)
  }

我希望你能帮助我。

【问题讨论】:

    标签: magento payment-gateway


    【解决方案1】:

    试试这个:

    $paymentInfo = $this->getInfoInstance();
    $orderId = $paymentInfo->getOrder()->getRealOrderId();
    

    【讨论】:

      猜你喜欢
      • 2013-02-21
      • 1970-01-01
      • 2014-03-14
      • 2015-07-12
      • 1970-01-01
      • 1970-01-01
      • 2013-06-09
      • 2019-04-27
      • 1970-01-01
      相关资源
      最近更新 更多