增加vivo支付与登录接口

This commit is contained in:
ayflying
2025-07-23 17:37:17 +08:00
parent 58bea0c09a
commit 90b72129a5
8 changed files with 256 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
package vivo
import (
"github.com/gogf/gf/v2/frame/g"
"testing"
)
func TestVerifySign(t *testing.T) {
type args struct {
bm g.Map
key string
}
tests := []struct {
name string
args args
want bool
}{
{
name: "testCase-01",
args: args{
bm: map[string]interface{}{
"appId": "111",
"cpId": "11",
"cpOrderNumber": "111",
"extInfo": "扩展参数",
"orderAmount": "1",
"orderNumber": "11",
"payTime": "20210610213219",
"respCode": "200",
"respMsg": "交易成功",
"signMethod": "MD5",
"signature": "111",
"tradeStatus": "0000",
"tradeType": "01",
"uid": "111",
},
key: "1111",
},
want: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := New("123", "123", "123").VerifySign(tt.args.bm, tt.args.key); got != tt.want {
t.Errorf("VerifySign() = %v, want %v", got, tt.want)
}
})
}
}