This commit is contained in:
2023-03-11 10:11:22 +08:00
parent 02bb102a4d
commit 0f098b1df6
8 changed files with 134 additions and 27 deletions
+34 -16
View File
@@ -88,18 +88,18 @@ class UserController extends AbstractController
$out_trade_no = $this->request->input('out_trade_no');
// $generator = $this->container->get(IdGeneratorInterface::class);
//
$WechatPay = new WechatPay(1);
// $WechatPay = new WechatPay(1);
//
// 获取预支付交易会话标识
$total = 0.01 * 100;
$prepay = $WechatPay->getJsapiPrepayId($out_trade_no,$total,"omgU35DlE-rxTAGgcBjOuc4xdcX8");
if (empty($prepay)){
return fail(HttpEnumCode::SERVER_ERROR, "订单创建失败");
}
// 获取小程序支付配置
$pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
return $this->response->json($pay_config);
// // 获取预支付交易会话标识
// $total = 0.01 * 100;
// $prepay = $WechatPay->getJsapiPrepayId($out_trade_no,$total,"omgU35DlE-rxTAGgcBjOuc4xdcX8");
// if (empty($prepay)){
// return fail(HttpEnumCode::SERVER_ERROR, "订单创建失败");
// }
//
// // 获取小程序支付配置
// $pay_config = $WechatPay->getAppletsPayConfig($prepay['prepay_id']);
// return $this->response->json($pay_config);
// 发起退款
// $WechatPay = new WechatPay(1);
@@ -152,15 +152,16 @@ class UserController extends AbstractController
// 发送消息
// $arg = array();
// $arg['From_Account'] = "10002"; // 发送方user_id 如系统发送,无需填写
// $arg['From_Account'] = "10000"; // 发送方user_id 如系统发送,无需填写
// $arg['To_Account'] = "123456"; // 接收方user_id
// $arg['ForbidCallbackControl'] = ['ForbidBeforeSendMsgCallback'];
// $arg['SendMsgControl'] = [];
//
// $arg['MsgBody'] = [
// [
// "MsgType" => "TIMTextElem",
// "MsgContent" => [
// "Text" => "测试消息33",
// "Text" => "发送11122",
// ],
// ]
// ];
@@ -169,13 +170,14 @@ class UserController extends AbstractController
// $cloud_custom_data = array();
// $cloud_custom_data['order_inquiry_id'] = 491963820554948608;
// $cloud_custom_data['is_system'] = 0;
// $cloud_custom_data['inquiry_type'] = 2;
//
// $arg['CloudCustomData'] = json_encode($cloud_custom_data,JSON_UNESCAPED_UNICODE);
//
// $result = $message->sendMessage($arg);
// $result = $profile->getOneAccountPortraitList("123456");
//
//// $result = $profile->getOneAccountPortraitList("123456");
//
// dump($result);
@@ -193,6 +195,22 @@ class UserController extends AbstractController
// // 发送消息
// $ImService->sendTextMessage($user_doctor['user_id'],"491923510680424449","等待医生接诊",491937904055369728);
//
// $data = array();
// $data['order_inquiry_id'] = 4;
// $data['to_user_id'] = 10004;
// $data['patient_name'] = "用户4";
// $data['patient_sex'] = 2;
// $data['patient_age'] = 19;
// $data['inquiry_status'] = 1;
// $data['message_send_time'] = 1678112190;
// $data['message_seq'] = 101;
// $data['message_type'] = "TIMTextElem";
// $data['last_message_content']['Text'] = "测试消息4";
//
// $imService = new ImService();
// $imService->addRecentContactRecordCache("491925054779883520", 2, 10004, $data);
}
}