Exemplo n.º 1
0
 function paypal_ipn($id)
 {
     $order = ORM::factory("bp_order")->where("id", "=", $id)->find();
     if ($order->loaded()) {
         $paypal = new Paypal();
         if ($paypal->validate_ipn($id)) {
             if ($paypal->ipn_data['payment_status'] == "Completed") {
                 $order->status = Bp_Order_Model::PAYMENT_CONFIRMED;
                 bp_order_log::log($order, Bp_Order_Log_Model::ORDERED);
                 // send e-mails to customer and internal order handling
                 basket_plus::send_order($order);
                 $order->save();
             }
             return;
         }
         print "invalid access. tut tut!";
     }
     return;
 }