コード例 #1
0
ファイル: Core.php プロジェクト: RyuX51/BABEL95
 public function receiveMessage($message)
 {
     //TODO Hack here! For now we simply echo around
     $sender = new MessageSender(self::APP_KEY, self::APP_SECRET, self::APP_ID);
     $sender->sendMessage($message);
     return $message;
 }
コード例 #2
0
 public function testGenerateMessageVerify()
 {
     $generated = \MessageSender::generateMessageVerify();
     $this->assertEquals(0, $generated % 1.0);
     $this->assertLessThan(1000000, $generated);
     $this->assertGreaterThanOrEqual(0, $generated);
 }
コード例 #3
0
 public function notify(Request $request)
 {
     \Log::debug('payment_notify', ['request' => $request]);
     $input = XML::parse($request->getContent());
     if ($input['return_code'] == 'SUCCESS') {
         $order = Order::where('wx_out_trade_no', $input['out_trade_no'])->firstOrFail();
         $address_id = $order->address_id;
         # 当前订单收货地址id
         if ($order->isPaid()) {
             return 'FAIL';
         }
         $order->update(['wx_transaction_id' => $input['transaction_id'], 'cash_payment' => floatval($input['total_fee']) / 100.0]);
         $order->paid();
         /*  发送消息提醒 */
         $default_address = Address::where(['id' => $address_id])->first();
         $phone = $default_address->phone;
         $msg = '尊敬的顾客您好!您的订单已经收到,易康商城将尽快为您安排发货,如有任何问题可以拨打客服电话400-1199-802进行咨询,感谢您的惠顾!';
         \MessageSender::sendMessage($phone, $msg);
         //            if ($phone = env('ORDER_ADMIN_PHONE')) {
         //                \Log::error($phone);
         //                \MessageSender::sendMessage($phone, $order->toOrderMessageString());
         //            }
         $result = \Wechat::paymentNotify();
         return $result;
     }
     return 'FAIL';
 }
コード例 #4
0
 public function __construct($email, $name)
 {
     if (!$name) {
         $name = strstr($email, '@', true);
     }
     parent::__construct($email, $name);
 }
コード例 #5
0
function sendMessage($commodity_ary, $mobile)
{
    if ($commodity_ary[Config_commodity::course_or_reward] == Commodity_type_Config::course) {
        $content = '尊敬的用户您好,您选中的课程 ' . $commodity_ary[Config_commodity::title] . '客户 ' . $_SESSION['CURRENT_LOGIN_USER'] . ' 已确认。请前往领行客户中心查看详情并于客户联系,开始接受授课';
    } else {
        $content = '尊敬的用户您好,您接单的悬赏 ' . $commodity_ary[Config_commodity::title] . '客户 ' . $_SESSION['CURRENT_LOGIN_USER'] . ' 已确认。请前往领行客户中心查看详情并于客户联系';
    }
    require_once 'class/MessageSender.php';
    MessageSender::send($content, $mobile);
}
コード例 #6
0
function send_msg($commodity_ary)
{
    if ($commodity_ary[Config_commodity::course_or_reward] == Commodity_type_Config::course) {
        $content = '尊敬的用户您好,您发布的课程 ' . $commodity_ary[Config_commodity::title] . '已被客户 ' . $_SESSION['CURRENT_LOGIN_USER'] . '选中。请前往领行客户中心查看详情并于客户联系';
    } else {
        $content = '尊敬的用户您好,您发布的悬赏 ' . $commodity_ary[Config_commodity::title] . '已被客户 ' . $_SESSION['CURRENT_LOGIN_USER'] . '选中。请前往领行客户中心查看详情并于客户联系';
    }
    require_once 'class/MessageSender.php';
    MessageSender::send_by_acceptor_id($content, $commodity_ary[Config_commodity::publisher]);
}
コード例 #7
0
ファイル: MessageSender.php プロジェクト: larryu/magento-b2b
                Dao::beginTransaction();
                EmailSender::sendEmail($message->getFrom(), $message->getTo(), $message->getSubject(), $message->getBody(), $message->getAttachmentAssetIdArray());
                $message->setStatus(Message::STATUS_SENT)->save();
                Dao::commitTransaction();
                self::_logMsg("    SUCCESS sending message(ID=" . $message->getId() . ').', __CLASS__, __FUNCTION__);
            } catch (Exception $ex) {
                Dao::rollbackTransaction();
                $message->setStatus(Message::STATUS_FAILED)->save();
                self::_logMsg("    ERROR sending message(ID=" . $message->getId() . ': ' . $ex->getMessage(), __CLASS__, __FUNCTION__);
                self::_logMsg("    ERROR sending message(ID=" . $message->getId() . ': ' . $ex->getTraceAsString(), __CLASS__, __FUNCTION__);
            }
        }
        $end = new UDate();
        self::_logMsg("== FINISHED: " . count($messages) . " Message(s) == ", __CLASS__, __FUNCTION__);
    }
    private static function _logMsg($msg, $className, $funcName)
    {
        $now = new UDate();
        echo trim($now) . '(UTC)::' . $className . '::' . $funcName . ': ' . $msg . "\n";
        return $now;
    }
    private static function _getAndMarkMessages()
    {
        $randId = StringUtilsAbstract::getRandKey();
        Message::updateByCriteria('transId = ?, status = ?', 'active = 1 and status = ?', array($randId, Message::STATUS_SENDING, Message::STATUS_NEW));
        return Message::getAllByCriteria('transId = ? and status = ?', array($randId, Message::STATUS_SENDING));
    }
}
Core::setUser(UserAccount::get(UserAccount::ID_SYSTEM_ACCOUNT));
MessageSender::run();
コード例 #8
0
<?php

session_start();
include_once "classes/MessageSender.class.php";
echo "<div class=\"modal fade \" id=\"mesaj_yollayici_modal\"  tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"basicModal\" aria-hidden=\"true\" >";
echo "<div class=\"modal-dialog \">";
echo "<div class=\"modal-content\" style=\"background-color:#e6e6e6;\">";
echo "<div  class=\"modal-header\" style=\"background-color:#e6e6e6;border-bottom:1px solid #c7d0d5;\">";
echo "<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>";
echo "<p style=\"color:#ec583a;margin-left:4%;font-size:23px;font-family: Verdana,Geneva,sans-serif;\">";
echo "<img src=\"images/headerfil2.jpg\" style=\"margin-right:2%;max-width:10%;\"/>";
echo "Mesaj yollayıcı ";
echo "</p>";
echo "</div>";
echo "<div class=\"modal-body\" style=\"background-color:#e6e6e6;\">";
$myConversations = new MessageSender(array($_SESSION["user_name"], $_GET["kime"]));
$myConversations->MessageSenderToHTML();
echo "</div>";
echo "</div>";
echo "</div>";
echo " </div>";
?>


コード例 #9
0
ファイル: messagesender.php プロジェクト: necronet/SMSEmpresa
    if ($_GET['company_type'] == 'movistar') {
        $sender = new MovistarMessageSender();
    } else {
        if ($_GET['company_type'] == 'claro') {
            $sender = new ClaroMessageSender();
        }
    }
    foreach ($content as $value) {
        $valueexplode = explode('->', $value);
        if (sizeof($valueexplode) == 2) {
            $phone = $valueexplode[0];
            $message = strlen($valueexplode[1], 0, 160);
            $message = str_replace(array(' ', 'á', 'é', 'í', 'ó', 'ú'), array('%20', 'a', 'e', 'i', 'o', 'u'), $message);
            $data = new stdClass();
            $data->phone = $phone;
            $data->message = $message;
            $response = $_GET['company_type'] == 'movistar' ? new HttpMessage($sender->sendMessage($data->phone, $data->message)) : $sender->sendMessage($data->phone, $data->message);
            if ($response->getBody() == 'OK') {
                $datas[] = $data;
            } else {
                $wrongdatas[] = $data;
            }
        }
    }
    MessageSender::insertMessages($datas, $_GET['company_type']);
    $response->success = true;
    $response->datas = $wrongdatas;
} else {
    $response->success = false;
}
echo json_encode($response);
コード例 #10
0
ファイル: Message.php プロジェクト: jx3030/message
 /**
  *单步执行发送操作
  **/
 private function execSend(MessageSender $sender, $data, $to, array $context = array())
 {
     $sender->send($data, $to, $context);
 }
コード例 #11
0
 public function sms(Request $request)
 {
     $validator = \Validator::make($request->all(), ['phone' => 'required|digits:11|unique:customers,phone']);
     if ($validator->fails()) {
         return response()->json(['success' => false, 'error_message' => $validator->errors()->getMessages()]);
     }
     $phone = $request->input(['phone']);
     $code = \MessageSender::generateMessageVerify();
     \MessageSender::sendMessageVerify($phone, $code);
     $user = \Helper::getUser();
     try {
         $customer = \Helper::getCustomerOrFail();
     } catch (\Exception $e) {
         $customer = Customer::create(['openid' => $user['openid'], 'type_id' => 1, 'phone' => $phone]);
     }
     $customer->update(['auth_code' => $code, 'auth_code_expired' => Carbon::now()->addMinute(AppConstant::AUTH_CODE_EXPIRE_INTERVAL)]);
     return response()->json(['success' => true]);
 }