本文整理汇总了PHP中Mage_Payment_Model_Method_Cc::assignData方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Payment_Model_Method_Cc::assignData方法的具体用法?PHP Mage_Payment_Model_Method_Cc::assignData怎么用?PHP Mage_Payment_Model_Method_Cc::assignData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Payment_Model_Method_Cc
的用法示例。
在下文中一共展示了Mage_Payment_Model_Method_Cc::assignData方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assignData
public function assignData($data)
{
parent::assignData($data);
$info = $this->getInfoInstance();
$info->setCcParcelamento($data->getCcParcelamento());
$this->getCheckout()->setCcParcelamento($data->getCcParcelamento());
return $this;
}
示例2: assignData
/**
* overwrites the method of Mage_Payment_Model_Method_Cc
* Assign data to info model instance
*
* @param mixed $data
* @return Mage_Payment_Model_Info
*/
public function assignData($data)
{
if (!$data instanceof Varien_Object) {
$data = new Varien_Object($data);
}
parent::assignData($data);
$info = $this->getInfoInstance();
$info->setCcSsIssue($data->getCcSsIssue())->setCcSsStartMonth($data->getCcSsStartMonth())->setCcSsStartYear($data->getCcSsStartYear());
return $this;
}
示例3: assignData
/**
* overwrites the method of Mage_Payment_Model_Method_Cc
* Assign data to info model instance
*
* @param mixed $data
* @return Mage_Payment_Model_Info
*/
public function assignData($data)
{
if (!$data instanceof Varien_Object) {
$data = new Varien_Object($data);
}
parent::assignData($data);
$info = $this->getInfoInstance();
if ($data->getCcType() == self::CC_CARDTYPE_SS) {
$info->setCcSsIssue($data->getCcSsIssue())->setCcSsStartMonth($data->getCcSsStartMonth() == 0 || $data->getCcSsStartMonth() == null ? 1 : $data->getCcSsStartMonth())->setCcSsStartYear($data->getCcSsStartYear());
}
return $this;
}
示例4: assignData
/**
* Assign data to info model instance
*
* @param mixed $data
* @return Mage_Payment_Model_Info
*/
public function assignData($data)
{
if (is_array($data)) {
$data = new Varien_Object($data);
}
try {
$paymentRequest = Mage::app()->getRequest()->getPost('payment');
$data->addData(array('cc_last4' => substr($data->cc_number, -4), 'cc_exp_year' => '', 'cc_exp_month' => ''));
$info = $this->getInfoInstance();
$this->_openpay_token = $paymentRequest['openpay_token'];
$this->_device_session_id = $paymentRequest['device_session_id'];
$info->setOpenpayToken($paymentRequest['openpay_token'])->setDeviceSessionId($paymentRequest['device_session_id']);
} catch (Exception $e) {
}
return parent::assignData($data);
}
示例5: assignData
public function assignData($data)
{
if (!$data instanceof Varien_Object) {
$data = new Varien_Object($data);
}
if ($this->getConfigData('paypage_enabled')) {
$info = $this->getInfoInstance();
$info->setAdditionalInformation('paypage_enabled', $data->getPaypageEnabled());
$info->setAdditionalInformation('paypage_registration_id', $data->getPaypageRegistrationId());
$info->setAdditionalInformation('paypage_order_id', $data->getOrderId());
$info->setAdditionalInformation('cc_vaulted', $data->getCcVaulted());
$info->setAdditionalInformation('cc_should_save', $data->getCcShouldSave());
}
if ($this->getConfigData('vault_enable')) {
$info->setAdditionalInformation('cc_vaulted', $data->getCcVaulted());
$info->setAdditionalInformation('cc_should_save', $data->getCcShouldSave());
}
return parent::assignData($data);
}
示例6: assignData
/**
* Assign data to info model instance
* @param mixed $data
* @return Mage_Payment_Model_Info
*/
public function assignData($data)
{
Mage::log('Assign Data with Omise');
$result = parent::assignData($data);
if (is_array($data)) {
if (!isset($data['omise_token'])) {
Mage::throwException(Mage::helper('payment')->__('Need Omise\'s keys'));
}
Mage::log('Data that assign is Array');
$this->getInfoInstance()->setAdditionalInformation('omise_token', $data['omise_token']);
} elseif ($data instanceof Varien_Object) {
if (!$data->getData('omise_token')) {
Mage::throwException(Mage::helper('payment')->__('Need Omise\'s keys'));
}
Mage::log('Data that assign is Object');
$this->getInfoInstance()->setAdditionalInformation('omise_token', $data->getData('omise_token'));
}
return $result;
}
示例7: assignData
public function assignData($data)
{
parent::assignData($data);
if (!$data instanceof Varien_Object) {
$data = new Varien_Object($data);
}
$info = $this->getInfoInstance();
if (!$info->getCcLast4() && $data->getCcLastFour()) {
$info->setCcLast4($data->getCcLastFour());
}
$details = array();
if ($data->getData('cc_save_future')) {
$details['cc_save_future'] = 1;
}
if ($data->getData('securesubmit_token')) {
$details['securesubmit_token'] = $data->getData('securesubmit_token');
}
if ($data->getData('use_credit_card')) {
$details['use_credit_card'] = 1;
}
if ($data->getData('customer_id')) {
$details['customer_id'] = $data->getData('customer_id');
}
if (!empty($details)) {
$this->getInfoInstance()->setAdditionalData(serialize($details));
}
return $this;
}
示例8: assignData
/**
* Assign post data to the payment info object.
* @param array|Varien_Object $data Contains payment data submitted in checkout - Varien_Object in OPC, array otherwise
* @return self
*/
public function assignData($data)
{
parent::assignData($data);
if (is_array($data)) {
$data = Mage::getModel('Varien_Object', $data);
}
if ($this->_isUsingClientSideEncryption) {
$this->getInfoInstance()->setCcLast4($data->getCcLast4());
}
return $this;
}
示例9: assignData
/**
* Assign data to info model instance
*
* @param array|Varien_Object $paymentData
* @return Fontis_EwayAu_Model_Token
*/
public function assignData($paymentData)
{
parent::assignData($paymentData);
if (is_array($paymentData)) {
$paymentData = new Varien_Object($paymentData);
}
$tokenHelper = $this->getTokenHelper();
$customerId = $tokenHelper->getCustomerId();
// If customer credit card data has already been stored on eWAY recently skip.
if (!$customerId) {
// Determine if customer credit card data already exists on eWAY
try {
$query = $this->queryCustomerByReference();
// Check if customer data requires update
if ($query->isRequestSuccessful()) {
$updateResponse = $this->updateCustomer($paymentData, $query->getProcessedResponse());
if ($updateResponse === false) {
$tokenHelper->logMessage('Unable to update eWAY token customer.');
Mage::throwException('An error occurred during the checkout process.');
}
} else {
$createResponse = $this->createCustomer($paymentData);
if (!$createResponse->isRequestSuccessful()) {
$tokenHelper->logMessage('Unable to create eWAY token customer.');
Mage::throwException('An error occurred during the checkout process.');
}
}
} catch (Exception $e) {
$tokenHelper->logMessage($e->getMessage());
Mage::throwException($e->getMessage());
}
}
return $this;
}
示例10: assignData
public function assignData($data)
{
parent::assignData($data);
$this->getInfoInstance()->setCcLast4($data->getCcLast4());
return $this;
}
示例11: assignData
/**
* Update the CC info during the checkout process.
*/
public function assignData($data)
{
if (!$data instanceof Varien_Object) {
$data = new Varien_Object($data);
}
parent::assignData($data);
if ($data->hasCardId() && $data->getCardId() != '') {
$card = $this->loadAndSetCard($data->getCardId());
if ($data->hasCcType() && $data->getCcType() != '') {
$this->getInfoInstance()->setCcType($data->getCcType());
}
if ($data->hasCcLast4() && $data->getCcLast4() != '') {
$this->getInfoInstance()->setCcLast4($data->getCcLast4());
}
if ($data->getCcExpYear() > date('Y') || $data->getCcExpYear() == date('Y') && $data->getCcExpMonth() >= date('n')) {
$this->getInfoInstance()->setCcExpYear($data->getCcExpYear())->setCcExpMonth($data->getCcExpMonth());
}
if ($data->hasSavedCcCid() && $data->getSavedCcCid() != '') {
$this->getInfoInstance()->setCcCid(preg_replace('/[^0-9]/', '', $data->getSavedCcCid()));
}
} else {
$this->getInfoInstance()->unsetData('tokenbase_id');
}
if ($data->hasSave()) {
$this->getInfoInstance()->setAdditionalInformation('save', intval($data->getSave()));
}
return $this;
}