Ejemplo n.º 1
0
 public function __construct(\Magento\Customer\Helper\Address $customerAddress, \Psr\Log\LoggerInterface $logger, Logger $customLogger, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Directory\Model\RegionFactory $regionFactory, \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory, ScopeConfigInterface $scopeConfigInterface, \Magento\Paypal\Model\Config $config, \Magento\Tax\Helper\Data $taxData, ObjectManagerInterface $objectManagerInterface, \Magento\Quote\Api\CartManagementInterface $quoteManagement, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Helper\Data $helperData, DateTime $dateTime, ProfileFactory $profileFactory, Registry $registry, $data = [])
 {
     $this->_config = $config;
     $this->_curlFactory = $curlFactory;
     $this->_scopeConfig = $scopeConfigInterface;
     $this->_taxData = $taxData;
     $this->_objectManager = $objectManagerInterface;
     $this->_quoteManagement = $quoteManagement;
     $this->_customerSession = $customerSession;
     $this->_helperData = $helperData;
     $this->_date = $dateTime;
     $this->_profileFactory = $profileFactory;
     $this->_coreRegistry = $registry;
     parent::__construct($customerAddress, $logger, $customLogger, $localeResolver, $regionFactory, $data);
 }
Ejemplo n.º 2
0
 /**
  * NVP doesn't support passing discount total as a separate amount - add it as a line item
  *
  * @param array $request
  * @param int $i
  * @return true|null
  */
 protected function _exportLineItems(array &$request, $i = 0)
 {
     if (!$this->_cart) {
         return;
     }
     $this->_cart->setTransferDiscountAsItem();
     return parent::_exportLineItems($request, $i);
 }
Ejemplo n.º 3
0
 /**
  * Add shipping total as a line item.
  * For some reason PayPal ignores shipping total variables exactly when line items is enabled
  * Note that $i = 1
  *
  * @param array $request
  * @param int $i
  * @return true|null
  */
 protected function _exportLineItems(array &$request, $i = 1)
 {
     if (!$this->_cart) {
         return;
     }
     if ($this->getIsLineItemsEnabled()) {
         $this->_cart->setTransferShippingAsItem();
     }
     return parent::_exportLineItems($request, $i);
 }