/** * unconfirmed transaction * * @param SofortLib_TransactionData $transData * @param Mage_Sales_Model_Order $order * @param boolean $forceUpdate = false to gerate update * @return void */ private function _transactionUnconfirmed($transData, $order, $forceUpdate = false) { $payment = $order->getPayment(); $transaction = $transData->getTransaction(); $statusReason = $transData->getStatusReason(); // rechnung if ($transData->isSofortrechnung() && ($statusReason == 'confirm_invoice' || $forceUpdate)) { $order->setState('sofort'); //customer may have changed the address during payment process $address = $transData->getInvoiceAddress(); $order->getBillingAddress()->setStreet($address['street'] . ' ' . $address['street_number'])->setFirstname($address['firstname'])->setLastname($address['lastname'])->setCompany($address['company'])->setPostcode($address['zipcode'])->setCity($address['city'])->setCountryId($address['country_code']); $address = $transData->getShippingAddress(); $order->getShippingAddress()->setStreet($address['street'] . ' ' . $address['street_number'])->setFirstname($address['firstname'])->setLastname($address['lastname'])->setCompany($address['company'])->setPostcode($address['zipcode'])->setCity($address['city'])->setCountryId($address['country_code']); $order->save(); $waitingStatus = Mage::getStoreConfig('payment/sofort/sofortrechnung_order_status_waiting'); if ($waitingStatus == 'unchanged') { $order->addStatusHistoryComment(Mage::helper('pnsofortueberweisung')->__('Payment successfull. Invoice needs to be confirmed.', $transaction))->setIsCustomerNotified(true); } else { $order->addStatusHistoryComment(Mage::helper('pnsofortueberweisung')->__('Payment successfull. Invoice needs to be confirmed.', $transaction), $waitingStatus)->setIsCustomerNotified(true); } $order->setIsVisibleOnFront(true); if (!$order->getEmailSent()) { $order->setEmailSent(true); $order->save(); $order->sendNewOrderEmail(); } } else { // mark for notify $order->setState('sofort'); } $order->save(); }