Skip to content

Commit

Permalink
[fix] 修复微信支付新增交易类型「其他」无法识别的问题. (#115)
Browse files Browse the repository at this point in the history
* 优化ledger 日期格式

* wechat provider 增加“其他”交易类型

* 删除无用文件
  • Loading branch information
ramsayleung authored Jul 2, 2023
1 parent 5d3b53e commit 74c6513
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions example/wechat/example-wechat-output.beancount
Original file line number Diff line number Diff line change
Expand Up @@ -264,3 +264,15 @@ option "operating_currency" "CNY"
Expenses:Wechat:Sponsor 36.99 CNY
Assets:Digital:Wechat:Cash -36.99 CNY

2023-06-23 * "赞赏作者的收款_20230623" "/"
merchantId: "10101008588132306239222222222222"
method: "/"
orderId: "180000737623062310106004541373333333333333333"
payTime: "2023-06-23 11:01:51 +0800 CST"
source: "微信支付"
status: "已到账"
txType: "其他"
type: "收入"
Assets:Digital:Wechat:Cash 5.00 CNY
Income:Wechat:RedPacket -5.00 CNY

12 changes: 12 additions & 0 deletions example/wechat/example-wechat-output.ledger
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,15 @@
Expenses:Wechat:Sponsor 36.99 CNY
Assets:Digital:Wechat:Cash - 36.99 CNY

2023/06/23 * 赞赏作者的收款_20230623 - /
; merchantId: "10101008588132306239222222222222"
; method: "/"
; orderId: "180000737623062310106004541373333333333333333"
; payTime: "2023-06-23 11:01:51 +0800 CST"
; source: "微信支付"
; status: "已到账"
; txType: "其他"
; type: "收入"
Assets:Digital:Wechat:Cash 5.00 CNY
Income:Wechat:RedPacket - 5.00 CNY

1 change: 1 addition & 0 deletions example/wechat/example-wechat-records.csv
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@
2021-07-18 10:48:09,商户消费,打开拼多多,点击底部"多多视频","/",收入,¥0.07,/,充值成功,160572459521071810106004542906137497131422937 ,10101265586742107189275763431048 ,"/"
2022-07-18 10:48:09,商户消费,测试时间戳,点击底部"多多视频","/",收入,¥0.07,/,充值成功,160572459521071810106004542906137497131422938 ,10101265586742107189275763431049 ,"/"
2022-09-24 02:24:20,赞赏码,YingDev,"/",支出,¥36.99,零钱,朋友已收钱,100010810122092400064222561891707533 ,1000108101202209241820542253348 ,"/"
2023-06-23 11:01:51,其他,赞赏作者的收款_20230623,"/",收入,¥5.00,/,已到账,180000737623062310106004541373333333333333333 ,10101008588132306239222222222222 ,"赞赏作者的收款_20230623"
1 change: 1 addition & 0 deletions pkg/provider/wechat/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ const (
TxTypeCash2Others TxType = "零钱通转出"
TxTypeFamilyCard TxType = "亲属卡交易"
TxTypeSponsorCode TxType = "赞赏码"
TxTypeOther TxType = "其他"
TxTypeUnknown TxType = "Unknown"
)
2 changes: 2 additions & 0 deletions pkg/provider/wechat/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ func getTxType(tt string) TxType {
return TxTypeFamilyCard
} else if strings.Contains(tt, string(TxTypeSponsorCode)) {
return TxTypeSponsorCode
} else if strings.Contains(tt, string(TxTypeOther)){
return TxTypeOther
} else {
return TxTypeUnknown
}
Expand Down

0 comments on commit 74c6513

Please sign in to comment.