car code
This commit is contained in:
parent
5176b1acd5
commit
3e33763968
|
@ -3,7 +3,7 @@ module plugins/zltx_card_v1
|
|||
go 1.22.2
|
||||
|
||||
require (
|
||||
gitea.cdlsxd.cn/sdk/plugin v1.0.13
|
||||
gitea.cdlsxd.cn/sdk/plugin v1.0.14
|
||||
github.com/go-playground/validator/v10 v10.22.0
|
||||
github.com/hashicorp/go-plugin v1.6.1
|
||||
github.com/stretchr/testify v1.9.0
|
||||
|
|
|
@ -2,6 +2,8 @@ gitea.cdlsxd.cn/sdk/plugin v1.0.12 h1:gA7zRagOro38rbRVIfFgGRuGOr+Wig8EjeqQkYedFX
|
|||
gitea.cdlsxd.cn/sdk/plugin v1.0.12/go.mod h1:FLuWLP2QP2aBzI2HCdZ7tvl1ieMuMOpTWvItmNGCeGA=
|
||||
gitea.cdlsxd.cn/sdk/plugin v1.0.13 h1:v9YUJci9Npb6svojARQkkbWpdsm74/X9g/uAECtrCJg=
|
||||
gitea.cdlsxd.cn/sdk/plugin v1.0.13/go.mod h1:FLuWLP2QP2aBzI2HCdZ7tvl1ieMuMOpTWvItmNGCeGA=
|
||||
gitea.cdlsxd.cn/sdk/plugin v1.0.14 h1:nBV4AJYdFTiwOdIwhfKuhHg60DCcHOZDFW5/W42bqGM=
|
||||
gitea.cdlsxd.cn/sdk/plugin v1.0.14/go.mod h1:FLuWLP2QP2aBzI2HCdZ7tvl1ieMuMOpTWvItmNGCeGA=
|
||||
github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA=
|
||||
github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
|
|
|
@ -12,12 +12,19 @@ import (
|
|||
var zltx = &ZLTXCardV1Service{}
|
||||
|
||||
func config() []byte {
|
||||
//c := &Config{
|
||||
// AppId: "1",
|
||||
// AppKey: "1e2bf7a04b8b1e6be5dc78d04e8639c9",
|
||||
// BaseUri: "http://test.openapi.1688sup.cn",
|
||||
// NotifyUrl: "https://gateway.dev.cdlsxd.cn/yxh5api/v1/order/direct/notify",
|
||||
// MerchantId: 23329,
|
||||
//}
|
||||
c := &Config{
|
||||
AppId: "1",
|
||||
AppKey: "1e2bf7a04b8b1e6be5dc78d04e8639c9",
|
||||
BaseUri: "http://test.openapi.1688sup.cn",
|
||||
NotifyUrl: "https://gateway.dev.cdlsxd.cn/yxh5api/v1/order/direct/notify",
|
||||
MerchantId: 23329,
|
||||
AppId: "101",
|
||||
AppKey: "95E7EC7D4A394FF8D11788E5E436DE99",
|
||||
BaseUri: "https://openapi.1688sup.com",
|
||||
NotifyUrl: "https://market.86698.cn/v1/order/direct/notify",
|
||||
MerchantId: 25715,
|
||||
}
|
||||
marshal, _ := json.Marshal(c)
|
||||
return marshal
|
||||
|
@ -82,8 +89,8 @@ func TestNotify(t *testing.T) {
|
|||
in := &proto.NotifyRequest{
|
||||
Config: config(),
|
||||
Queries: nil,
|
||||
Headers: []byte(`{"Accept-Encoding":["gzip, deflate, br"],"Authorization":["MD5 appid=1,sign=B8DD605A67EDFF68C83626A4529E5B99"],"Connection":["close"],"Content-Length":["140"],"Content-Type":["application/json"],"Cookie":[""],"User-Agent":["GuzzleHttp/6.5.5 curl/7.69.1 PHP/7.2.34"],"X-Remoteaddr":["172.21.0.1"]}`),
|
||||
Body: []byte(`{"merchantId":23329,"outTradeNo":"test_v1_card_zltx_002","tradeNo":"713390676754186241","status":"01","cardCode":"i548vESCHR7GkTeJwg8vHA=="}`),
|
||||
Headers: []byte(`{"Accept-Encoding":["gzip, deflate, br"],"Authorization":["MD5 appid=101,sign=6ECA9F00E426FBE0137ACFA2920D058D"],"Connection":["close"],"Content-Length":["140"],"Content-Type":["application/json"],"Cookie":[""],"User-Agent":["GuzzleHttp/6.5.5 curl/7.69.1 PHP/7.2.34"],"X-Remoteaddr":["172.21.0.1"]}`),
|
||||
Body: []byte(`{"merchantId":25715,"outTradeNo":"202411261524470700010001","tradeNo":"715948765692968961","status":"01","cardCode":"AlT5ZLb4VwYbKqTudDcyR4WZzrOLFtMUD00HNNvBFs0="}`),
|
||||
}
|
||||
t.Run("TestNotify", func(t *testing.T) {
|
||||
got, err := zltx.Notify(context.Background(), in)
|
||||
|
|
|
@ -3,7 +3,7 @@ module plugins/zltx_v1
|
|||
go 1.22.2
|
||||
|
||||
require (
|
||||
gitea.cdlsxd.cn/sdk/plugin v1.0.13
|
||||
gitea.cdlsxd.cn/sdk/plugin v1.0.14
|
||||
github.com/go-playground/validator/v10 v10.22.0
|
||||
github.com/hashicorp/go-plugin v1.6.1
|
||||
github.com/stretchr/testify v1.9.0
|
||||
|
|
|
@ -4,6 +4,8 @@ gitea.cdlsxd.cn/sdk/plugin v1.0.12 h1:gA7zRagOro38rbRVIfFgGRuGOr+Wig8EjeqQkYedFX
|
|||
gitea.cdlsxd.cn/sdk/plugin v1.0.12/go.mod h1:FLuWLP2QP2aBzI2HCdZ7tvl1ieMuMOpTWvItmNGCeGA=
|
||||
gitea.cdlsxd.cn/sdk/plugin v1.0.13 h1:v9YUJci9Npb6svojARQkkbWpdsm74/X9g/uAECtrCJg=
|
||||
gitea.cdlsxd.cn/sdk/plugin v1.0.13/go.mod h1:FLuWLP2QP2aBzI2HCdZ7tvl1ieMuMOpTWvItmNGCeGA=
|
||||
gitea.cdlsxd.cn/sdk/plugin v1.0.14 h1:nBV4AJYdFTiwOdIwhfKuhHg60DCcHOZDFW5/W42bqGM=
|
||||
gitea.cdlsxd.cn/sdk/plugin v1.0.14/go.mod h1:FLuWLP2QP2aBzI2HCdZ7tvl1ieMuMOpTWvItmNGCeGA=
|
||||
github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA=
|
||||
github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
|
|
Loading…
Reference in New Issue