关注
Erlo

yansongda 微信支付优化-源码更改

2025-03-13 16:48:18 发布   2 浏览  
页面报错/反馈
收藏 点赞

yansongda 微信支付 源码更改:

优化报错:yansongdapaysrcPluginWechatResponsePlugin.php

    修改:

    $t=$rocket->getDestination()->toArray();
    throw new InvalidResponseException(Exception::RESPONSE_CODE_WRONG, '微信返回状态码异常,请检查参数是否错误'.(isset($t['message'])?$t['message']:''), $rocket->getDestination());

   

转账结果查询:yansongdapaysrcPluginWechatV3MarketingTransferDetailQueryPlugin.php

    修改:

    '_url' => 'v3/fund-app/mch-transfer/transfer-bills/out-bill-no/'.$out_trade_no,

    调用方式

Pay::config(Config('wechat'));
		$result = Pay::wechat()->query([
			'out_trade_no' => $ordernum,
			'_action' => 'transfer'
		]);
        print_R($result->toArray());

转账接口:yansongdapaysrcPluginWechatV3MarketingTransfer

    修改:

'_url' => 'v3/fund-app/mch-transfer/transfer-bills',

    调用方式

Pay::config(Config('wechat'));
		  $rarr = [
			 'appid'=>config('wechat.wechat.default.mini_app_id'),
			 'transfer_amount' => $arr['total'] * 100,
			 'transfer_remark' => '提现',
			 'out_bill_no' => $arr['ordernum'] ,//. time(),
			 'openid' => $arr['openid'],

			 'transfer_scene_id' => '1005',
			 'transfer_scene_report_infos' => [
				[
				    'info_type' => '岗位类型',
				    'info_content' => '销售'
				],
				[
				    'info_type' => '报酬说明',
				    'info_content' => '劳务报酬'
				]
			 ]
		  ];
		  $result = Pay::wechat()->transfer($rarr);
		  if(isset($result['state']) && isset($result['package_info'])){
			 $result['rarr']=[
				'mchId'=>config('wechat.wechat.default.mch_id'),
				'appId'=>config('wechat.wechat.default.mini_app_id'),
				'package'=>$result['package_info']
			 ];
		  }


登录查看全部

参与评论

评论留言

还没有评论留言,赶紧来抢楼吧~~

手机查看

返回顶部

给这篇文章打个标签吧~

棒极了 糟糕透顶 好文章 PHP JAVA JS 小程序 Python SEO MySql 确认