コード例 #1
0
 /**
  * Checking negative line items
  *
  * @param array $request
  * @param int $i
  * @return null|true
  */
 protected function _exportLineItems(array &$request, $i = 0)
 {
     $requestBefore = $request;
     $result = parent::_exportLineItems($request, $i);
     if ($this->getIsLineItemsEnabled() && $this->_cart->hasNegativeItemAmount()) {
         $this->_lineItemTotalExportMap = array(Mage_Paypal_Model_Cart::TOTAL_TAX => 'TAXAMT', Mage_Paypal_Model_Cart::TOTAL_SHIPPING => 'FREIGHTAMT', 'amount' => 'PAYMENTREQUEST_0_ITEMAMT');
         $this->_lineItemExportItemsFormat = array('name' => 'L_PAYMENTREQUEST_0_NAME%d', 'qty' => 'L_PAYMENTREQUEST_0_QTY%d', 'amount' => 'L_PAYMENTREQUEST_0_AMT%d');
         $request = $requestBefore;
         $result = parent::_exportLineItems($request, $i);
         $paypalNvp = new Mage_Paypal_Model_Api_Nvp();
         $this->_doCaptureResponse = $paypalNvp->_doCaptureResponse;
         $this->_refundTransactionResponse = $paypalNvp->_refundTransactionResponse;
         $this->_getTransactionDetailsResponse = $paypalNvp->_getTransactionDetailsResponse;
         $this->_paymentInformationResponse = $paypalNvp->_paymentInformationResponse;
         $this->_headers[] = 'PAYPAL-NVP: Y';
         $this->_setSpecificForNegativeLineItems();
     }
     return $result;
 }