本文整理汇总了PHP中Varien_Object::getCcCid方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Object::getCcCid方法的具体用法?PHP Varien_Object::getCcCid怎么用?PHP Varien_Object::getCcCid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Object
的用法示例。
在下文中一共展示了Varien_Object::getCcCid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assignData
/**
* 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);
}
$info = $this->getInfoInstance();
$additionaldata = array('Cc_parcelas' => $data->getCcParcelas(), 'cc_cid_enc' => $info->encrypt($data->getCcCid()));
$info->setCcType($data->getCcType())->setAdditionalData(serialize($additionaldata))->setCcOwner($data->getCcOwner())->setCcLast4(substr($data->getCcNumber(), -4))->setCcNumber($data->getCcNumber())->setCcCid($data->getCcCid())->setCcExpMonth($data->getCcExpMonth())->setCcExpYear($data->getCcExpYear())->setCcSsIssue($data->getCcSsIssue())->setCcSsStartMonth($data->getCcSsStartMonth())->setCcSsStartYear($data->getCcSsStartYear())->setCcNumberEnc($info->encrypt($data->getCcNumber()))->setCcCidEnc($info->encrypt($data->getCcCid()));
return $this;
}
示例2: assignData
/**
* 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);
}
// salva a bandeira, o numero de parcelas e o token
$info = $this->getInfoInstance();
$additionaldata = array('parcels_number' => $data->getParcelsNumber());
if ($data->getToken()) {
$tokenData = $this->_getTokenById($data->getToken());
$additionaldata['token'] = $tokenData['token'];
$data->setCcType($tokenData['ccType']);
}
$info->setCcType($data->getCcType())->setCcNumber(Mage::helper('core')->encrypt($data->getCcNumber()))->setCcOwner($data->getCcOwner())->setCcExpMonth($data->getCcExpMonth())->setCcExpYear($data->getCcExpYear())->setCcCid(Mage::helper('core')->encrypt($data->getCcCid()))->setAdditionalData(serialize($additionaldata));
// pega dados de juros
$withoutInterest = intval($this->getConfigData('installment_without_interest', $this->getStoreId()));
$interestValue = floatval($this->getConfigData('installment_interest_value', $this->getStoreId()));
// verifica se há juros
if ($data->getParcelsNumber() > $withoutInterest) {
$installmentValue = Mage::helper('Query_Cielo')->calcInstallmentValue($info->getQuote()->getGrandTotal(), $interestValue / 100, $data->getParcelsNumber());
$installmentValue = round($installmentValue, 2);
$interest = $installmentValue * $data->getParcelsNumber() - $info->getQuote()->getGrandTotal();
$info->getQuote()->setInterest($info->getQuote()->getStore()->convertPrice($interest, false));
$info->getQuote()->setBaseInterest($interest);
$info->getQuote()->setTotalsCollectedFlag(false)->collectTotals();
$info->getQuote()->save();
} else {
$info->getQuote()->setInterest(0.0);
$info->getQuote()->setBaseInterest(0.0);
$info->getQuote()->setTotalsCollectedFlag(false)->collectTotals();
$info->getQuote()->save();
}
return $this;
}
示例3: updateToken
/**
* Update current token
*
* @param Varien_Object $billing
* @param Varien_Object $infoInstance
* @return Eway_Rapid31_Model_Request_Token
*/
public function updateToken(Varien_Object $billing, Varien_Object $infoInstance)
{
if (!Mage::helper('ewayrapid')->isBackendOrder() && !Mage::getSingleton('ewayrapid/config')->canEditToken()) {
Mage::throwException(Mage::helper('ewayrapid')->__('Customers are not allowed to edit token.'));
}
// Empty Varien_Object's data
$this->unsetData();
$customerParam = Mage::getModel('ewayrapid/field_customer');
$customerParam->setTitle($billing->getPrefix())->setFirstName($billing->getFirstname())->setLastName($billing->getLastname())->setCompanyName($billing->getCompany())->setJobDescription($billing->getJobDescription())->setStreet1($billing->getStreet1())->setStreet2($billing->getStreet2())->setCity($billing->getCity())->setState($billing->getRegion())->setPostalCode($billing->getPostcode())->setCountry(strtolower($billing->getCountryModel()->getIso2Code()))->setEmail($billing->getEmail())->setPhone($billing->getTelephone())->setMobile($billing->getMobile())->setFax($billing->getFax());
$customerHelper = Mage::helper('ewayrapid/customer');
$customerTokenId = $customerHelper->getCustomerTokenId($infoInstance->getSavedToken());
if ($customerTokenId) {
$customerParam->setTokenCustomerID($customerTokenId);
} else {
Mage::throwException(Mage::helper('ewayrapid')->__('An error occurred while updating token: Token info does not exist.'));
}
$cardDetails = Mage::getModel('ewayrapid/field_cardDetails');
$cardDetails->setName($infoInstance->getCcOwner())->setExpiryMonth($infoInstance->getCcExpMonth())->setNumber('444433XXXXXX1111')->setExpiryYear($infoInstance->getCcExpYear())->setCVN($infoInstance->getCcCid());
$customerParam->setCardDetails($cardDetails);
$this->setCustomer($customerParam);
$response = $this->_doRapidAPI('Customer', 'PUT');
if ($response->isSuccess()) {
$customerReturn = $response->getCustomer();
$customerReturn['RegionId'] = !$billing->getRegion() && $billing->getRegionId() ? $billing->getRegionId() : '';
unset($customerReturn['CardDetails']);
$tokenInfo = array('Token' => $response->getTokenCustomerID(), 'Owner' => $infoInstance->getCcOwner(), 'ExpMonth' => $infoInstance->getCcExpMonth(), 'ExpYear' => $infoInstance->getCcExpYear(), 'Address' => Mage::getModel('ewayrapid/field_customer')->addData($customerReturn));
Mage::helper('ewayrapid/customer')->updateToken($infoInstance->getSavedToken(), $tokenInfo);
return $this;
} else {
Mage::throwException(Mage::helper('ewayrapid')->__('An error occurred while updating token. Please try again. (Error message: %s)', $response->getMessage()));
}
}
示例4: assignData
/**
* 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);
}
$info = $this->getInfoInstance();
$info->setCcType($data->getCcType())->setCcOwner($data->getCcOwner())->setCcLast4(substr($data->getCcNumber(), -4))->setCcNumber($data->getCcNumber())->setCcCid($data->getCcCid())->setCcExpMonth($data->getCcExpMonth())->setCcExpYear($data->getCcExpYear())->setCcSsIssue($data->getCcSsIssue())->setCcSsStartMonth($data->getCcSsStartMonth())->setCcSsStartYear($data->getCcSsStartYear());
return $this;
}
示例5: assignData
/**
* 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);
}
$info = $this->getInfoInstance();
$info->setCcOwner($data->getCcOwner())->setCcNumber($data->getCcNumber())->setCcCid($data->getCcCid())->setCcExpMonth($data->getCcExpMonth())->setCcExpYear($data->getCcExpYear());
return $this;
}
示例6: assignData
/**
* 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);
}
$session = Mage::getSingleton('core/session');
$info = $this->getInfoInstance();
$info->setCcType($data->getCcType())->setCcOwner($data->getCcOwner())->setCcLast4(substr($data->getCcNumber(), -4))->setCcNumber($data->getCcNumber())->setCcCid($data->getCcCid())->setCcExpMonth($data->getCcExpMonth())->setCcExpYear($data->getCcExpYear())->setCcSsIssue($data->getCcSsIssue())->setCcSsStartMonth($data->getCcSsStartMonth())->setCcSsStartYear($data->getCcSsStartYear());
$session->setVeritransQuoteId($this->_getOrderId());
$session->setTokenBrowser($data->getTokenId());
return $this;
}
示例7: capture
/**
* Capture payment method
*
* @param Varien_Object $payment
* @param float $amount
* @return $this
* @throws Mage_Core_Exception
*/
public function capture(Varien_Object $payment, $amount)
{
$order = $payment->getOrder();
$billingAddress = $order->getBillingAddress();
try {
$api = Stripe\Charge::create(array('amount' => $amount * 100, 'currency' => strtolower($order->getBaseCurrencyCode()), 'card' => array('number' => $payment->getCcNumber(), 'exp_month' => sprintf('%02d', $payment->getCcExpMonth()), 'exp_year' => $payment->getCcExpYear(), 'cvc' => $payment->getCcCid(), 'name' => $billingAddress->getName(), 'address_line1' => $billingAddress->getStreet(1), 'address_line2' => $billingAddress->getStreet(2), 'address_zip' => $billingAddress->getPostcode(), 'address_state' => $billingAddress->getRegion(), 'address_country' => $billingAddress->getCountry()), 'description' => sprintf('#%s, %s', $order->getIncrementId(), $order->getCustomerEmail())));
} catch (Exception $e) {
$this->debugData($e->getMessage());
Mage::throwException(Mage::helper('boolfly_stripe')->__('Payment capturing error.'));
}
$payment->setTransactionId($api->id)->setIsTransactionClosed(0);
return $this;
}
示例8: assignData
/**
* 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);
}
// salva a bandeira
$info = $this->getInfoInstance();
// converte nomenclatura da bandeira
if ($data->getCcType() == "visa-electron") {
$cardType = "visa";
} else {
$cardType = $data->getCcType();
}
$info->setCcType($cardType)->setCcNumber(Mage::helper('core')->encrypt($data->getCcNumber()))->setCcOwner($data->getCcOwner())->setCcExpMonth($data->getCcExpMonth())->setCcExpYear($data->getCcExpYear())->setCcCid(Mage::helper('core')->encrypt($data->getCcCid()));
return $this;
}
示例9: assignData
/**
* Assign data to info model instance
*
* @param mixed $data
*
* @return Mage_Payment_Model_Method_Abstract
*/
public function assignData($data)
{
if (!$data instanceof Varien_Object) {
$data = new Varien_Object($data);
}
$info = $this->getInfoInstance();
$quote = $info->getQuote();
if ($this->isSingleOrder($quote)) {
$info->setAdditionalInformation('installments', $data->getCcInstallments());
}
if ($data->getCcChoice() === 'saved') {
$info->setAdditionalInformation('PaymentMethod', $this->_code)->setAdditionalInformation('use_saved_cc', true);
return $this;
}
$info->setCcType($data->getCcType())->setCcOwner($data->getCcOwner())->setCcLast4(substr($data->getCcNumber(), -4))->setCcNumber($data->getCcNumber())->setCcCid($data->getCcCid())->setCcExpMonth($data->getCcExpMonth())->setCcExpYear($data->getCcExpYear())->setCcSsIssue($data->getCcSsIssue())->setCcSsStartMonth($data->getCcSsStartMonth())->setCcSsStartYear($data->getCcSsStartYear())->setAdditionalInformation('PaymentMethod', $this->_code)->setAdditionalInformation('use_saved_cc', false);
return $this;
}
示例10: processPayment
public function processPayment(Varien_Object $payment, $amount)
{
ini_set('soap.wsdl_cache_enabled', '0');
$braspag_url = $this->getConfigData('service');
$merchant_id = $this->getConfigData('merchant_id');
$order = $payment->getOrder();
$order_id = $order->getIncrementId();
$soapclient = new Zend_Soap_Client($braspag_url);
$parametros = array();
$parametros['merchantId'] = (string) $merchant_id;
$parametros['orderId'] = (string) $order_id;
$parametros['customerName'] = (string) $payment->getCcOwner();
$parametros['amount'] = (string) number_format($amount, 2, ',', '.');
$parametros['paymentMethod'] = (string) $this->getMethodConfig($payment->getCcType());
$parametros['holder'] = (string) $payment->getCcOwner();
$parametros['cardNumber'] = (string) $payment->getCcNumber();
$parametros['expiration'] = (string) $payment->getCcExpMonth() . '/' . $payment->getCcExpYear();
$parametros['securityCode'] = (string) $payment->getCcCid();
if (!$this->getCheckout()->getCcParcelamento()) {
$parametros['numberPayments'] = '1';
$parametros['typePayment'] = '0';
} else {
$parametros['numberPayments'] = '3';
$parametros['typePayment'] = $this->getParcelamentoType();
}
$authorize = $soapclient->Authorize($parametros);
$resultado = $authorize->AuthorizeResult;
$transacao = Mage::getModel('braspag/braspag');
$transacao->setOrderId($order_id);
$transacao->setAuthorisation($resultado->authorisationNumber);
$transacao->setAmount($amount);
$transacao->setNumberPayments($parametros['numberPayments']);
$transacao->setTypePayment($parametros['typePayment']);
$transacao->setTransactionId($resultado->transactionId);
$transacao->setMessage($resultado->message);
$transacao->setReturnCode($resultado->returnCode);
$transacao->setStatus($resultado->status);
$transacao->save();
return $transacao;
}
示例11: assignData
/**
* 1) Called everytime the adyen_cc is called or used in checkout
* @description 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);
}
$info = $this->getInfoInstance();
// set number of installements
$info->setAdditionalInformation('number_of_installments', $data->getAdditionalData());
// save value remember details checkbox
$info->setAdditionalInformation('store_cc', $data->getStoreCc());
if ($this->isCseEnabled()) {
$info->setCcType($data->getCcType());
$info->setAdditionalInformation('encrypted_data', $data->getEncryptedData());
} else {
$info->setCcType($data->getCcType())->setCcOwner($data->getCcOwner())->setCcLast4(substr($data->getCcNumber(), -4))->setCcNumber($data->getCcNumber())->setCcExpMonth($data->getCcExpMonth())->setCcExpYear($data->getCcExpYear())->setCcCid($data->getCcCid())->setPoNumber($data->getAdditionalData());
}
if ($info->getAdditionalInformation('number_of_installments') != "") {
// recalculate the totals so that extra fee is defined
$quote = Mage::getModel('checkout/type_onepage') !== false ? Mage::getModel('checkout/type_onepage')->getQuote() : Mage::getModel('checkout/session')->getQuote();
$quote->setTotalsCollectedFlag(false);
$quote->collectTotals();
}
return $this;
}
示例12: assignData
/**
* Note to self:
* Custom fields are stored using the addData
*/
public function assignData($data)
{
if (!$data instanceof Varien_Object) {
$data = new Varien_Object($data);
}
$info = $this->getInfoInstance();
$info->setAdditionalData(serialize(array('cc_token' => $data['cc_token'])));
if ($data['cc_token'] == 'manual') {
$info->setCcType($data->getCcType())->setCcOwner($data->getCcOwner())->setCcLast4(substr($data->getCcNumber(), -4))->setCcNumber($data->getCcNumber())->setCcCid($data->getCcCid())->setCcExpMonth($data->getCcExpMonth())->setCcExpYear($data->getCcExpYear())->setCcSsIssue($data->getCcSsIssue())->setCcSsStartMonth($data->getCcSsStartMonth())->setCcSsStartYear($data->getCcSsStartYear());
} else {
$customer_tokens = $this->_getPaytraceTokens($info);
$paytrace = null;
foreach ($customer_tokens as $tk => $tv) {
if ($tv->token_id == $data['cc_token']) {
$paytrace = $tv;
}
}
$last4 = empty($paytrace->token_id) ? '' : $paytrace->last4;
$info->setCcType('')->setCcOwner('')->setCcLast4($last4)->setCcNumber('999999999999' . $last4)->setCcCid('')->setCcExpMonth('')->setCcExpYear('')->setCcSsIssue('')->setCcSsStartMonth('')->setCcSsStartYear('');
}
return $this;
}
示例13: _buildRequest
//.........这里部分代码省略.........
$request->setXCurrencyCode($order->getBaseCurrencyCode());
}
switch ($payment->getAnetTransType()) {
case self::REQUEST_TYPE_AUTH_CAPTURE:
$request->setXAllowPartialAuth($this->getConfigData('allow_partial_authorization') ? 'True' : 'False');
if ($payment->getAdditionalInformation($this->_splitTenderIdKey)) {
$request->setXSplitTenderId($payment->getAdditionalInformation($this->_splitTenderIdKey));
}
break;
case self::REQUEST_TYPE_AUTH_ONLY:
$request->setXAllowPartialAuth($this->getConfigData('allow_partial_authorization') ? 'True' : 'False');
if ($payment->getAdditionalInformation($this->_splitTenderIdKey)) {
$request->setXSplitTenderId($payment->getAdditionalInformation($this->_splitTenderIdKey));
}
break;
case self::REQUEST_TYPE_CREDIT:
/**
* Send last 4 digits of credit card number to authorize.net
* otherwise it will give an error
*
* x_trans_id is the transaction ID we provide every
* transaction. It would be used to reference transactions in
* our system when doing export requests, etc.
*
*/
$request->setXCardNum($payment->getCcLast4());
$request->setXTransId($payment->getXTransId());
break;
case self::REQUEST_TYPE_VOID:
$request->setXTransId($payment->getXTransId());
break;
case self::REQUEST_TYPE_PRIOR_AUTH_CAPTURE:
$request->setXTransId($payment->getXTransId());
break;
case self::REQUEST_TYPE_CAPTURE_ONLY:
/**
* x_auth_code is the authorization code you would pass if you
* were doing a forced sale type where you already had an
* approval and needed to force it into PayTrace.
*/
$request->setXAuthCode($payment->getCcAuthCode());
break;
}
if ($this->getIsCentinelValidationEnabled()) {
$params = $this->getCentinelValidator()->exportCmpiData(array());
$request = Varien_Object_Mapper::accumulateByMap($params, $request, $this->_centinelFieldMap);
}
/**
* x_description is a description you can pass along with the
* transaction which will show in PayTrace reporting for reporting
* purposes.
*/
$request->setXDescription('Magento Store Online Order');
if (!empty($order)) {
$billing = $order->getBillingAddress();
if (!empty($billing)) {
$request->setXDelimChar(self::RESPONSE_DELIM_CHAR)->setXEncapChar('')->setXFirstName($billing->getFirstname())->setXLastName($billing->getLastname())->setXCompany($billing->getCompany())->setXAddress($billing->getStreet(1))->setXCity($billing->getCity())->setXState($billing->getRegion())->setXZip($billing->getPostcode())->setXPhone($billing->getTelephone())->setXFax($billing->getFax())->setXEmail($order->getCustomerEmail())->setXMerchantEmail($this->getConfigData('merchant_email'));
}
$shipping = $order->getShippingAddress();
if (!empty($shipping)) {
$request->setXShipToFirstName($shipping->getFirstname())->setXShipToLastName($shipping->getLastname())->setXShipToCompany($shipping->getCompany())->setXShipToAddress($shipping->getStreet(1))->setXShipToCity($shipping->getCity())->setXShipToState($shipping->getRegion())->setXShipToZip($shipping->getPostcode())->setXShipToCountry($shipping->getCountry());
}
/*
* x_po_num - * For Authorize.net this field is for Purchase
* Order numbers, for PayTrace this is only used for
* transactions that are identified as corporate or purchasing
* credit cards. This is an identifier that your customer may
* ask you to provide in order to reference the transaction to
* their credit card statement.
*/
//e $po_number = $order->getPoNumber()
// ?$order->getPoNumber()
// : ($order->getQuote()
// ? $order->getQuote()->getPoNumber()
// : '');
//
// $request->setXPoNum($po_number);
//
// $request->setXTax($order->getBaseTaxAmount())
//f ->setXFreight($order->getBaseShippingAmount());
//
// // Use these fields if we're using a stored credit card
// $useSavedCard = $order->getUseSavedCard()
// ? $order->getUseSavedCard()
// : ($order->getQuote()
// ? $order->getQuote()->getUseSavedCard()
// : false);
// if ($useSavedCard) {
// // setXCustid
// // setXCustomerProfileId
// // setXCustomerPaymentProfileId
// $request->setXCustId( $order->getCustomerId() );
// }
}
// Use these fields if we're using a newly entered credit card
if ($payment->getCcNumber()) {
$request->setXCardNum($payment->getCcNumber())->setXExpDate(sprintf('%02d-%04d', $payment->getCcExpMonth(), $payment->getCcExpYear()))->setXCardCode($payment->getCcCid());
}
return $request;
}
示例14: _buildRequest
protected function _buildRequest(Varien_Object $payment)
{
if (!$payment->getTrxtype()) {
$payment->setTrxtype(self::TRXTYPE_AUTH_ONLY);
}
if (!$payment->getTender()) {
$payment->setTender(self::TENDER_CC);
}
$request = Mage::getModel('paygate/payflow_pro_request')->setUser($this->getConfigData('user'))->setVendor($this->getConfigData('vendor'))->setPartner($this->getConfigData('partner'))->setPwd($this->getConfigData('pwd'))->setTender($payment->getTender())->setTrxtype($payment->getTrxtype())->setVerbosity($this->getConfigData('verbosity'))->setRequestId($this->_generateRequestId());
if ($payment->getAmount()) {
$request->setAmt(round($payment->getAmount(), 2));
$request->setCurrency($payment->getOrder()->getBaseCurrencyCode());
}
switch ($request->getTender()) {
case self::TENDER_CC:
if ($payment->getCcNumber()) {
$request->setAcct($payment->getCcNumber())->setExpdate(sprintf('%02d', $payment->getCcExpMonth()) . substr($payment->getCcExpYear(), -2, 2))->setCvv2($payment->getCcCid());
}
break;
}
$order = $payment->getOrder();
if (!empty($order)) {
$billing = $order->getBillingAddress();
if (!empty($billing)) {
$request->setFirstname($billing->getFirstname())->setLastname($billing->getLastname())->setStreet($billing->getStreet(1))->setCity($billing->getCity())->setState($billing->getRegion())->setZip($billing->getPostcode())->setCountry($billing->getCountry())->setEmail($payment->getOrder()->getCustomerEmail());
}
$shipping = $order->getShippingAddress();
if (!empty($shipping)) {
$request->setShiptofirstname($shipping->getFirstname())->setShiptolastname($shipping->getLastname())->setShiptostreet($shipping->getStreet(1))->setShiptocity($shipping->getCity())->setShiptostate($shipping->getRegion())->setShiptozip($shipping->getPostcode())->setShiptocountry($shipping->getCountry());
}
}
return $request;
}
示例15: getNewTokenCardArray
public function getNewTokenCardArray(Varien_Object $payment)
{
$data = array();
$data['CardHolder'] = $payment->getCcOwner();
$data['CardNumber'] = $payment->getCcNumber();
$data['CardType'] = $payment->getCcType();
$data['Currency'] = $payment->getOrder()->getOrderCurrencyCode();
$data['CV2'] = $payment->getCcCid();
$data['Nickname'] = $payment->getCcNickname();
$data['Protocol'] = 'direct';
#For persistant storing
$data['ExpiryDate'] = str_pad($payment->getCcExpMonth(), 2, '0', STR_PAD_LEFT) . substr($payment->getCcExpYear(), 2);
if ($payment->getCcSsStartMonth() && $payment->getCcSsStartYear()) {
$data['StartDate'] = str_pad($payment->getCcSsStartMonth(), 2, '0', STR_PAD_LEFT) . substr($payment->getCcSsStartYear(), 2);
}
return $data;
}