我在为一个中国项目工作。我想在中国大陆从weChat pay收取付款。我已经使用Omnipay-weChatPay创建了订单详细信息,以便传递到移动应用程序中,以便打开安装在客户手机中的WeChatPay应用程序。我不能理解我可以从哪里获得这些详细信息(AppId,MchId,API键),因为我使用的详细信息没有创建任何问题,它说200 Ok,但没有从我的订单从weChat服务器返回的数据。我需要帮助。我将附上我的后端代码和代码的图像以及。Click to see image of code
$userip = $_SERVER['REMOTE_ADDR'];
$gateway = Omnipay::create('WechatPay_App');
$gateway->setAppId('wx990************');
$gateway->setMchId('16********');
$gateway->setApiKey('b93072*********************');
$order = [
'body' => 'The test order no 123',
'out_trade_no' => date('YmdHis').mt_rand(1000, 9999),
'total_fee' => 200, //=0.01
'spbill_create_ip' => $userip,
'fee_type' => 'CNY',
'notify_url' => "https://massagetohome.pigslhub.com/notify"
];
$request = $gateway->purchase($order);
$response = $request->send();
//available methods
$response->isSuccessful();
return response()->json(['payment' => $response->getAppOrderData()]);发布于 2021-10-21 08:58:28
AppId:
1.注册开放平台帐号。https://open.weixin.qq.com/
2.让authentication.To提交您的公司信息。
3.添加手机application.After,即可获得您网站应用的appid和密钥。
MchId,API密钥:
1.注册微信的账户- payment,这是你的支付账户。https://pay.weixin.qq.com/
2.进行身份验证。
3.将您的移动应用程序集成到您的微信支付帐户。你可以在右上角看到"MchId“。
4.通过微信支付认证后,即可配置您的开发信息,绑定您的普通设备,提交接口密钥后,logining.You必须下载cert.zip。
https://stackoverflow.com/questions/69194522
复制相似问题