通过自定义付款方式获取订单ID:Mage_Payment_Model_Method_Abstract

时间:2012-10-11 12:07:34

标签: magento payment-gateway

我正在为商店开发一种新的付款方式,而我卡在方法中可以退款。在此功能中,我需要找到一种方法来获取发票的订单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;
    }
    (...)
  }

我希望你能帮助我。

1 个答案:

答案 0 :(得分:1)

试试这个:

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