1
This commit is contained in:
@@ -82,21 +82,21 @@ class UserController extends AbstractController
|
||||
// 支付测试
|
||||
public function testpay(){
|
||||
// 发起支付
|
||||
// $out_trade_no = $this->request->input('out_trade_no');
|
||||
$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);
|
||||
@@ -148,32 +148,32 @@ class UserController extends AbstractController
|
||||
// $result = $friend->addFriend("123456",'1234567',"快速问诊");
|
||||
|
||||
// 发送消息
|
||||
$arg = array();
|
||||
$arg['From_Account'] = "10002"; // 发送方user_id 如系统发送,无需填写
|
||||
$arg['To_Account'] = "123456"; // 接收方user_id
|
||||
$arg['ForbidCallbackControl'] = ['ForbidBeforeSendMsgCallback'];
|
||||
|
||||
$arg['MsgBody'] = [
|
||||
[
|
||||
"MsgType" => "TIMTextElem",
|
||||
"MsgContent" => [
|
||||
"Text" => "测试消息33",
|
||||
],
|
||||
]
|
||||
];
|
||||
|
||||
// 自定义消息
|
||||
$cloud_custom_data = array();
|
||||
$cloud_custom_data['order_inquiry_id'] = 491963820554948608;
|
||||
$cloud_custom_data['is_system'] = 0;
|
||||
|
||||
$arg['CloudCustomData'] = json_encode($cloud_custom_data,JSON_UNESCAPED_UNICODE);
|
||||
|
||||
$result = $message->sendMessage($arg);
|
||||
// $arg = array();
|
||||
// $arg['From_Account'] = "10002"; // 发送方user_id 如系统发送,无需填写
|
||||
// $arg['To_Account'] = "123456"; // 接收方user_id
|
||||
// $arg['ForbidCallbackControl'] = ['ForbidBeforeSendMsgCallback'];
|
||||
//
|
||||
// $arg['MsgBody'] = [
|
||||
// [
|
||||
// "MsgType" => "TIMTextElem",
|
||||
// "MsgContent" => [
|
||||
// "Text" => "测试消息33",
|
||||
// ],
|
||||
// ]
|
||||
// ];
|
||||
//
|
||||
// // 自定义消息
|
||||
// $cloud_custom_data = array();
|
||||
// $cloud_custom_data['order_inquiry_id'] = 491963820554948608;
|
||||
// $cloud_custom_data['is_system'] = 0;
|
||||
//
|
||||
// $arg['CloudCustomData'] = json_encode($cloud_custom_data,JSON_UNESCAPED_UNICODE);
|
||||
//
|
||||
// $result = $message->sendMessage($arg);
|
||||
|
||||
// $result = $profile->getOneAccountPortraitList("123456");
|
||||
|
||||
dump($result);
|
||||
// dump($result);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user