Payone and no order confirmation email

Welcome! You have the problem, that Payone is not sending order confirmation emails in Magento 1? And we are talking about a local development system, were Payone is not able to deliver the Instant Payment Notification (IPN - or whatever it is called at Payone)?

Then I can tell you: This is correct. And I have no clue to fix it.

But why?

Magento only sends an order confirmation email if:

\Mage_Checkout_Model_Type_Onepage::saveOrder
[...]
if (!$redirectUrl && $order->getCanSendNewEmailFlag()) {
    try {
        $order->queueNewOrderEmail();
    } catch (Exception $e) {
        Mage::logException($e);
    }
}
[...]

Payone is setting can_send_new_email_flag explicitly to false in \Payone_Core_Model_Payment_Method_Abstract::initialize, to take control of the email.

$order->setCanSendNewEmailFlag(false);

And when the order is appointed, the email is send:

\Payone_Core_Model_Observer_TransactionStatus_OrderConfirmation::onAppointed
public function onAppointed(Varien_Event_Observer $observer)
{
    $this->initData($observer);

    $this->getServiceOrderConfirmation()->sendMail($this->order);
}

And this method is called via observer:

<config>
    <global>
        <events>
             <payone_core_transactionstatus_appointed>
                <observers>
                    <payone_core_observer_orderConfirmation>
                        <type>singleton</type>
                        <class>payone_core/observer_transactionStatus_orderConfirmation</class>
                        <method>onAppointed</method>
                    </payone_core_observer_orderConfirmation>
            </payone_core_transactionstatus_appointed>
        </events>
    </global>
</config>

I hope this helps.