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


PHP Varien_Object::getAdditionalInformation方法代码示例

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


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

示例1: validateAlias

 /**
  * Validates alias for in quote provided addresses
  * @param Mage_Sales_Model_Quote $quote
  * @param Varien_Object $payment
  * @throws Mage_Core_Exception
  */
 protected function validateAlias($quote, $payment)
 {
     $alias = $payment->getAdditionalInformation('alias');
     if (0 < strlen(trim($alias)) && is_numeric($payment->getAdditionalInformation('cvc')) && false === Mage::helper('ops/alias')->isAliasValidForAddresses($quote->getCustomerId(), $alias, $quote->getBillingAddress(), $quote->getShippingAddress(), $quote->getStoreId())) {
         $this->getOnepage()->getCheckout()->setGotoSection('payment');
         Mage::throwException($this->getHelper()->__('Invalid payment information provided!'));
     }
 }
开发者ID:roshu1980,项目名称:add-computers,代码行数:14,代码来源:Cc.php

示例2: create

 public function create(Varien_Object $payment, $merchantAccount)
 {
     $this->merchantAccount = $merchantAccount;
     $this->browserInfo->acceptHeader = $_SERVER['HTTP_ACCEPT'];
     $this->browserInfo->userAgent = $_SERVER['HTTP_USER_AGENT'];
     $this->shopperIP = $_SERVER['REMOTE_ADDR'];
     $this->md = $payment->getAdditionalInformation('md');
     $this->paResponse = $payment->getAdditionalInformation('paResponse');
     return $this;
 }
开发者ID:Maikel-Koek,项目名称:magento,代码行数:10,代码来源:PaymentRequest3d.php

示例3: getBaseParams

 /**
  * retrieves the basic parameters for a capture call
  *
  * @param Netresearch_OPS_Model_Payment_Abstract $opsPaymentMethod
  * @param Varien_Object $payment
  * @param                                        $amount
  * @param                                        $arrInfo
  *
  * @return $this
  */
 protected function getBaseParams(Netresearch_OPS_Model_Payment_Abstract $opsPaymentMethod, Varien_Object $payment, $amount, $arrInfo)
 {
     $this->requestParams['AMOUNT'] = $this->getDataHelper()->getAmount($amount);
     $this->requestParams['PAYID'] = $payment->getAdditionalInformation('paymentId');
     $this->requestParams['OPERATION'] = $arrInfo['operation'];
     $this->requestParams['CURRENCY'] = Mage::app()->getStore($payment->getOrder()->getStoreId())->getBaseCurrencyCode();
     return $this;
 }
开发者ID:roshu1980,项目名称:add-computers,代码行数:18,代码来源:Abstract.php

示例4: _authorize

 /**
  * Authorizes specified amount
  * 
  * @param Varien_Object $payment
  * @param decimal $amount
  * @param boolean $capture
  * @return Braintree_Payments_Model_Paymentmethod
  */
 protected function _authorize(Varien_Object $payment, $amount, $capture, $token = false)
 {
     try {
         $order = $payment->getOrder();
         $orderId = $order->getIncrementId();
         $billing = $order->getBillingAddress();
         $shipping = $order->getShippingAddress();
         $transactionParams = array('channel' => $this->_getChannel(), 'orderId' => $orderId, 'amount' => $amount, 'customer' => array('firstName' => $billing->getFirstname(), 'lastName' => $billing->getLastname(), 'company' => $billing->getCompany(), 'phone' => $billing->getTelephone(), 'fax' => $billing->getFax(), 'email' => $order->getCustomerEmail()));
         $customerId = Mage::helper('braintree_payments')->generateCustomerId($order->getCustomerId(), $order->getCustomerEmail());
         if ($order->getCustomerId() && $this->exists($customerId)) {
             $transactionParams['customerId'] = $customerId;
             unset($transactionParams['customer']);
         } else {
             $transactionParams['customer']['id'] = $customerId;
         }
         if ($capture) {
             $transactionParams['options']['submitForSettlement'] = true;
         }
         if ($this->_merchantAccountId) {
             $transactionParams['merchantAccountId'] = $this->_merchantAccountId;
         }
         $token = $this->_getMethodSpecificAuthorizeTransactionToken($token);
         if ($token) {
             $nonce = Mage::helper('braintree_payments')->getNonceForVaultedToken($token);
             $transactionParams['customerId'] = $customerId;
         } else {
             $transactionParams['billing'] = $this->_toBraintreeAddress($billing);
             $transactionParams['shipping'] = $this->_toBraintreeAddress($shipping);
             $transactionParams['options']['addBillingAddressToPaymentMethod'] = true;
             $nonce = $payment->getAdditionalInformation('nonce');
         }
         $transactionParams['paymentMethodNonce'] = $nonce;
         $transactionParams = array_merge_recursive($transactionParams, $this->_addMethodSpecificAuthorizeTransactionParams($payment));
         if (isset($transactionParams['options']['storeInVault']) && !$transactionParams['options']['storeInVault']) {
             $transactionParams['options']['addBillingAddressToPaymentMethod'] = false;
         }
         $this->_debug($transactionParams);
         try {
             $result = Braintree_Transaction::sale($transactionParams);
             $this->_debug($result);
         } catch (Exception $e) {
             Mage::logException($e);
             Mage::throwException(Mage::helper('braintree_payments')->__('Please try again later'));
         }
         if ($result->success) {
             $this->setStore($payment->getOrder()->getStoreId());
             $payment = $this->_processSuccessResult($payment, $result, $amount);
         } else {
             Mage::throwException(Mage::helper('braintree_payments/error')->parseBraintreeError($result));
         }
     } catch (Exception $e) {
         $this->_processMethodSpecificAuthorizeTransactionError();
         throw new Mage_Payment_Model_Info_Exception($e->getMessage());
     }
     return $this;
 }
开发者ID:portchris,项目名称:NaturalRemedyCompany,代码行数:64,代码来源:Paymentmethod.php

示例5: authorize

 public function authorize(Varien_Object $payment, $amount)
 {
     if ($amount <= 0) {
         Mage::throwException(Mage::helper('aplazame')->__('Invalid amount for authorization.'));
     }
     $token = $payment->getAdditionalInformation(self::CHECKOUT_TOKEN);
     $api = Mage::getModel('aplazame/api_client');
     $result = $api->setOrderId($token)->authorize();
     if (isset($result["id"])) {
         $this->getInfoInstance()->setAdditionalInformation("charge_id", $result["id"]);
     } else {
         Mage::throwException(Mage::helper('aplazame')->__('Aplazame charge id not returned from call.'));
     }
     $this->_validate_amount_result(Aplazame_Util::formatDecimals($amount), $result);
     $payment->setTransactionId($this->getChargeId())->setIsTransactionClosed(0);
     return $this;
 }
开发者ID:anshumanravi,项目名称:magento,代码行数:17,代码来源:Payment.php

示例6: _void

 /**
  * Void/Cancel
  */
 protected function _void(Varien_Object $payment)
 {
     $orderTransaction = $payment->lookupTransaction(false, Mage_Sales_Model_Order_Payment_Transaction::TYPE_ORDER);
     if (!$orderTransaction) {
         $orderTransactionId = $payment->getAdditionalInformation('order_reference');
     } else {
         $orderTransactionId = $orderTransaction->getTxnId();
     }
     if ($orderTransaction) {
         $this->_getApi()->cancelOrderReference($orderTransactionId);
     }
     return $this;
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:16,代码来源:PaymentMethod.php

示例7: _buildRequest

 /**
  * Prepare request to gateway
  * 
  * HERE WE NEED TO CHIME IN AND USE AN EXISTING CUSTOMER ACCOUNT IF A TOKEN
  * IS PRESENT
  *
  * @link http://www.authorize.net/support/AIM_guide.pdf
  * @param Mage_Payment_Model_Info $payment
  * @return Mage_Paygate_Model_Authorizenet_Request
  */
 protected function _buildRequest(Varien_Object $payment)
 {
     $order = $payment->getOrder();
     $this->setStore($order->getStoreId());
     $request = $this->_getRequest()->setXType($payment->getAnetTransType())->setXMethod(self::REQUEST_METHOD_CC);
     if ($order && $order->getIncrementId()) {
         $request->setXInvoiceNum($order->getIncrementId());
     }
     if ($payment->getAmount()) {
         $request->setXAmount($payment->getAmount(), 2);
         $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());
//.........这里部分代码省略.........
开发者ID:Jonathonbyrd,项目名称:Optimized-Magento-1.9.x,代码行数:101,代码来源:Revolution.php

示例8: capture

 public function capture(Varien_Object $payment, $amount)
 {
     $session = Mage::getSingleton('core/session');
     $logger = Mage::helper('worldpay/logger');
     if ($session->getData('wp_3dscompletionNeeded')) {
         $payment->setIsTransactionClosed(0);
         $payment->setSkipOrderProcessing(true);
         $payment->setStatus(self::STATUS_APPROVED);
         $payment->setAmount($amount);
         $payment->setShouldCloseParentTransaction(1);
         $payment->setAdditionalInformation("worldpayOrderCode", $session->getData('wp_orderCode'));
         $payment->setLastTransId($session->getData('wp_orderCode'));
         $payment->setTransactionId($session->getData('wp_orderCode'));
         $session->setData('wp_3dscompletionNeeded', false);
         return $this;
     }
     $worldpayOrderCode = $payment->getData('last_trans_id');
     if ($worldpayOrderCode) {
         $worldpay = $this->setupWorldpay();
         try {
             $authorizationTransaction = $payment->getAuthorizationTransaction();
             if ($authorizationTransaction) {
                 $payment->setAdditionalInformation("worldpayOrderCode", $authorizationTransaction->getTxnId());
                 $worldpayOrderCode = $authorizationTransaction->getTxnId();
             } else {
                 $worldpayOrderCode = $payment->getAdditionalInformation('worldpayOrderCode');
             }
             $worldpay->captureAuthorisedOrder($worldpayOrderCode, $amount * 100);
             $payment->setShouldCloseParentTransaction(1)->setIsTransactionClosed(1);
             $logger->log('Capture Order: ' . $session->getData('wp_orderCode') . ' success');
         } catch (Exception $e) {
             $logger->log('Capture Order: ' . $session->getData('wp_orderCode') . ' failed with ' . $e->getMessage());
             Mage::throwException('Payment failed, please try again later ' . $e->getMessage());
         }
     } else {
         $payment->setAdditionalInformation('payment_type', 'capture');
         return $this->createOrder($payment, $amount, false);
     }
 }
开发者ID:JGMAgency,项目名称:worldpay-magento,代码行数:39,代码来源:CreditCards.php

示例9: void

 /**
  * Void payment
  *
  * @param   Varien_Object $invoicePayment
  * @return  Mage_Payment_Model_Abstract
  */
 public function void(Varien_Object $payment)
 {
     $error = false;
     // Void is not enabled.
     if (!$this->getConfigData('enable_void')) {
         return $this;
     }
     if (in_array($payment->getAdditionalInformation(self::PAYMENTMETHOD), $this->_directPaymentMethods)) {
         // Do not run financial transactions on directpayment.
         return $this;
     }
     if (!$payment->getAdditionalInformation(self::TRANSACTION_ID)) {
         if (!$payment->getBbsTransactionId()) {
             $this->getApi()->doLog(Mage::helper('bbsnetaxept')->__('Could not find transaction id.'));
             return $this;
         } else {
             $bbsTransId = $payment->getBbsTransactionId();
             // Make it compatible with old fashion BBSNetterminal.
         }
     } else {
         $bbsTransId = $payment->getAdditionalInformation(self::TRANSACTION_ID);
     }
     $order = $payment->getOrder();
     $this->_useMobile = $payment->getAdditionalInformation(self::MOBILE_CLIENT) === true;
     if ($order->getInvoiceCollection()->count() > 0) {
         // Do no try to annul orders that have invoices.
         return $this;
     }
     $InvoiceId = $order->getIncrementId() ? $order->getIncrementId() : 'Unknown';
     if ($this->getApi()->void($bbsTransId, $InvoiceId) == $bbsTransId) {
         $payment->setStatus(self::STATUS_SUCCESS);
     } else {
         $error = Mage::helper('bbsnetaxept')->__('Error void the payment: %s', $this->getApi()->getErrorMessage());
     }
     if ($error !== false) {
         $this->getApi()->doLog($error);
         //    Mage::throwException($error);
     }
     return $this;
 }
开发者ID:nilshopsahl,项目名称:hasla.local,代码行数:46,代码来源:WithGUI.php

示例10: _callDoAuthorize

 /**
  * Call DoAuthorize
  *
  * @param int $amount
  * @param Varien_Object $payment
  * @param string $parentTransactionId
  * @return Mage_Paypal_Model_Api_Abstract
  * @throws Mage_Paypal_Model_Api_ProcessableException
  */
 protected function _callDoAuthorize($amount, $payment, $parentTransactionId)
 {
     $apiData = $this->_pro->getApi()->getData();
     foreach ($apiData as $k => $v) {
         if (is_object($v)) {
             unset($apiData[$k]);
         }
     }
     Mage::getSingleton('checkout/session')->setPaypalTransactionData($apiData);
     $this->_pro->resetApi();
     $api = $this->_setApiProcessableErrors()->setAmount($amount)->setCurrencyCode($payment->getOrder()->getBaseCurrencyCode())->setTransactionId($parentTransactionId)->callDoAuthorization();
     $payment->setAdditionalInformation($this->_authorizationCountKey, $payment->getAdditionalInformation($this->_authorizationCountKey) + 1);
     return $api;
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:23,代码来源:Express.php

示例11: capture

 public function capture(Varien_Object $payment, $amount)
 {
     if ($payment->getAdditionalInformation('hyperpay_transaction_code') == 'PA') {
         $refId = $payment->getAdditionalInformation('IDENTIFICATION_REFERENCEID');
         $currency = $payment->getAdditionalInformation('CURRENCY');
         $dataTransaction = $this->getCredentials();
         $dataTransaction['tx_mode'] = $this->getTransactionMode();
         $postData = getPostCapture($refId, $amount, $currency, $dataTransaction);
         $server = $this->getServerMode();
         $url = getExecuteUrl($server);
         $response = executePayment($postData, $url);
         $result = buildResponseArray($response);
         $payment->setAdditionalInformation('CAPTURE', $result['PROCESSING.RESULT']);
         if ($result['PROCESSING.RESULT'] == 'ACK') {
             $payment->setStatus('APPROVED')->setTransactionId($payment->getAdditionalInformation('IDENTIFICATION_REFERENCEID'))->setIsTransactionClosed(1)->save();
         } else {
             Mage::throwException(Mage::helper('hyperpay')->__('An error occurred while processing'));
         }
     } else {
         $payment->setStatus('APPROVED')->setTransactionId($payment->getAdditionalInformation('IDENTIFICATION_REFERENCEID'))->setIsTransactionClosed(1)->save();
     }
     return $this;
 }
开发者ID:Aya-Mousa,项目名称:HyperpayMagentoo,代码行数:23,代码来源:Abstract.php

示例12: refund

 /**
  * Trigger online refund action from admin panel.
  *
  * @param Varien_Object $payment
  * @param float $amount
  * @return $this|Mage_Payment_Model_Abstract
  * @throws Mage_Core_Exception
  */
 public function refund(Varien_Object $payment, $amount)
 {
     $bzRefund = Mage::getModel('barzahlen/api_request_refund', array('transactionId' => $payment->getAdditionalInformation('transaction_id'), 'amount' => $amount, 'currency' => $payment->getOrder()->getOrderCurrencyCode()));
     try {
         $this->getBarzahlenApi()->handleRequest($bzRefund);
         $payment->setTransactionId($bzRefund->getRefundTransactionId());
     } catch (Exception $e) {
         Mage::helper('barzahlen')->bzLog($e);
         if (strpos($e->getMessage(), 'refund declined')) {
             Mage::throwException(Mage::helper('barzahlen')->__('bz_adm_refund_declined'));
         } else {
             Mage::throwException(Mage::helper('barzahlen')->__('bz_adm_refund_error'));
         }
     }
     return $this;
 }
开发者ID:TriplesenseReply,项目名称:Barzahlen-Magento,代码行数:24,代码来源:Barzahlen.php

示例13: _buildRequest

 /**
  * Prepare request to gateway
  *
  * @link http://www.authorize.net/support/AIM_guide.pdf
  * @param Mage_Payment_Model_Info $payment
  * @return Mage_Paygate_Model_Authorizenet_Request
  */
 protected function _buildRequest(Varien_Object $payment)
 {
     $order = $payment->getOrder();
     $this->setStore($order->getStoreId());
     $request = $this->_getRequest()->setXType($payment->getAnetTransType())->setXMethod(self::REQUEST_METHOD_CC);
     if ($order && $order->getIncrementId()) {
         $request->setXInvoiceNum($order->getIncrementId());
     }
     if ($payment->getAmount()) {
         $request->setXAmount($payment->getAmount(), 2);
         $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
              */
             $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:
             $request->setXAuthCode($payment->getCcAuthCode());
             break;
     }
     if ($this->getIsCentinelValidationEnabled()) {
         $params = $this->getCentinelValidator()->exportCmpiData(array());
         $request = Varien_Object_Mapper::accumulateByMap($params, $request, $this->_centinelFieldMap);
     }
     if (!empty($order)) {
         $billing = $order->getBillingAddress();
         if (!empty($billing)) {
             $request->setXFirstName($billing->getFirstname())->setXLastName($billing->getLastname())->setXCompany($billing->getCompany())->setXAddress($billing->getStreet(1))->setXCity($billing->getCity())->setXState($billing->getRegion())->setXZip($billing->getPostcode())->setXCountry($billing->getCountry())->setXPhone($billing->getTelephone())->setXFax($billing->getFax())->setXCustId($order->getCustomerId())->setXCustomerIp($order->getRemoteIp())->setXCustomerTaxId($billing->getTaxId())->setXEmail($order->getCustomerEmail())->setXEmailCustomer($this->getConfigData('email_customer'))->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());
         }
         $request->setXPoNum($payment->getPoNumber())->setXTax($order->getBaseTaxAmount())->setXFreight($order->getBaseShippingAmount());
     }
     if ($payment->getCcNumber()) {
         $request->setXCardNum($payment->getCcNumber())->setXExpDate(sprintf('%02d-%04d', $payment->getCcExpMonth(), $payment->getCcExpYear()))->setXCardCode($payment->getCcCid());
     }
     return $request;
 }
开发者ID:par-orillonsoft,项目名称:magento_work,代码行数:70,代码来源:Authorizenet.php

示例14: refund

 public function refund(Varien_Object $payment, $amount)
 {
     if ($order = $payment->getOrder()) {
         $worldpay = $this->setupWorldpay();
         try {
             $logger = Mage::helper('worldpay/logger');
             $worldpay->refundOrder($payment->getAdditionalInformation("worldpayOrderCode"), $amount * 100);
             return $this;
         } catch (Exception $e) {
             Mage::throwException('Refund failed ' . $e->getMessage());
         }
     }
     Mage::throwException('No matching order found in Worldpay to refund. Please visit your Worldpay dashboard and refund the order manually.');
 }
开发者ID:ao,项目名称:worldpay-magento-1,代码行数:14,代码来源:Abstract.php

示例15: create

 public function create(Varien_Object $payment, $amount, $paymentMethod = null, $merchantAccount = null, $recurringType = null, $recurringPaymentType = null, $enableMoto = null)
 {
     $order = $payment->getOrder();
     $incrementId = $order->getIncrementId();
     $orderCurrencyCode = $order->getOrderCurrencyCode();
     // override amount because this amount uses the right currency
     $amount = $order->getGrandTotal();
     $customerId = $order->getCustomerId();
     if ($customerId) {
         $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
         $customerId = $customer->getData('adyen_customer_ref') ?: $customer->getData('increment_id') ?: $customerId;
     }
     $realOrderId = $order->getRealOrderId();
     $this->reference = $incrementId;
     $this->merchantAccount = $merchantAccount;
     $this->amount->currency = $orderCurrencyCode;
     $this->amount->value = Mage::helper('adyen')->formatAmount($amount, $orderCurrencyCode);
     //shopper data
     $customerEmail = $order->getCustomerEmail();
     $this->shopperEmail = $customerEmail;
     $this->shopperIP = $order->getRemoteIp();
     $this->shopperReference = !empty($customerId) ? $customerId : self::GUEST_ID . $realOrderId;
     // Set the recurring contract
     if ($recurringType) {
         if ($paymentMethod == "oneclick") {
             // For ONECLICK look at the recurringPaymentType that the merchant has selected in Adyen ONECLICK settings
             if ($payment->getAdditionalInformation('customer_interaction')) {
                 $this->recurring = new Adyen_Payment_Model_Adyen_Data_Recurring();
                 $this->recurring->contract = "ONECLICK";
             } else {
                 $this->recurring = new Adyen_Payment_Model_Adyen_Data_Recurring();
                 $this->recurring->contract = "RECURRING";
             }
         } elseif ($paymentMethod == "cc") {
             // if save card is disabled only shoot in as recurring if recurringType is set to ONECLICK,RECURRING
             if ($payment->getAdditionalInformation("store_cc") == "" && $recurringType == "ONECLICK,RECURRING") {
                 $this->recurring = new Adyen_Payment_Model_Adyen_Data_Recurring();
                 $this->recurring->contract = "RECURRING";
             } elseif ($payment->getAdditionalInformation("store_cc") == "1") {
                 $this->recurring = new Adyen_Payment_Model_Adyen_Data_Recurring();
                 $this->recurring->contract = $recurringType;
             } elseif ($recurringType == "RECURRING") {
                 // recurring permission is not needed from shopper so just save it as recurring
                 $this->recurring = new Adyen_Payment_Model_Adyen_Data_Recurring();
                 $this->recurring->contract = "RECURRING";
             }
         } else {
             $this->recurring = new Adyen_Payment_Model_Adyen_Data_Recurring();
             $this->recurring->contract = $recurringType;
         }
     }
     /**
      * Browser info
      * @var unknown_type
      */
     if (isset($_SERVER['HTTP_ACCEPT'])) {
         $this->browserInfo->acceptHeader = $_SERVER['HTTP_ACCEPT'];
     }
     if (isset($_SERVER['HTTP_USER_AGENT'])) {
         $this->browserInfo->userAgent = $_SERVER['HTTP_USER_AGENT'];
     }
     switch ($paymentMethod) {
         case "elv":
             $elv = unserialize($payment->getPoNumber());
             $this->card = null;
             $this->shopperName = null;
             $this->bankAccount = null;
             $this->elv->accountHolderName = $elv['account_owner'];
             $this->elv->bankAccountNumber = $elv['account_number'];
             $this->elv->bankLocation = $elv['bank_location'];
             $this->elv->bankLocationId = $elv['bank_location'];
             $this->elv->bankName = $elv['bank_name'];
             break;
         case "cc":
         case "oneclick":
             $this->shopperName = null;
             $this->elv = null;
             $this->bankAccount = null;
             $billingAddress = $order->getBillingAddress();
             $helper = Mage::helper('adyen');
             if ($billingAddress) {
                 $this->billingAddress = new Adyen_Payment_Model_Adyen_Data_BillingAddress();
                 $this->billingAddress->street = $helper->getStreet($billingAddress)->getName();
                 $this->billingAddress->houseNumberOrName = $helper->getStreet($billingAddress)->getHouseNumber();
                 $this->billingAddress->city = $billingAddress->getCity();
                 $this->billingAddress->postalCode = $billingAddress->getPostcode();
                 $this->billingAddress->stateOrProvince = $billingAddress->getRegionCode();
                 $this->billingAddress->country = $billingAddress->getCountryId();
             }
             $deliveryAddress = $order->getShippingAddress();
             if ($deliveryAddress) {
                 $this->deliveryAddress = new Adyen_Payment_Model_Adyen_Data_DeliveryAddress();
                 $this->deliveryAddress->street = $helper->getStreet($deliveryAddress)->getName();
                 $this->deliveryAddress->houseNumberOrName = $helper->getStreet($deliveryAddress)->getHouseNumber();
                 $this->deliveryAddress->city = $deliveryAddress->getCity();
                 $this->deliveryAddress->postalCode = $deliveryAddress->getPostcode();
                 $this->deliveryAddress->stateOrProvince = $deliveryAddress->getRegionCode();
                 $this->deliveryAddress->country = $deliveryAddress->getCountryId();
             }
             if ($paymentMethod == "oneclick") {
//.........这里部分代码省略.........
开发者ID:Maikel-Koek,项目名称:magento,代码行数:101,代码来源:PaymentRequest.php


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