I am beginner to magento & trying to develop a module for sending message when any order placed, with this module i am able to generate(send/recive) message but check out page not redirect to success page
etc/config.php
<?xml version="1.0"?>
<config>
<modules>
<Abc_Sms>
<version>0.0.1</version>
</Abc_Sms>
</modules>
<global>
<models>
<abc_sms>
<class>Abc_Sms_Model</class>
</abc_sms>
</models>
<events>
<sales_order_place_before><!-- observe the event -->
<observers>
<abc_sms>
<class>abc_sms/observer</class>
<method>newCheckout</method>
</abc_sms>
</observers>
</sales_order_place_before>
</events>
</global>
</config>
Model/Oberver.php
<?php
class Abc_Sms_Model_Observer
{
public function newCheckout($observer)
{
$order_id = $observer->getEvent()->getOrder()->getId();
$order_no = $observer->getEvent()->getOrder()->getIncrementId();
$order = Mage::getModel("sales/order")->load($order_id);
$billing_address = $order->getBillingAddress();
$billing_telephone = $billing_address->getTelephone();
$msg = "Thank you for your purchase! Your order # is: ".$order_no;
//sms api start
$ch = curl_init();
$user="****@gmail.com:****";
$receipientno = $billing_telephone;
$senderID="TEST SMS";
$msgtxt = $msg;
curl_setopt($ch,CURLOPT_URL, "http://api.mVaayoo.com/mvaayooapi/MessageCompose");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "user=$user&senderID=$senderID&receipientno=$receipientno&msgtxt=$msgtxt");
$buffer = curl_exec($ch);
if (empty ($buffer)) {
echo " buffer is empty ";
} else {
echo $buffer;
}
curl_close($ch);
//sms api
}
}
?>
Thanks in Advance for help