当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Payment_Model_Info::unsAdditionalInformation方法代码示例

本文整理汇总了PHP中Mage_Payment_Model_Info::unsAdditionalInformation方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Payment_Model_Info::unsAdditionalInformation方法的具体用法?PHP Mage_Payment_Model_Info::unsAdditionalInformation怎么用?PHP Mage_Payment_Model_Info::unsAdditionalInformation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Payment_Model_Info的用法示例。


在下文中一共展示了Mage_Payment_Model_Info::unsAdditionalInformation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fetchTransactionInfo

 /**
  * Fetch transaction details info
  *
  * @param Mage_Payment_Model_Info $payment
  * @param string $transactionId
  * @return array
  */
 public function fetchTransactionInfo(Mage_Payment_Model_Info $payment, $transactionId)
 {
     /** @var Mage_Sales_Model_Order_Payment_Transaction $transaction */
     $transaction = Mage::getModel('sales/order_payment_transaction')->load($transactionId, 'txn_id');
     $checkout_transaction = $transaction->getOrder()->getPayment()->lookupTransaction(null, Mage_Sales_Model_Order_Payment_Transaction::TYPE_ORDER);
     $reconcile = $this->reconcile($checkout_transaction->getTxnId());
     // Get the current details
     $transaction_details = $payment->getAdditionalInformation(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS);
     // Try to extract transaction details from the Gateway response
     if ($reconcile->unique_id == $transactionId) {
         $transaction_details = $reconcile;
     } else {
         if ($reconcile->payment_transaction instanceof stdClass) {
             if ($reconcile->payment_transaction->unique_id == $transactionId) {
                 $transaction_details = $reconcile->payment_transaction;
             }
         }
         if ($reconcile->payment_transaction instanceof ArrayObject) {
             foreach ($reconcile->payment_transaction as $payment_transaction) {
                 if ($payment_transaction->unique_id == $transactionId) {
                     $transaction_details = $payment_transaction;
                 }
             }
         }
     }
     // Remove the current details
     $payment->unsAdditionalInformation(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS);
     // Set the default/updated transaction details
     $payment->setAdditionalInformation(array(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS => $this->getHelper()->getArrayFromGatewayResponse($transaction_details)), null);
     $payment->save();
     return $payment->getAdditionalInformation(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS);
 }
开发者ID:snehamalvankar,项目名称:magento-ce-emp-plugin,代码行数:39,代码来源:Checkout.php

示例2: fetchTransactionInfo

 /**
  * Fetch transaction details info
  *
  * @param Mage_Payment_Model_Info $payment
  * @param string $transactionId
  *
  * @return array
  */
 public function fetchTransactionInfo(Mage_Payment_Model_Info $payment, $transactionId)
 {
     $reconcile = $this->reconcile($transactionId);
     // Remove the current details
     $payment->unsAdditionalInformation(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS);
     // Set the default/updated transaction details
     $payment->setAdditionalInformation(array(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS => $this->getHelper()->getArrayFromGatewayResponse($reconcile)), null);
     $payment->save();
     return $payment->getAdditionalInformation(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS);
 }
开发者ID:snehamalvankar,项目名称:magento-ce-emp-plugin,代码行数:18,代码来源:Direct.php


注:本文中的Mage_Payment_Model_Info::unsAdditionalInformation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。