Skip to content

Commit

Permalink
insert email if missing on order, and exists on sveaorder when we get…
Browse files Browse the repository at this point in the history
… authorization request
  • Loading branch information
iesus committed Dec 21, 2017
1 parent edd4574 commit 1a6900d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ public function acknowledge($quote, $mode, $sveaId)
->setState(Mage_Sales_Model_Order::STATE_NEW, $status, $message, false)
->save();
$magentoOrder->getSendConfirmation(null);

if (empty(trim($magentoOrder->getCustomerEmail())) && !empty($sveaData->getData('EmailAddress'))) {
$magentoOrder->setCustomerEmail($sveaData->getData('EmailAddress'));
}

$magentoOrder->sendNewOrderEmail();

$orderQueueItem = Mage::getModel('sveacheckout/queue')->load($quote->getId(), 'quote_id');
Expand Down Expand Up @@ -116,6 +121,7 @@ public function acknowledge($quote, $mode, $sveaId)

$payment->setAdditionalInformation($info)->save();
$payment->setTransactionId("{$id}-{$type}");
$magentoOrder->save();

$adapter->commit();
$logger->writeToLog('Payment transaction was created for order ' . $magentoOrder->getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ protected function _addAddressToQuote($quote, $data)
$billingAddress = new Varien_Object($data->getData('BillingAddress'));
$shippingAddress = new Varien_Object($data->getData('ShippingAddress'));
$customer = new Varien_Object($data->getData('Customer'));
$reference = ($customer->getData('CustomerReference'))

$reference = ($data->getData('CustomerReference'))
? ($data->getData('CustomerReference'))
: false;
$reference = (!$reference && $customer->getData('CustomerReference'))
? ($customer->getData('CustomerReference'))
: false;
$billingFirstname = ($billingAddress->getData('FirstName'))
Expand Down

0 comments on commit 1a6900d

Please sign in to comment.