本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例6: assignData
public function assignData($data)
{
parent::assignData($data);
$session = Mage::getSingleton('core/session');
$session->setData('payment_token', $data->token);
return $this;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}