Exemplo n.º 1
0
 public function run()
 {
     $order = Wekit::load('pay.PwOrder')->getOrderByOrderNo($this->_var['invoice']);
     if (empty($order)) {
         $this->paymsg('onlinepay.order.exists.not');
     }
     $fee = $order['number'] * $order['price'];
     if ($fee != $this->_var['mc_gross']) {
         $this->paymsg('onlinepay.fail');
     }
     if ($this->_var['payment_status'] != 'Completed') {
         $this->paymsg('onlinepay.success');
     }
     if ($order['state'] == 2) {
         $this->paymsg('onlinepay.order.paid');
     }
     $className = Wind::import('SRV:pay.srv.action.PwPayAction' . $order['paytype']);
     if (class_exists($className)) {
         $class = new $className($order);
         $class->run();
     }
     Wind::import('SRV:pay.dm.PwOrderDm');
     $dm = new PwOrderDm($order['id']);
     $dm->setState(2)->setPaymethod(3);
     Wekit::load('pay.PwOrder')->updateOrder($dm);
     $this->paymsg('onlinepay.success');
 }
Exemplo n.º 2
0
 public function run()
 {
     $order = Wekit::load('pay.PwOrder')->getOrderByOrderNo($this->_var['transaction_id']);
     if (empty($order)) {
         $this->paymsg('onlinepay.order.exists.not');
     }
     if ($order['state'] == 2) {
         $this->paymsg('onlinepay.order.paid');
     }
     $className = Wind::import('SRV:pay.srv.action.PwPayAction' . $order['paytype']);
     if (class_exists($className)) {
         $class = new $className($order);
         $class->run();
     }
     Wind::import('SRV:pay.dm.PwOrderDm');
     $dm = new PwOrderDm($order['id']);
     $dm->setState(2)->setPaymethod(2);
     Wekit::load('pay.PwOrder')->updateOrder($dm);
     $this->paymsg('onlinepay.success');
 }