收藏
回答

发起分帐 /v3/profitsharing/orders 严格按照文档组成的参数,但还是报错

"sub_mchid"=>"1601114161",
"appid"=>"wx117a0234324f60c",
"transaction_id"=>"4200002xxxxxx690299587", //微信订单号
"out_order_no"=>"104", //商户分账单号
"receivers"=>[
    [
        "type"=>"PERSONAL_OPENID",  //MERCHANT_ID:商户号  2、PERSONAL_OPENID:个人openid(由父商户APPID转换得到) 3、PERSONAL_SUB_OPENID: 个人sub_openid(由子商户APPID转换得到)
        "account"=>"oGUbk5Xkm91XL_gb-urq8JPrjdr8",
        "amount"=>'1',
        "description"=>"分给oGUbk5Xkm91XL_gb-urq8JPrjdr8"
    ]
],
"unfreeze_unsplit"=>true,


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

4 个回答

  • 北望沣渭
    北望沣渭
    06-24

    see https://wechatpay.im/openapi/v3/profitsharing/orders

    $response = $instance->chain('v3/profitsharing/orders')->post([
      'json' => [
        'sub_mchid'        => '1900000109',
        'appid'            => 'wx8888888888888888',
        'sub_appid'        => 'wx8888888888888889',
        'transaction_id'   => '4208450740201411110007820472',
        'out_order_no'     => 'P20150806125346',
        'receivers'        => [[
          'type'        => 'MERCHANT_ID',
          'account'     => '86693852',
          'name'        => 'hu89ohu89ohu89o',
          'amount'      => 888,
          'description' => '分给商户A',
        ],],
        'unfreeze_unsplit' => true,
      ],
      'headers' => [
        'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
      ],
    ]);
    print_r(json_decode((string) $response->getBody(), true));
    
    06-24
    有用
    回复
  • 都安静点
    都安静点
    06-24

    截全点 看是不是这样写的

    06-24
    有用
    回复
  • 铁锤
    铁锤
    06-23

    Client error: `POST

    https://api.mch.weixin.qq.com/v3/profitsharing/orders` resulted in a

    `400 Bad Request` response:

    {"code":"PARAM_ERROR","detail":{"location":null,"value":"sub_mchid=1601114161&appid=wx117xxxxxe23f60c&transaction_id=42

    (truncated...)


    06-23
    有用
    回复 2
    • Memory
      Memory
      06-23
      400 参数错误,打印完整的报错出来
      06-23
      回复
    • 铁锤
      铁锤
      06-23
      {"code":"PARAM_ERROR",
      "detail":{"location":null,
      "value":"sub_mchid=1601114161&appid=wx117a22342323f60c&transaction_id=4200002670202506196690299587&out_order_no=104&receivers%5B0%5D%5Btype%5D=PERSONAL_OPENID&receivers%5B0%5D%5Baccount%5D=oGUbk5Xkm91XL_gb-urq8JPrjdr8&receivers%5B0%5D%5Bamount%5D=1&receivers%5B0%5D%5Bdescription%5D=%E5%88%86%E7%BB%99oGUbk5Xkm91XL_gb-urq8JPrjdr8&unfreeze_unsplit=0"},
      "message":"解析 Json 出错 (位置: /body): * Line 1, Column 1\n Syntax error: value, object or array expected.\n"}
      06-23
      回复
  • Memory
    Memory
    06-23

    报错什么?话说一半让人猜谜语么

    06-23
    有用
    回复
登录 后发表内容