Пример #1
0
 private function Send($to, $arr, $templeteId)
 {
     global $CONFIG;
     logger_mgr::logInfo("ready to send :{$to}");
     if ($CONFIG['solution_configuration'] == "debug") {
         return true;
     }
     //return true;
     $this->resetSDK();
     $result = $this->rest->sendTemplateSMS($to, $arr, $templeteId);
     if ($result->statusCode != 0) {
         $str = "error code :" . $result->statusCode . " ";
         $str .= "error msg :" . $result->statusMsg . " ";
         logger_mgr::logError("sms :{$str}");
         //echo $str;
         //TODO 添加错误处理逻辑
         return false;
     } else {
         $str = "Sendind TemplateSMS success! ";
         // 获取返回信息
         $smsmessage = $result->TemplateSMS;
         $str .= "dateCreated:" . $smsmessage->dateCreated . " ";
         $str .= "smsMessageSid:" . $smsmessage->smsMessageSid . "";
         //TODO 添加成功处理逻辑
         logger_mgr::logDebug("sms :{$str}");
         //echo $str;
         return true;
     }
     return false;
 }
Пример #2
0
 public function submit($info)
 {
     global $CONFIG;
     $sdk = new SDK(OpenSdkConfig::APPID, OpenSdkConfig::KEYSECRET, OpenSdkConfig::SOURCENO);
     $mainParams = array('timestamp' => time() * 1000, 'channel' => 'PC', 'ipAddress' => '', 'sessionId' => '', 'deviceFinger' => '', 'deviceToken' => '', 'longitude' => '', 'latitude' => '');
     $arr = array();
     $arr["urlKey"] = "cash_desk";
     $arr["loginName"] = $info["mobile"];
     $arr["mobile"] = $info["mobile"];
     $arr["outCustomerId"] = $info["mobile"];
     $arr["outTradeNo"] = $info["order_no"];
     $arr["merchantNo"] = OpenSdkConfig::SOURCENO;
     $arr["childMerchantNo"] = OpenSdkConfig::SOURCENO;
     $arr["amount"] = 1;
     //$info["price"];
     $arr["currency"] = "CNY";
     $arr["orderBeginTime"] = date('Y-m-d H:i:s');
     $arr["orderExpireTime"] = date('Y-m-d H:i:s', time() + 3600);
     $arr["orderName"] = $info["order_no"];
     $arr["orderNotifyUrl"] = $CONFIG["xbt"]["notify"];
     $arr["orderFrontNotifyUrl"] = $CONFIG["xbt"]["return"];
     $arr["productNo"] = "DOCREMOTE";
     $arr["productName"] = "远程医疗服务";
     $arr["paySource"] = "ANDROID";
     $call = $sdk->cashDesk($mainParams, $arr);
     //echo $call;
     $json = json_decode($call, true);
     //print_r($json);
     if ($json["code"] == "1") {
         logger_mgr::logInfo("xbt:return={$call}");
         return $json["data"]["resultInfo"]["widgetPageUrl"];
     } else {
         logger_mgr::logError("xbt:return={$call}");
         return "ERROR";
     }
 }
Пример #3
0
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
require '../include/common.inc.php';
include ROOT . '/include/init.inc.php';
require ROOT . '/classes/datamgr/order.cls.php';
require ROOT . '/classes/mgr/gensee.cls.php';
require ROOT . '/classes/mgr/sms.cls.php';
require ROOT . '/classes/paymentmgr/payment.interface.php';
require ROOT . '/classes/paymentmgr/alipay.cls.php';
logger_mgr::logInfo("notify alipay start :" . $_SERVER["REQUEST_URI"]);
logger_mgr::logInfo("notify alipay parameter" . ArrayToString($_REQUEST));
$alipay = new AlipayMgr();
$ret = $alipay->callback();
logger_mgr::logInfo("notify alipay verify return " . ArrayToString($ret));
$order_no = $ret["out_trade_no"];
$trade_no = $ret["trade_no"];
$info = $orderMgr->getOrderByNo($order_no);
$id = $info["id"];
$meeting_time = explode("-", $info["meeting_time"]);
$smarty->assign("info", $info);
if ($ret["result"] != "SUCCESS") {
    $smarty->assign("reason", "付款失败");
    $smarty->assign("reason_message", "请返回支付宝重新付款,谢谢你的支持。");
    $smarty->display(ROOT . '/templates/Order/fail.html');
    exit;
}
if ($info["meeting_id"] == "") {
    $meetingret = $genseeMgr->createMeeting($info["doctor_name"], $info["meeting_date"] . " " . $meeting_time[0], $info["meeting_date"] . " " . $meeting_time[1]);
    $orderMgr->updateMeetingInfo($id, $meetingret);
Пример #4
0
<?php

require '../include/common.inc.php';
require ROOT . '/classes/datamgr/order.cls.php';
require ROOT . '/classes/paymentmgr/xbt.cls.php';
require ROOT . '/classes/datamgr/sms.cls.php';
logger_mgr::logInfo("notify XBT parameter" . ArrayToString($_REQUEST));
if ($_REQUEST["tradeStatus"] == "SUCCESS") {
    $info = $orderMgr->getOrderByOrderNo($_REQUEST["outTradeNo"]);
    $orderMgr->updateOrderPayment($info["id"], "XBT", $_REQUEST["trade_no"]);
    $smsMgr->SendQueryConfirm($info["mobile"], $info["tag_name"], $info["order_date"] . " " . $info["order_time"]);
}