This commit is contained in:
Hankin 2025-08-13 13:58:48 +08:00
parent 8e054d0b08
commit 1e6efdcd80
2 changed files with 6 additions and 5 deletions

View File

@ -15,12 +15,14 @@ class Controller extends BaseController
public function test()
{
$trade_no = UtilService::getTradeNo();
$trade_no1 = UtilService::getTradeNo();
$trade_no2 = UtilService::getTradeNo();
$scene_id = config("wechatpay.screen.commission");
$openid = "oPC_2vneOWpQbicNZQAUCxuwZ4mw";
$amount = 1;
$remark = "测试";
$res = WechatPayService::transferBatches($trade_no, $scene_id, $openid, $amount, $remark);
$res = WechatPayService::transferBatches($trade_no1, $trade_no2, $openid, $amount, $remark);
dd($res);
}
}

View File

@ -109,20 +109,19 @@ class WechatPayService
* 商家批量转账到零钱
*/
public function transferBatches(string $trade_no, string $scene_id, string $openid, int $amount, string $remark): array
public function transferBatches(string $trade_no, string $trade_no2, string $openid, int $amount, string $remark): array
{
try {
$appid = config("wechat.official_account.default.app_id");
$data = [
"appid" => $appid,
"out_bill_no" => $trade_no,
"transfer_scene_id" => (string) $scene_id,
"batch_name" => $remark,
"batch_remark" => $remark,
"total_amount" => $amount,
"total_num" => 1,
"transfer_detail_list" => [
"out_detail_no" => $trade_no,
"out_detail_no" => $trade_no2,
"transfer_amount" => $amount,
"transfer_remark" => $remark,
"openid" => $openid,