收藏
回答

V3分账返回异常,异常信息显示不全?

Client error: `POST https://api.mch.weixin.qq.com/v3/profitsharing/orders` resulted in a `400 Bad Request` response:

{"code":"PARAM_ERROR","detail":{"location":"body","value":{"account":"163xxxxxx","amount":5,"description":"分账商户 (truncated...)

回答关注问题邀请回答
收藏

2 个回答

  • Memory
    Memory
    10-06

    是你打印截断了,而不是返回不完整

    10-06
    有用
    回复
  • Augus
    Augus
    10-05
    public function profit_sharing($transaction_id,$out_trade_no,$account,$total_fee){
        $resp = $this->instance
            ->chain('v3/profitsharing/orders')
            ->post(['json' => [
                'sub_mchid' => $this->config['sp_mchid'],//子商户号
                'appid' => $this->config['wx_small_appid'],//应用ID
                'sub_appid' => $this->config['wx_sub_appid'],//子商户应用ID
                'transaction_id' => $transaction_id,
                'out_order_no' => $out_trade_no,
                'unfreeze_unsplit' => true,
                'receivers' => [
                    'type'=>'MERCHANT_ID',//分账接收方类型,
                    'account'=>$account,//分账接收方账号
                    'amount'=>$total_fee,
                    'description'=>'分账商户'
                ]
            ]]);
        return $resp->getBody();
    
    }
    


    10-05
    有用
    回复
登录 后发表内容