修正easywechtrequest类
This commit is contained in:
@@ -20,7 +20,6 @@ class CallBackController extends AbstractController
|
||||
*/
|
||||
public function patientWxPayCallBack(): ResponseInterface
|
||||
{
|
||||
dump(111);
|
||||
try {
|
||||
// 处理支付结果事件
|
||||
$WechatPay = new WechatPay(1);
|
||||
|
||||
@@ -70,13 +70,14 @@ class UserController extends AbstractController
|
||||
|
||||
// 支付测试
|
||||
public function testpay(){
|
||||
$out_trade_no = $this->request->input('out_trade_no');
|
||||
$generator = $this->container->get(IdGeneratorInterface::class);
|
||||
|
||||
$WechatPay = new WechatPay(2);
|
||||
|
||||
// 获取预支付交易会话标识
|
||||
$total = 0.01 * 100;
|
||||
$prepay = $WechatPay->getJsapiPrepayId("123468",$total,"o9gYG441zEAHuYoNX7lwFKiQBzKE");
|
||||
$prepay = $WechatPay->getJsapiPrepayId($out_trade_no,$total,"o9gYG441zEAHuYoNX7lwFKiQBzKE");
|
||||
if (empty($prepay)){
|
||||
return fail(HttpEnumCode::SERVER_ERROR, "订单创建失败");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user