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


PHP EbayEnterprise_MageLog_Helper_Context类代码示例

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


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

示例1: setUp

 public function setUp()
 {
     parent::setUp();
     $this->logger = $this->getHelperMockBuilder('ebayenterprise_magelog/data')->disableOriginalConstructor()->getMock();
     $this->logContext = $this->getHelperMockBuilder('ebayenterprise_magelog/context')->disableOriginalConstructor()->getMock();
     $this->logContext->expects($this->any())->method('getMetaData')->will($this->returnValue([]));
 }
开发者ID:WinstonN,项目名称:magento-retail-order-management,代码行数:7,代码来源:AllocationTest.php

示例2: _extractTaxData

 /**
  * Extract tax data from the tax response payload and store tax records,
  * duties and fees.
  *
  * Extracts all three sets of tax data as each set of data can be retrieved
  * from the same address parser. Extracting all three sets at once prevents
  * nearly identical steps from being repeated for each ship group for each
  * type of tax data.
  *
  * @return self
  */
 protected function _extractTaxData()
 {
     // Each of these will hold an array of arrays of data extracted from each
     // ship group - e.g. $taxRecords = [[$recordA, $recordB], [$recordC, $recordD]].
     $taxRecords = [];
     $duties = [];
     $fees = [];
     foreach ($this->_taxResponse->getShipGroups() as $shipGroup) {
         $address = $this->_getQuoteAddressForShipGroup($shipGroup);
         if ($address) {
             $addressParser = $this->_taxFactory->createResponseAddressParser($shipGroup, $address);
             $taxRecords[] = $addressParser->getTaxRecords();
             $duties[] = $addressParser->getTaxDuties();
             $fees[] = $addressParser->getTaxFees();
         } else {
             $this->_logger->warn('Tax response ship group does not relate to any known address.', $this->_logContext->getMetaData(__CLASS__, ['rom_response_body' => $shipGroup->serialize()]));
         }
     }
     // Flatten each nested array of tax data - allows for a single array_merge
     // instead of iteratively calling array_merge on each pass when extracting
     // tax data for each ship group.
     $this->_taxRecords = $this->_flattenArray($taxRecords);
     $this->_taxDuties = $this->_flattenArray($duties);
     $this->_taxFees = $this->_flattenArray($fees);
     return $this;
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:37,代码来源:Quote.php

示例3: copyShipFromAddressTo

 protected function copyShipFromAddressTo(Mage_Customer_Model_Address_Abstract $address, EbayEnterprise_Inventory_Model_Details_Item $detail)
 {
     if ($detail->isAvailable()) {
         $meta = ['sku' => $detail->getSku(), 'item_id' => $detail->getItemId()];
         $this->logger->debug('applying details for item "{sku}" [{item_id}]', $this->logContext->getMetaData(__CLASS__, $meta));
         $address->addData($this->exportShipFromAddress($detail));
     }
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:8,代码来源:Origin.php

示例4: handleBeforeCollectTotals

 /**
  * Before collecting item totals, check that all items
  * in the quote are available to be fulfilled.
  *
  * @param Varien_Event_Observer
  * @return self
  */
 public function handleBeforeCollectTotals(Varien_Event_Observer $observer)
 {
     try {
         $quote = $observer->getEvent()->getQuote();
         $this->quantityService->checkQuoteInventory($quote);
     } catch (EbayEnterprise_Inventory_Exception_Quantity_Collector_Exception $e) {
         $this->logger->warning($e->getMessage(), $this->logContext->getMetaData(__CLASS__, [], $e));
     }
     return $this;
 }
开发者ID:WinstonN,项目名称:magento-retail-order-management,代码行数:17,代码来源:Observer.php

示例5: lookupTenderType

 /**
  * Lookup the tender type for given gift card.
  * @param string
  * @param string
  * @param bool
  * @return string
  * @throws EbayEnterprise_GiftCard_Exception_InvalidCardNumber_Exception If card number cannot be retrieved.
  */
 public function lookupTenderType($cardNumber, $currencyCode, $panIsToken = false)
 {
     try {
         $api = $this->getTenderTypeLookupApi();
         return $this->createTenderTypeLookup($cardNumber, $currencyCode, $api, $panIsToken)->getTenderType();
     } catch (EbayEnterprise_GiftCard_Exception_TenderTypeLookupFailed_Exception $e) {
         $this->logger->error('Unable to lookup tender type', $this->logContext->getMetaData(__CLASS__, [], $e));
         throw Mage::exception('EbayEnterprise_GiftCard_Exception_InvalidCardNumber', $this->helper->__(self::INVLIAD_CARD_NUMBER_MESSAGE, $cardNumber));
     }
 }
开发者ID:adderall,项目名称:magento-retail-order-management,代码行数:18,代码来源:Tendertype.php

示例6: testGetMetaData

 /**
  * @param  string $className
  * @param  array $data
  * @param  Exception $e
  * @param  string $case the test case
  * @dataProvider providerGetMetaData
  * @loadFixture
  */
 public function testGetMetaData($className, $data, $exception, $case)
 {
     $context = $this->_context->getMetaData($className, $data, $exception);
     if (!$exception) {
         $this->assertSame($this->expected($case)->getData(), $context);
     } else {
         $this->assertArrayHasKey('exception_class', $context);
         $this->assertArrayHasKey('exception_message', $context);
         $this->assertArrayHasKey('exception_stacktrace', $context);
     }
 }
开发者ID:kojiromike,项目名称:magento-log,代码行数:19,代码来源:ContextTest.php

示例7: setUp

 public function setUp()
 {
     $this->helper = $this->getHelperMock('ebayenterprise_giftcard/data', ['__', 'getConfigData']);
     $this->coreHelper = $this->getHelperMock('eb2ccore/data', ['getSdkApi']);
     $this->logger = $this->getHelperMock('ebayenterprise_magelog/data');
     $this->logContext = $this->getHelperMock('ebayenterprise_magelog/context');
     $this->logContext->expects($this->any())->method('getMetaData')->will($this->returnValue([]));
     $this->apiLogger = $this->getMock('\\Psr\\Log\\NullLogger');
     $this->config = $this->buildCoreConfigRegistry(['apiService' => 'payments', 'apiOperationTenderTypeLookup' => 'tendertype/lookup']);
     $this->constructorArgs = ['core_helper' => $this->coreHelper, 'helper' => $this->helper, 'logger' => $this->logger, 'log_context' => $this->logContext, 'api_logger' => $this->apiLogger, 'config' => $this->config];
 }
开发者ID:adderall,项目名称:magento-retail-order-management,代码行数:11,代码来源:TendertypeTest.php

示例8: makeRequest

 /**
  * Make a request to the token validation service using the token set in
  * "magic" data. Should return the response message from the service.
  * @return string
  */
 public function makeRequest()
 {
     // if there's no token, don't attempt to validate it
     if (!$this->getToken()) {
         $logMessage = 'No token to make request for';
         $this->_logger->info($logMessage, $this->_context->getMetaData(__CLASS__));
         return '';
     }
     $response = Mage::getModel('eb2ccore/api')->setStatusHandlerPath(static::API_STATUS_HANDLER)->request($this->_buildRequest(), Mage::helper('eb2ccsr')->getConfigModel()->xsdFileTokenValidation, $this->_getApiUri());
     return $response;
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:16,代码来源:Request.php

示例9: __construct

 /**
  * @link http://www.php.net/manual/en/class.exception.php
  */
 public function __construct($message = "", $code = 0, Exception $previous = null)
 {
     $this->_logger = Mage::helper('ebayenterprise_magelog');
     $this->_context = Mage::helper('ebayenterprise_magelog/context');
     /**
      * @note This runs counter to our styleguide because it is
      * itself an exception. Furthermore we want to be both
      * inescapable and verbose with critical exceptions.
      */
     $this->_logger->critical($message, $this->_context->getMetaData(__CLASS__, [], $previous));
     parent::__construct($message, $code, $previous);
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:15,代码来源:Critical.php

示例10: getMethodSdkId

 /**
  * get the ROM identifier for the given magento shipping method code
  * return null if $shippingMethod evaluates to false
  *
  * @param string
  * @return string|null
  */
 public function getMethodSdkId($shippingMethod)
 {
     $this->fetchAvailableShippingMethods();
     if (!$shippingMethod) {
         return '';
     }
     if (!isset($this->methods[$shippingMethod]['sdk_id'])) {
         $this->logger->error('Unable to get the SDK identifier for shipping method {shipping_method}', $this->logContext->getMetaData(__CLASS__, ['shipping_method' => $shippingMethod]));
         throw Mage::exception('EbayEnterprise_Eb2cCore', 'Unable to find a valid shipping method');
     }
     return $this->methods[$shippingMethod]['sdk_id'];
 }
开发者ID:WinstonN,项目名称:magento-retail-order-management,代码行数:19,代码来源:Shipping.php

示例11: setUp

 public function setUp()
 {
     parent::setUp();
     $this->logger = $this->getHelperMockBuilder('ebayenterprise_magelog/data')->disableOriginalConstructor()->getMock();
     $this->logContext = $this->getHelperMockBuilder('ebayenterprise_magelog/context')->disableOriginalConstructor()->getMock();
     $this->logContext->expects($this->any())->method('getMetaData')->will($this->returnValue([]));
     $this->request = $this->getMockForAbstractClass('\\eBayEnterprise\\RetailOrderManagement\\Payload\\Inventory\\IAllocationRollbackRequest');
     $this->reply = $this->getMockForAbstractClass('\\eBayEnterprise\\RetailOrderManagement\\Payload\\Inventory\\IAllocationRollbackReply');
     $this->httpApi = $this->getMockBuilder('\\eBayEnterprise\\RetailOrderManagement\\Api\\IBidirectionalApi')->disableOriginalConstructor()->setMethods(['send', 'getRequestBody', 'getResponseBody', 'setRequestBody'])->getMock();
     $this->httpApi->expects($this->any())->method('setRequestBody')->with($this->isInstanceOf('\\eBayEnterprise\\RetailOrderManagement\\Payload\\Inventory\\IAllocationRollbackRequest'))->will($this->returnSelf());
     $this->httpApi->expects($this->any())->method('getRequestBody')->will($this->returnValue($this->request));
     $this->httpApi->expects($this->any())->method('getResponseBody')->will($this->returnValue($this->reply));
 }
开发者ID:WinstonN,项目名称:magento-retail-order-management,代码行数:13,代码来源:ServiceTest.php

示例12: _buildBatches

 /**
  * Build the given batches into feed files.
  * @param  array of EbayEnterprise_Catalog_Model_Pim_Batch $batches
  * @return self
  */
 protected function _buildBatches(array $batches)
 {
     try {
         foreach ($batches as $batch) {
             Mage::getModel('ebayenterprise_catalog/pim', array('batch' => $batch))->buildFeed();
         }
         $this->_updateCutoffDate();
     } catch (EbayEnterprise_Eb2cCore_Exception_InvalidXml $e) {
         $logMessage = 'Error building export feeds';
         $this->_logger->critical($logMessage, $this->_context->getMetaData(__CLASS__, [], $e));
     }
     return $this;
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:18,代码来源:Exporter.php

示例13: setUp

 public function setUp()
 {
     parent::setUp();
     // Prevent log context from needing session while gather context data for logging.
     $this->logContext = $this->getHelperMock('ebayenterprise_magelog/context', ['getMetaData']);
     $this->logContext->method('getMetaData')->will($this->returnValue([]));
     $this->api = $this->getMock('\\eBayEnterprise\\RetailOrderManagement\\Api\\IBidirectionalApi');
     $this->configModel = $this->buildCoreConfigRegistry(['apiService' => 'inventory', 'apiOperation' => 'allocate']);
     $this->helper = $this->getHelperMock('ebayenterprise_inventory');
     $this->helper->method('getConfigModel')->will($this->returnValue($this->configModel));
     $this->coreHelper = $this->getHelperMock('eb2ccore', ['getSdkApi']);
     $this->coreHelper->method('getSdkApi')->will($this->returnValue($this->api));
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:13,代码来源:DeallocatorTest.php

示例14: void

 /**
  * @param Mage_Sales_Model_Order
  * @return self
  */
 public function void(Mage_Sales_Model_Order $order)
 {
     if ($this->_canVoid($order)) {
         try {
             $this->_getVoidApi()->doVoidOrder($order);
         } catch (EbayEnterprise_PayPal_Exception $e) {
             $logMessage = 'Void request failed. See exception log for details.';
             $this->_logger->warning($logMessage, $this->_context->getMetaData(__CLASS__));
             $this->_logger->logException($e, $this->_context->getMetaData(__CLASS__, [], $e));
         }
     }
     return $this;
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:17,代码来源:Void.php

示例15: _getLastTimestamp

 /**
  * Get the last timestamp captured from a test message and return a new DateTime
  * object for the timestamp. If no last test message exists or is not a parseable
  * date time, will return null.
  * @return DateTime|null
  */
 protected function _getLastTimestamp()
 {
     $lastTimestamp = $this->getValue();
     $timestamp = null;
     try {
         // If the value isn't set, don't create a new DateTime. new DateTime(null)
         // gives a DateTime for the current time, which is not desirable here.
         $timestamp = $lastTimestamp ? $this->_coreHelper->getNewDateTime($lastTimestamp) : null;
     } catch (Exception $e) {
         $logData = ['last_timestamp' => $lastTimestamp];
         $logMessage = 'Invalid timestamp for last AMQP test message timestamp: {last_timestamp}.';
         $this->_logger->warning($logMessage, $this->_context->getMetaData(__CLASS__, $logData, $e));
     }
     return $timestamp;
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:21,代码来源:Lasttestmessage.php


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