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


PHP Mage_Sales_Model_Order::getOrderCurrencyCode方法代码示例

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


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

示例1: processOrder

 /**
  * Processes payment for specified order
  * @param Mage_Sales_Model_Order $Order
  * @return
  */
 public function processOrder(Mage_Sales_Model_Order $PrimaryOrder, Mage_Sales_Model_Order $Order = null)
 {
     $amount = $Order->getGrandTotal();
     $increment = $Order->getIncrementId();
     $VendorTxCode = $increment . "-" . date("y-m-d-H-i-s", time()) . "-" . rand(0, 1000000);
     $model = Mage::getModel('sarp/protxDirect')->load($this->getSubscription()->getId(), 'subscription_id');
     $data = array('VPSProtocol' => self::PROTOCOL_VERSION, 'TxType' => self::REPEAT, 'Vendor' => Mage::getStoreConfig(self::VENDOR), 'VendorTxCode' => $VendorTxCode, 'Amount' => $amount, 'Currency' => $Order->getOrderCurrencyCode(), 'Description' => 'Order', 'RelatedVPSTxId' => $model->getVpsTxId(), 'RelatedVendorTxCode' => $model->getVendorTxCode(), 'RelatedSecurityKey' => $model->getSecurityKey(), 'RelatedTxAuthNo' => $model->getTxAuthNo());
     $ready = array();
     foreach ($data as $key => $value) {
         $ready[] = $key . '=' . $value;
     }
     $str = implode('&', $ready);
     switch (Mage::getStoreConfig(self::MODE)) {
         case 'test':
             $url = self::TEST_REPEAT_URL;
             break;
         case 'live':
             $url = self::LIVE_REPEAT_URL;
             break;
         default:
             $url = self::SIMULATOR_REPEAT_URL;
     }
     $ready = $this->requestPost($url, $str);
     if (empty($ready)) {
         throw new AW_Sarp_Exception($this->__("Order cannot be completed. Unknown error"));
     }
     if ($ready['Status'] != 'OK') {
         throw new AW_Sarp_Exception($ready['Status'] . " - " . $ready['StatusDetail']);
     }
 }
开发者ID:par-orillonsoft,项目名称:magento_work,代码行数:35,代码来源:ProtxDirect.php

示例2: createByApiResponse

 /**
  * @param Mage_Sales_Model_Order $order
  * @param Payone_Api_Response_Interface $response
  * @param Payone_Api_Request_Interface $request
  * @throws Payone_Core_Exception_TransactionAlreadyExists
  * @return null|Payone_Core_Model_Domain_Transaction
  */
 public function createByApiResponse(Mage_Sales_Model_Order $order, Payone_Api_Response_Interface $response, Payone_Api_Request_Interface $request)
 {
     $transaction = $this->getFactory()->getModelTransaction();
     $transaction->load($response->getTxid(), 'txid');
     // should not exist but to be sure load by txid
     if ($transaction->hasData()) {
         throw new Payone_Core_Exception_TransactionAlreadyExists($response->getTxid());
     }
     $transaction->setTxid($response->getTxid());
     $transaction->setLastTxaction($response->getStatus());
     $transaction->setUserid($response->getUserid());
     $transaction->setStoreId($order->getStoreId());
     $transaction->setOrderId($order->getId());
     $transaction->setReference($order->getIncrementId());
     $transaction->setCurrency($order->getOrderCurrencyCode());
     $transaction->setCustomerId($order->getCustomerId());
     $transaction->setClearingtype($request->getClearingtype());
     $transaction->setMode($request->getMode());
     $transaction->setMid($request->getMid());
     $transaction->setAid($request->getAid());
     $transaction->setPortalid($request->getPortalid());
     $transaction->setLastSequencenumber(0);
     $data = $response->toArray();
     $transaction->addData($data);
     $transaction->save();
     return $transaction;
 }
开发者ID:romfr,项目名称:payone-magento,代码行数:34,代码来源:Create.php

示例3: toQuote

 /**
  * Converting order object to quote object
  *
  * @param   Mage_Sales_Model_Order $order
  * @return  Mage_Sales_Model_Quote
  */
 public function toQuote(Mage_Sales_Model_Order $order, $quote = null)
 {
     if (!$quote instanceof Mage_Sales_Model_Quote) {
         $quote = Mage::getModel('sales/quote');
     }
     $quote->setStoreId($order->getStoreId())->setOrderId($order->getId())->setCustomerId($order->getCustomerId())->setCustomerEmail($order->getCustomerEmail())->setCustomerGroupId($order->getCustomerGroupId())->setCustomerTaxClassId($order->getCustomerTaxClassId())->setCustomerIsGuest($order->getCustomerIsGuest())->setBaseCurrencyCode($order->getBaseCurrencyCode())->setStoreCurrencyCode($order->getStoreCurrencyCode())->setQuoteCurrencyCode($order->getOrderCurrencyCode())->setStoreToBaseRate($order->getStoreToBaseRate())->setStoreToQuoteRate($order->getStoreToOrderRate())->setGrandTotal($order->getGrandTotal())->setBaseGrandTotal($order->getBaseGrandTotal())->setCouponCode($order->getCouponCode())->setGiftcertCode($order->getGiftcertCode())->setAppliedRuleIds($order->getAppliedRuleIds())->collectTotals();
     Mage::dispatchEvent('sales_convert_order_to_quote', array('order' => $order, 'quote' => $quote));
     return $quote;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:15,代码来源:Order.php

示例4: _prepareOrderData

 /**
  * @return array
  */
 protected function _prepareOrderData()
 {
     // magento 1.5 compat
     $shipping_method_c = $this->_order->getShippingMethod(true);
     $shipping_method = $this->_order->getData('shipping_method');
     $shipping_method_code = $shipping_method_c ? $shipping_method_c->getData('carrier_code') : $shipping_method;
     $data = array_filter(array('currency_code' => $this->_order->getOrderCurrencyCode(), 'shipping_method_code' => $shipping_method_code, 'shipping_method_title' => $this->_order->getShippingDescription(), 'created_on' => $this->_order->getCreatedAt(), 'updated_on' => $this->_order->getUpdatedAt(), 'state' => $this->_order->getState(), 'status' => $this->_order->getStatus(), 'is_gift' => $this->_order->getGiftMessageId() != null, 'ref_quote_id' => $this->_order->getQuoteId(), 'order_subtotal_with_tax' => $this->_order->getSubtotalInclTax(), 'order_subtotal' => $this->_order->getSubtotal(), 'order_tax' => $this->_order->getTaxAmount(), 'order_hidden_tax' => $this->_order->getHiddenTaxAmount(), 'order_shipping_with_tax' => $this->_order->getShippingInclTax(), 'order_shipping' => $this->_order->getShippingAmount(), 'order_discount' => $this->_order->getDiscountAmount(), 'order_shipping_discount' => $this->_order->getShippingDiscountAmount(), 'order_total' => $this->_order->getGrandTotal(), 'order_total_items' => $this->_order->getTotalItemCount()));
     return $data;
 }
开发者ID:payin7-payments,项目名称:payin7-magento,代码行数:12,代码来源:Submit.php

示例5: _buildNewPayload

 /**
  * Fill in the values the order create request requires.
  *
  * @return self
  */
 protected function _buildNewPayload()
 {
     $this->_payload->setBillingAddress($this->_getRomBillingAddress($this->_order->getBillingAddress()))->setCurrency($this->_order->getOrderCurrencyCode())->setLevelOfService($this->_config->levelOfService)->setLocale($this->_getLocale())->setOrderHistoryUrl($this->_helper->getOrderHistoryUrl($this->_order))->setOrderId($this->_order->getIncrementId())->setOrderTotal($this->_order->getBaseGrandTotal())->setOrderType($this->_config->orderType)->setRequestId($this->_coreHelper->generateRequestId('OCR-'));
     $createdAt = $this->_getAsDateTime($this->_order->getCreatedAt());
     if ($createdAt) {
         $this->_payload->setCreateTime($createdAt);
     }
     return $this->_setCustomerData($this->_order, $this->_payload)->_setOrderContext($this->_order, $this->_payload)->_setShipGroups($this->_order, $this->_payload)->_setPaymentData($this->_order, $this->_payload);
 }
开发者ID:adderall,项目名称:magento-retail-order-management,代码行数:14,代码来源:Create.php

示例6: _validateEventData

 /**
  * Checking returned parameters
  * Thorws Mage_Core_Exception if error
  * @param bool $fullCheck Whether to make additional validations such as payment status, transaction signature etc.
  *
  * @return array  $params request params
  */
 protected function _validateEventData($fullCheck = true)
 {
     // get request variables
     $params = $this->_eventData;
     if (empty($params)) {
         Mage::throwException('Request does not contain any elements.');
     }
     // check order ID
     if (empty($params['transaction_id']) || $fullCheck == false && $this->_getCheckout()->getMoneybookersRealOrderId() != $params['transaction_id']) {
         Mage::throwException('Missing or invalid order ID.');
     }
     // load order for further validation
     $this->_order = Mage::getModel('sales/order')->loadByIncrementId($params['transaction_id']);
     if (!$this->_order->getId()) {
         Mage::throwException('Order not found.');
     }
     if (0 !== strpos($this->_order->getPayment()->getMethodInstance()->getCode(), 'moneybookers_')) {
         Mage::throwException('Unknown payment method.');
     }
     // make additional validation
     if ($fullCheck) {
         // check payment status
         if (empty($params['status'])) {
             Mage::throwException('Unknown payment status.');
         }
         // check transaction signature
         if (empty($params['md5sig'])) {
             Mage::throwException('Invalid transaction signature.');
         }
         $checkParams = array('merchant_id', 'transaction_id', 'secret', 'mb_amount', 'mb_currency', 'status');
         $md5String = '';
         foreach ($checkParams as $key) {
             if ($key == 'merchant_id') {
                 $md5String .= Mage::getStoreConfig(Phoenix_Moneybookers_Helper_Data::XML_PATH_CUSTOMER_ID, $this->_order->getStoreId());
             } elseif ($key == 'secret') {
                 $secretKey = Mage::getStoreConfig(Phoenix_Moneybookers_Helper_Data::XML_PATH_SECRET_KEY, $this->_order->getStoreId());
                 if (empty($secretKey)) {
                     Mage::throwException('Secret key is empty.');
                 }
                 $md5String .= strtoupper(md5($secretKey));
             } elseif (isset($params[$key])) {
                 $md5String .= $params[$key];
             }
         }
         $md5String = strtoupper(md5($md5String));
         if ($md5String != $params['md5sig']) {
             Mage::throwException('Hash is not valid.');
         }
         // check transaction amount if currency matches
         if ($this->_order->getOrderCurrencyCode() == $params['mb_currency']) {
             if (round($this->_order->getGrandTotal(), 2) != $params['mb_amount']) {
                 Mage::throwException('Transaction amount does not match.');
             }
         }
     }
     return $params;
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:64,代码来源:Event.php

示例7: getCurrency

 /**
  * Returns the currency compliant to ISO 4217 (3 char code)
  * @return string 3 Character long currency code
  *
  * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order|Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $object
  * @return string
  */
 public function getCurrency($object)
 {
     $currency = $object->getBaseCurrencyCode();
     if (!Mage::helper('paymill/optionHelper')->isBaseCurrency()) {
         if ($object instanceof Mage_Sales_Model_Quote) {
             $currency = $object->getQuoteCurrencyCode();
         } else {
             $currency = $object->getOrderCurrencyCode();
         }
     }
     return $currency;
 }
开发者ID:SiWe0401,项目名称:paymill-magento,代码行数:19,代码来源:PaymentHelper.php

示例8: crateFromOrder

 public static function crateFromOrder(Mage_Sales_Model_Order $order)
 {
     $aOrder = new self();
     $aOrder->id = $order->getIncrementId();
     $aOrder->currency = $order->getOrderCurrencyCode();
     $aOrder->total_amount = Aplazame_Sdk_Serializer_Decimal::fromFloat($order->getTotalDue());
     $aOrder->articles = array_map(array('Aplazame_Aplazame_BusinessModel_Article', 'crateFromOrderItem'), $order->getAllVisibleItems());
     if (($discounts = $order->getDiscountAmount()) !== null) {
         $aOrder->discount = Aplazame_Sdk_Serializer_Decimal::fromFloat(-$discounts);
     }
     return $aOrder;
 }
开发者ID:aplazame,项目名称:magento,代码行数:12,代码来源:Order.php

示例9: getAmount

 /**
  * Get the amount of the order in cents, make sure that we return the right value even if the locale is set to
  * something different than the default (e.g. nl_NL).
  *
  * @param Mage_Sales_Model_Order $order
  * @return int
  */
 protected function getAmount(Mage_Sales_Model_Order $order)
 {
     if ($order->getBaseCurrencyCode() === 'EUR') {
         $grand_total = $order->getBaseGrandTotal();
     } elseif ($order->getOrderCurrencyCode() === 'EUR') {
         $grand_total = $order->getGrandTotal();
     } else {
         Mage::log(__METHOD__ . ' said: Neither Base nor Order currency is in Euros.');
         Mage::throwException(__METHOD__ . ' said: Neither Base nor Order currency is in Euros.');
     }
     if (is_string($grand_total)) {
         $locale_info = localeconv();
         if ($locale_info['decimal_point'] !== '.') {
             $grand_total = strtr($grand_total, array($locale_info['thousands_sep'] => '', $locale_info['decimal_point'] => '.'));
         }
         $grand_total = floatval($grand_total);
         // Why U NO work with locales?
     }
     return floatval(round($grand_total, 2));
 }
开发者ID:Archipel,项目名称:Magento,代码行数:27,代码来源:ApiController.php

示例10: _processIncorrectPayment

 /**
  * Processes an order for which an incorrect amount has been paid (can only happen with Transfer)
  *
  * @param $newStates
  * @return bool
  */
 protected function _processIncorrectPayment($newStates)
 {
     //determine whether too much or not enough has been paid and determine the status history copmment accordingly
     $amount = round($this->_order->getBaseGrandTotal() * 100, 0);
     $setStatus = $newStates[1];
     if ($this->_postArray['brq_currency'] == $this->_order->getBaseCurrencyCode()) {
         $currencyCode = $this->_order->getBaseCurrencyCode();
         $orderAmount = $this->_order->getBaseGrandTotal();
     } else {
         $currencyCode = $this->_order->getOrderCurrencyCode();
         $orderAmount = $this->_order->getGrandTotal();
     }
     if ($amount > $this->_postArray['brq_amount']) {
         $description = Mage::helper('buckaroo3extended')->__('Not enough paid: %s has been transfered. Order grand total was: %s.', Mage::app()->getLocale()->currency($currencyCode)->toCurrency($this->_postArray['brq_amount']), Mage::app()->getLocale()->currency($currencyCode)->toCurrency($orderAmount));
     } elseif ($amount < $this->_postArray['brq_amount']) {
         $description = Mage::helper('buckaroo3extended')->__('Too much paid: %s has been transfered. Order grand total was: %s.', Mage::app()->getLocale()->currency($currencyCode)->toCurrency($this->_postArray['brq_amount']), Mage::app()->getLocale()->currency($currencyCode)->toCurrency($orderAmount));
     } else {
         //the correct amount was actually paid, so return false
         return false;
     }
     //hold the order
     $this->_order->hold()->save()->setStatus($setStatus)->save()->addStatusHistoryComment(Mage::helper('buckaroo3extended')->__($description), $setStatus)->save();
     return true;
 }
开发者ID:technomagegithub,项目名称:olgo.nl,代码行数:30,代码来源:Push.php

示例11: getCurrencyCode

 /**
  * Returns the currency code of the current order.
  *
  * @return string
  */
 public function getCurrencyCode()
 {
     return $this->_order->getOrderCurrencyCode();
 }
开发者ID:kirchbergerknorr,项目名称:kirchbergerknorr_trustedbadge,代码行数:9,代码来源:Calltoaction.php

示例12: getShoppingCartXML

 /**
  * Get Shopping Cart XML for MasterPass
  * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $quote
  * @return string
  */
 public function getShoppingCartXML($quote)
 {
     $dom = new DOMDocument('1.0', 'utf-8');
     $ShoppingCart = $dom->createElement('ShoppingCart');
     $dom->appendChild($ShoppingCart);
     if ($quote instanceof Mage_Sales_Model_Order) {
         $currency = $quote->getOrderCurrencyCode();
     } else {
         $currency = $quote->getQuoteCurrencyCode();
     }
     $ShoppingCart->appendChild($dom->createElement('CurrencyCode', $currency));
     $ShoppingCart->appendChild($dom->createElement('Subtotal', (int) (100 * $quote->getGrandTotal())));
     // Add Order Lines
     $items = $quote->getAllVisibleItems();
     /** @var $item Mage_Sales_Model_Quote_Item */
     foreach ($items as $item) {
         $product = $item->getProduct();
         if ($quote instanceof Mage_Sales_Model_Order) {
             $qty = $item->getQtyOrdered();
         } else {
             $qty = $item->getQty();
         }
         $ShoppingCartItem = $dom->createElement('ShoppingCartItem');
         $ShoppingCartItem->appendChild($dom->createElement('Description', $item->getName()));
         $ShoppingCartItem->appendChild($dom->createElement('Quantity', (double) $qty));
         $ShoppingCartItem->appendChild($dom->createElement('Value', (int) bcmul($product->getFinalPrice(), 100)));
         $ShoppingCartItem->appendChild($dom->createElement('ImageURL', $product->getThumbnailUrl()));
         $ShoppingCart->appendChild($ShoppingCartItem);
     }
     return str_replace("\n", '', $dom->saveXML());
 }
开发者ID:AndreKlang,项目名称:Magento-Payex,代码行数:36,代码来源:Order.php

示例13: doVoidOrder

 /**
  * Do Void Request/Response
  *
  * @param  Mage_Sales_Model_Order
  * @return array
  * @throws EbayEnterprise_PayPal_Exception when the operation cannot be completed or fails.
  */
 public function doVoidOrder(Mage_Sales_Model_Order $order)
 {
     return $this->doVoid($order->getIncrementId(), $order->getOrderCurrencyCode());
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:11,代码来源:Api.php

示例14: orderCreateRequest

 /**
  * Initializes the payment.
  * @param Mage_Sales_Model_Order
  * @param Mage_Shipping_Model_Shipping
  * @return array
  */
 public function orderCreateRequest(Mage_Sales_Model_Order $order, $allShippingRates)
 {
     $this->_order = $order;
     $orderCurrencyCode = $this->_order->getOrderCurrencyCode();
     $orderCountryCode = $this->_order->getBillingAddress()->getCountry();
     $shippingCostList = array();
     if (empty($allShippingRates) || Mage::getSingleton('customer/session')->isLoggedIn()) {
         if ($order->getShippingInclTax() > 0) {
             $shippingCostList['shippingMethods'][] = array('name' => $order->getShippingDescription(), 'country' => $orderCountryCode, 'price' => $this->toAmount($order->getShippingInclTax()));
         }
         $grandTotal = $this->_order->getGrandTotal() - $order->getShippingInclTax();
     } else {
         $firstPrice = 0;
         foreach ($allShippingRates as $key => $rate) {
             $gross = $this->toAmount($rate->getPrice());
             if ($key == 0) {
                 $firstPrice = $rate->getPrice();
             }
             $shippingCostList['shippingMethods'][] = array('name' => $rate->getMethodTitle(), 'country' => $orderCountryCode, 'price' => $gross);
         }
         $grandTotal = $this->_order->getGrandTotal() - $firstPrice;
     }
     $shippingCost = array('countryCode' => $orderCountryCode, 'shipToOtherCountry' => 'true', 'shippingCostList' => $shippingCostList);
     $orderItems = $this->_order->getAllVisibleItems();
     $items = array();
     $productsTotal = 0;
     $is_discount = false;
     foreach ($orderItems as $key => $item) {
         $itemInfo = $item->getData();
         if ($itemInfo['discount_amount'] > 0) {
             $itemInfo['price_incl_tax'] = $itemInfo['price_incl_tax'] - $itemInfo['discount_amount'];
             $is_discount = true;
         } else {
             if ($itemInfo['discount_percent'] > 0) {
                 $itemInfo['price_incl_tax'] = $itemInfo['price_incl_tax'] * (100 - $itemInfo['discount_percent']) / 100;
             }
         }
         // Check if the item is countable one
         if ($this->toAmount($itemInfo['price_incl_tax']) > 0) {
             $items['products'][] = array('quantity' => (int) $itemInfo['qty_ordered'], 'name' => $itemInfo['name'], 'unitPrice' => $this->toAmount($itemInfo['price_incl_tax']));
             $productsTotal += $itemInfo['price_incl_tax'] * $itemInfo['qty_ordered'];
         }
     }
     //if($this->_order->getShippingAmount () > 0 && !empty ( $shippingCostList['shippingMethods'][0] ) ){
     //        $items ['products'] ['products'] [] = array (
     //            'quantity' => 1 ,'name' => Mage::helper ( 'payu_account' )->__('Shipping costs') . " - " . $shippingCostList['shippingMethods'][0]['name'] ,'unitPrice' => $this->toAmount ( $this->_order->getShippingAmount () ));
     //}
     // assigning the shopping cart
     $shoppingCart = array('grandTotal' => $this->toAmount($grandTotal), 'CurrencyCode' => $orderCurrencyCode, 'ShoppingCartItems' => $items);
     $orderInfo = array('merchantPosId' => OpenPayU_Configuration::getMerchantPosId(), 'orderUrl' => Mage::getBaseUrl() . 'sales/order/view/order_id/' . $this->_order->getId() . '/', 'description' => 'Order no ' . $this->_order->getRealOrderId(), 'validityTime' => $this->_config->getOrderValidityTime());
     if ($is_discount) {
         $items['products'] = array();
         $items['products'][] = array('quantity' => 1, 'name' => Mage::helper('payu_account')->__('Order # ') . $this->_order->getId(), 'unitPrice' => $this->toAmount($grandTotal));
     }
     $OCReq = $orderInfo;
     $OCReq['products'] = $items['products'];
     $OCReq['customerIp'] = Mage::app()->getFrontController()->getRequest()->getClientIp();
     $OCReq['notifyUrl'] = $this->_myUrl . 'orderNotifyRequest';
     $OCReq['cancelUrl'] = $this->_myUrl . 'cancelPayment';
     $OCReq['continueUrl'] = $this->_myUrl . 'continuePayment';
     $OCReq['currencyCode'] = $orderCurrencyCode;
     $OCReq['totalAmount'] = $shoppingCart['grandTotal'];
     $OCReq['extOrderId'] = $this->_order->getId() . '-' . microtime();
     if (!empty($shippingCostList)) {
         $OCReq['shippingMethods'] = $shippingCostList['shippingMethods'];
     }
     unset($OCReq['shoppingCart']);
     $customer_sheet = array();
     $billingAddressId = $this->_order->getBillingAddressId();
     if (!empty($billingAddressId)) {
         $billingAddress = $this->_order->getBillingAddress();
         $customer_mail = $billingAddress->getEmail();
         if (!empty($customer_mail)) {
             $customer_sheet = array('email' => $billingAddress->getEmail(), 'phone' => $billingAddress->getTelephone(), 'firstName' => $billingAddress->getFirstname(), 'lastName' => $billingAddress->getLastname());
             $shippingAddressId = $this->_order->getShippingAddressId();
             if (!empty($shippingAddressId)) {
                 $shippingAddress = $this->_order->getShippingAddress();
             }
             if (!$this->_order->getIsVirtual()) {
                 $customer_sheet['delivery'] = array('street' => trim(implode(' ', $shippingAddress->getStreet())), 'postalCode' => $shippingAddress->getPostcode(), 'city' => $shippingAddress->getCity(), 'countryCode' => $shippingAddress->getCountry(), 'recipientName' => trim($shippingAddress->getFirstname() . ' ' . $shippingAddress->getLastname()), 'recipientPhone' => $shippingAddress->getTelephone(), 'recipientEmail' => $shippingAddress->getEmail());
             }
             $OCReq['buyer'] = $customer_sheet;
         }
     }
     $result = OpenPayU_Order::create($OCReq);
     if ($result->getStatus() == 'SUCCESS') {
         // store session identifier in session info
         Mage::getSingleton('core/session')->setPayUSessionId($result->getResponse()->orderId);
         // assign current transaction id
         $this->_transactionId = $result->getResponse()->orderId;
         $order->getPayment()->setLastTransId($this->_transactionId);
         $locale = Mage::getStoreConfig('general/locale/code', Mage::app()->getStore()->getId());
         $lang_code = explode('_', $locale, 2);
         $ret = array('redirectUri' => $result->getResponse()->redirectUri, 'url' => OpenPayu_Configuration::getSummaryUrl(), 'sessionId' => $result->getResponse()->orderId, 'lang' => strtolower($lang_code[1]));
//.........这里部分代码省略.........
开发者ID:par-orillonsoft,项目名称:plugin_magento,代码行数:101,代码来源:Payment.php

示例15: doVoid

 /**
  * Do Void Request/Response
  *
  * @param  Mage_Sales_Model_Order
  * @return array
  *
  * @throws EbayEnterprise_PayPal_Exception when the operation cannot be completed or fails.
  */
 public function doVoid(Mage_Sales_Model_Order $order)
 {
     $sdk = $this->getSdk($this->config->apiOperationDoVoid);
     $payload = $sdk->getRequestBody();
     $payload->setOrderId($order->getIncrementId())->setRequestId($this->coreHelper->generateRequestId(self::PAYPAL_DOVOID_REQUEST_ID_PREFIX))->setCurrencyCode($order->getOrderCurrencyCode());
     $sdk->setRequestBody($payload);
     $this->logApiCall('do void', $sdk->getRequestBody()->serialize(), 'request');
     $reply = $this->sendRequest($sdk);
     $isVoided = $reply->isSuccess();
     if (!$reply->isSuccess()) {
         $logMessage = 'PayPal DoVoid failed. See exception log for details.';
         $this->logger->warning($logMessage, $this->logContext->getMetaData(__CLASS__));
         $e = Mage::exception('EbayEnterprise_PayPal', $this->helper->__(static::EBAYENTERPRISE_PAYPAL_API_FAILED));
         $this->logger->logException($e, $this->logContext->getMetaData(__CLASS__, [], $e));
         throw $e;
     }
     $this->logApiCall('do void', $reply->serialize(), 'response');
     return ['method' => EbayEnterprise_PayPal_Model_Method_Express::CODE, 'order_id' => $reply->getOrderId(), 'is_voided' => $isVoided];
 }
开发者ID:WinstonN,项目名称:magento-retail-order-management,代码行数:27,代码来源:Api.php


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