添加wxpay回调消息处理
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
package wxpay
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"github.com/clbanning/mxj"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
@@ -44,3 +46,29 @@ func TestCreateUnifiedOrder(t *testing.T) {
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestXml2Json(t *testing.T) {
|
||||
xmlStr := strings.Replace(`
|
||||
<root>
|
||||
<out_refund_no><![CDATA[131811191610442717309]]></out_refund_no>
|
||||
<out_trade_no><![CDATA[71106718111915575302817]]></out_trade_no>
|
||||
<refund_account><![CDATA[REFUND_SOURCE_RECHARGE_FUNDS]]></refund_account>
|
||||
<refund_fee><![CDATA[3960]]></refund_fee>
|
||||
<refund_id><![CDATA[50000408942018111907145868882]]></refund_id>
|
||||
<refund_recv_accout><![CDATA[支付用户零钱]]></refund_recv_accout>
|
||||
<refund_request_source><![CDATA[API]]></refund_request_source>
|
||||
<refund_status><![CDATA[SUCCESS]]></refund_status>
|
||||
<settlement_refund_fee><![CDATA[3960]]></settlement_refund_fee>
|
||||
<settlement_total_fee><![CDATA[3960]]></settlement_total_fee>
|
||||
<success_time><![CDATA[2018-11-19 16:24:13]]></success_time>
|
||||
<total_fee><![CDATA[3960]]></total_fee>
|
||||
<transaction_id><![CDATA[4200000215201811190261405420]]></transaction_id>
|
||||
</root>
|
||||
|
||||
`, "\\n", "\n", -1)
|
||||
mv, err := mxj.NewMapXml([]byte(xmlStr))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(utils.Format4Output(mv, false))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user