Coder Social home page Coder Social logo

Comments (3)

overtrue avatar overtrue commented on July 19, 2024

你可以按我的修改先试一下(在vendor目录下直接改)给我回复,谢谢!

http://easywechat.org/docs/zh-cn/payment.html#u4E0B_u8F7D_u5BF9_u8D26_u5355

from laravel-wechat.

nanhuazhenren avatar nanhuazhenren commented on July 19, 2024

下面分割线后是微信官方文档标注,返回格式为文本,不是csv格式,

之前是用2.0版本api时候我是直接
$url = self::API_SEND;
$response = $http->request($url, Http::POST, $request);
if (empty($response)) {
throw new Exception('get Bill list failed.');
}
return $response;

然后在人为是分割这个字符串
$result=explode("\n",$result);

        for($i=1;$i<count($result)-3;$i++)
        {
            $line=(explode(",",$result[$i]));   
                   }

成功时,数据以文本表格的方式返回,第一行为表头,后面各行为对应的字段内容,字段内容跟查询订单或退款结果一致,具体字段说明可查阅相应接口。

第一行为表头,根据请求下载的对账单类型不同而不同(由bill_type决定),目前有:
当日所有订单

交易时间,公众账号ID,商户号,子商户号,设备号,微信订单号,商户订单号,用户标识,交易类型,交易状态,付款银行,货币种类,总金额,代金券或立减优惠金额,微信退款单号,商户退款单号,退款金额,代金券或立减优惠退款金额,退款类型,退款状态,商品名称,商户数据包,手续费,费率
当日成功支付的订单

交易时间,公众账号ID,商户号,子商户号,设备号,微信订单号,商户订单号,用户标识,交易类型,交易状态,付款银行,货币种类,总金额,代金券或立减优惠金额,商品名称,商户数据包,手续费,费率
当日退款的订单

交易时间,公众账号ID,商户号,子商户号,设备号,微信订单号,商户订单号,用户标识,交易类型,交易状态,付款银行,货币种类,总金额,代金券或立减优惠金额,退款申请时间,退款成功时间,微信退款单号,商户退款单号,退款金额,代金券或立减优惠退款金额,退款类型,退款状态,商品名称,商户数据包,手续费,费率

从第二行起,为数据记录,各参数以逗号分隔,参数前增加`符号,为标准键盘1左边键的字符,字段顺序与表头一致。

倒数第二行为订单统计标题,最后一行为统计数据

总交易单数,总交易额,总退款金额,总代金券或立减优惠退款金额,手续费总金额

举例如下:

交易时间,公众账号ID,商户号,子商户号,设备号,微信订单号,商户订单号,用户标识,交易类型,交易状态,付款银行,货币种类,总金额,代金券或立减优惠金额,微信退款单号,商户退款单号,退款金额,代金券或立减优惠退款金额,退款类型,退款状态,商品名称,商户数据包,手续费,费率
2014-11-1016:33:45,wx2421b1c4370ec43b,10000100,0,1000,1001690740201411100005734289,1415640626,085e9858e3ba5186aafcbaed1,MICROPAY,SUCCESS,CFT,CNY,0.01,0.0,0,0,0,0,,,被扫支付测试,订单额外描述,0,0.60%
2014-11-1016:46:14,wx2421b1c4370ec43b,10000100,0,1000,1002780740201411100005729794,1415635270,085e9858e90ca40c0b5aee463,MICROPAY,SUCCESS,CFT,CNY,0.01,0.0,0,0,0,0,,,被扫支付测试,订单额外描述,0,0.60%
总交易单数,总交易额,总退款金额,总代金券或立减优惠退款金额,手续费总金额
2,0.02,0.0,0.0,`0

from laravel-wechat.

overtrue avatar overtrue commented on July 19, 2024

@cnvcanson 你直接存为文就知道了,这就是csv格式:

$bill = $payment->downloadBill('20140603'); // type: ALL

// 保存为文件
file_put_contents('YOUR/PATH/TO/bill-20140603.csv', $bill);

然后用 excel 打开就知道了。

from laravel-wechat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.