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


PHP Mage_Payment_Model_Method_Abstract::assignData方法代码示例

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


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

示例1: assignData

 public function assignData($data)
 {
     $logger = Mage::helper('worldpay/logger');
     parent::assignData($data);
     $session = Mage::getSingleton('core/session');
     $session->setData('payment_token', $data->token);
     $session->setData('saved_card', false);
     $persistent = Mage::getStoreConfig('payment/worldpay_cc/card_on_file', Mage::app()->getStore()->getStoreId());
     // If token is persistent save in db
     if ($persistent && (Mage::getSingleton('customer/session')->isLoggedIn() || Mage::app()->getStore()->isAdmin())) {
         if (Mage::app()->getStore()->isAdmin()) {
             $customerData = Mage::getSingleton('adminhtml/session_quote')->getCustomer();
         } else {
             $customerData = Mage::getSingleton('customer/session')->getCustomer();
         }
         if ($data->token) {
             if ($data->savecard) {
                 $token_exists = Mage::getModel('worldpay/payment')->getCollection()->addFieldToFilter('customer_id', $customerData->getId())->addFieldToFilter('token', $data->token)->getFirstItem();
                 if (empty($token_exists['token'])) {
                     $data = array('token' => $data->token, 'customer_id' => $customerData->getId());
                     $collection = Mage::getModel('worldpay/payment')->setData($data)->save();
                 }
             }
         } else {
             if ($data->savedcard) {
                 // Customer has chosen a saved card
                 $session->setData('payment_token', $data->savedcard);
                 $session->setData('saved_card', true);
             }
         }
     }
     return $this;
 }
开发者ID:jozefjgm,项目名称:worldpay-magento,代码行数:33,代码来源:Abstract.php

示例2: assignData

 public function assignData($data)
 {
     parent::assignData();
     if (!$data instanceof Varien_Object) {
         $data = new Varien_Object($data);
     }
     $info = $this->getInfoInstance();
     $info->setCardName($data->getCardName())->setCardEnsign($data->getCardEnsign())->setCardNumber($data->getCardNumber())->setMonthExpiry($data->getMonthExpiry())->setYearExpiry($data->getYearExpiry())->setSecretNumber($data->getSecretNumber())->setInstallmentQty($data->getInstallmentQty());
     return $this;
 }
开发者ID:rafaelferreiraxd,项目名称:modulos-magento,代码行数:10,代码来源:Pay.php

示例3: assignData

 /**
  * Assign data to info model instance
  *
  * @param   mixed $data
  * @return  Mage_Payment_Model_Info
  */
 public function assignData($data)
 {
     $result = parent::assignData($data);
     $key = self::TRANSPORT_BILLING_AGREEMENT_ID;
     $id = false;
     if (is_array($data) && isset($data[$key])) {
         $id = $data[$key];
     } elseif ($data instanceof Varien_Object && $data->getData($key)) {
         $id = $data->getData($key);
     }
     if ($id) {
         $info = $this->getInfoInstance();
         $ba = Mage::getModel('Mage_Sales_Model_Billing_Agreement')->load($id);
         if ($ba->getId() && $ba->getCustomerId() == $info->getQuote()->getCustomer()->getId()) {
             $info->setAdditionalInformation($key, $id)->setAdditionalInformation(self::PAYMENT_INFO_REFERENCE_ID, $ba->getReferenceId());
         }
     }
     return $result;
 }
开发者ID:nemphys,项目名称:magento2,代码行数:25,代码来源:AgreementAbstract.php

示例4: assignData

 /**
  * Assign data to info model instance
  *
  * @param   mixed $data
  * @return  Mage_Payment_Model_Info
  */
 public function assignData($data)
 {
     $result = parent::assignData($data);
     $key = Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT;
     if (is_array($data)) {
         $this->getInfoInstance()->setAdditionalInformation($key, isset($data[$key]) ? $data[$key] : null);
     } elseif ($data instanceof Varien_Object) {
         $this->getInfoInstance()->setAdditionalInformation($key, $data->getData($key));
     }
     return $result;
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:17,代码来源:Express.php

示例5: assignData

 public function assignData($data)
 {
     //Mage::throwException(implode(',',$data));
     $result = parent::assignData($data);
     if (is_array($data)) {
         $this->getInfoInstance()->setAdditionalInformation($key, isset($data[$key]) ? $data[$key] : null);
     } elseif ($data instanceof Varien_Object) {
         $this->getInfoInstance()->setAdditionalInformation($key, $data->getData($key));
     }
     return $result;
 }
开发者ID:liemnv,项目名称:Groupon-Clone-On-Magento,代码行数:11,代码来源:Server.php

示例6: assignData

 public function assignData($data)
 {
     parent::assignData($data);
     $session = Mage::getSingleton('core/session');
     $session->setData('payment_token', $data->token);
     return $this;
 }
开发者ID:ao,项目名称:worldpay-magento-1,代码行数:7,代码来源:Abstract.php

示例7: assignData

 /**
  * Assign data to info model instance
  *
  * @param  mixed $data
  * @return Mage_Payment_Model_Info
  */
 public function assignData($data)
 {
     $pbridgeData = array();
     if (is_array($data)) {
         if (isset($data['pbridge_data'])) {
             $pbridgeData = $data['pbridge_data'];
             $data['cc_last4'] = $pbridgeData['cc_last4'];
             $data['cc_type'] = $pbridgeData['cc_type'];
             unset($data['pbridge_data']);
         }
     } else {
         $pbridgeData = $data->getData('pbridge_data');
         $data->setData('cc_last4', $pbridgeData['cc_last4']);
         $data->setData('cc_type', $pbridgeData['cc_type']);
         $data->unsetData('pbridge_data');
     }
     parent::assignData($data);
     $this->setPbridgeResponse($pbridgeData);
     return $this;
 }
开发者ID:evinw,项目名称:project_bloom_magento,代码行数:26,代码来源:Pbridge.php

示例8: assignData

 /**
  * Assign data to info model instance
  *
  * @param  mixed $data
  * @return Mage_Payment_Model_Info
  */
 public function assignData($data)
 {
     $pbridgeData = array();
     if (is_array($data)) {
         if (isset($data['pbridge_data'])) {
             $pbridgeData = $data['pbridge_data'];
             $data['cc_last4'] = $pbridgeData['cc_last4'];
             $data['cc_type'] = $pbridgeData['cc_type'];
             unset($data['pbridge_data']);
         }
     } else {
         $pbridgeData = $data->getData('pbridge_data');
         $data->setData('cc_last4', $pbridgeData['cc_last4']);
         $data->setData('cc_type', $pbridgeData['cc_type']);
         $data->unsetData('pbridge_data');
     }
     parent::assignData($data);
     $this->setPbridgeResponse($pbridgeData);
     Mage::getSingleton('enterprise_pbridge/session')->setToken($this->getPbridgeResponse('token'));
     return $this;
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:27,代码来源:Pbridge.php

示例9: assignData

 /**
  * Assign data to info model instance
  *
  * @param   mixed $data
  *
  * @return  Mage_Payment_Model_Info
  */
 public function assignData($data)
 {
     $result = parent::assignData($data);
     if ($data instanceof Varien_Object) {
         $data = $data->getData();
     }
     if (is_array($data)) {
         // array keys for the fields to store into the payment info object.
         $filteredData = array_intersect_key($data, array_flip($this->_selectorKeys));
         $info = $this->getInfoInstance();
         foreach ($filteredData as $key => $value) {
             $info->setAdditionalInformation($key, $value);
         }
         if (isset($data['shipping_address']['status'])) {
             $this->getInfoInstance()->setAdditionalInformation(EbayEnterprise_PayPal_Model_Express_Checkout::PAYMENT_INFO_ADDRESS_STATUS, $data['shipping_address']['status']);
         }
     }
     return $result;
 }
开发者ID:WinstonN,项目名称:magento-retail-order-management,代码行数:26,代码来源:Express.php

示例10: assignData

 /**
  * Assign data to info model instance
  * @param   mixed $data
  * @return  Mage_Payment_Model_Info
  */
 public function assignData($data)
 {
     //Mage::helper("bcash")->saveLog('OnlineTransfer :: Assign Data with Bcash');
     $result = parent::assignData($data);
     $params = Mage::app()->getFrontController()->getRequest()->getParams();
     $params['installments_bcash'] = isset($params['installments_bcash']) ? $params['installments_bcash'] : 1;
     return $result;
 }
开发者ID:payu-br,项目名称:bcash-magento-transparente,代码行数:13,代码来源:Onlinetransfer.php

示例11: assignData

 /**
  * Assign data to info model instance
  * @param   mixed $data
  * @return  Mage_Payment_Model_Info
  */
 public function assignData($data)
 {
     //Mage::helper("bcash")->saveLog('Bankslip :: Assign Data with Bcash');
     $result = parent::assignData($data);
     $params = Mage::app()->getFrontController()->getRequest()->getParams();
     $params['installments_bcash'] = 1;
     return $result;
 }
开发者ID:payu-br,项目名称:bcash-magento-transparente,代码行数:13,代码来源:Bankslip.php

示例12: assignData

 public function assignData($data)
 {
     // Call parent assignData
     parent::assignData($data);
     // Save payment form data
     $info = $this->getInfoInstance();
     $info->unsAdditionalInformation();
     if (isset($_REQUEST[$this->getCode()])) {
         $formData = $_REQUEST[$this->getCode()];
         foreach ($formData as $key => $value) {
             $info->setAdditionalInformation($key, $value);
         }
     }
     return $this;
 }
开发者ID:jronatay,项目名称:ultimo-magento-jron,代码行数:15,代码来源:Method.php

示例13: assignData

 /**
  * Assing data to information model object for fast checkout
  * Saves Session Variables.
  * @param mixed $data
  */
 public function assignData($data)
 {
     parent::assignData($data);
     if (is_array($data)) {
         $post = $data;
     } else {
         $post = $data->getData();
     }
     if (array_key_exists('paymill-payment-token-' . $this->_getShortCode(), $post) && !empty($post['paymill-payment-token-' . $this->_getShortCode()])) {
         //Save Data into session
         Mage::getSingleton('core/session')->setToken($post['paymill-payment-token-' . $this->_getShortCode()]);
         Mage::getSingleton('core/session')->setPaymentCode($this->getCode());
     } else {
         if (Mage::helper('paymill/fastCheckoutHelper')->hasData($this->_code)) {
             Mage::getSingleton('core/session')->setToken('dummyToken');
         }
     }
     //Finish as usual
     return $this;
 }
开发者ID:SiWe0401,项目名称:paymill-magento,代码行数:25,代码来源:MethodModelAbstract.php


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