/** * Get ipn data, send verification to PayPal, run corresponding handler. Override * to allow handling of mc_cancel transactions which don't have an order increment * id attached. * * @param array $request * @param Zend_Http_Client_Adapter_Interface $httpAdapter * @throws Exception */ public function processIpnRequest(array $request, Zend_Http_Client_Adapter_Interface $httpAdapter = null) { $this->_request = $request; $this->_debugData = array('ipn' => $request); ksort($this->_debugData['ipn']); if (isset($this->_request['txn_type']) && 'mp_cancel' == $this->_request['txn_type']) { $this->_registerMpCancel(); } else { parent::processIpnRequest($request, $httpAdapter); } }
/** * Test processIpnRequest() currency check for recurring profile * * @param string $currencyCode * @dataProvider currencyProvider * @magentoDataFixture Mage/Paypal/_files/recurring_profile.php * @magentoConfigFixture current_store payment/paypal_direct/active 1 * @magentoConfigFixture current_store payment/paypal_express/active 1 * @magentoConfigFixture current_store paypal/general/merchant_country US * @magentoConfigFixture current_store sales_email/order/enabled 0 */ public function testProcessIpnRequestRecurringCurrency($currencyCode) { $ipnData = (require __DIR__ . '/../_files/ipn_recurring_profile.php'); $ipnData['mc_currency'] = $currencyCode; $this->_model->processIpnRequest($ipnData, $this->_createMockedHttpAdapter()); $recurringProfile = Mage::getModel('Mage_Sales_Model_Recurring_Profile'); $recurringProfile->loadByInternalReferenceId('5-33949e201adc4b03fbbceafccba893ce'); $orderIds = $recurringProfile->getChildOrderIds(); $this->assertEquals(1, count($orderIds)); $order = Mage::getModel('Mage_Sales_Model_Order'); $order->load($orderIds[0]); $this->_assertOrder($order, $currencyCode); }