28 lines
746 B
Go
28 lines
746 B
Go
package alipayapi
|
|
|
|
import (
|
|
"encoding/base64"
|
|
"fmt"
|
|
"git.rosy.net.cn/baseapi/utils"
|
|
"testing"
|
|
)
|
|
|
|
func TestSystemAuthToken(t *testing.T) {
|
|
result, err := api.SystemAuthToken(GrantTypeCode, "e4f95e2065a84625aaf01dea2703NA17", "")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(utils.Format4Output(result, false))
|
|
}
|
|
|
|
func TestDDDD(t *testing.T) {
|
|
sign := "GHp3ojlVYRRu2XID4FX2ew=="
|
|
data := "QWja44PbYifX70Y74N3PUwecCVtE3k+VSznUe3G0BVx6GiEAkGSJ5H7h9tP4Hnjau2E7N911BASFPTznphUcyA=="
|
|
data1, _ := base64.StdEncoding.DecodeString(data)
|
|
sign1, _ := base64.StdEncoding.DecodeString(sign)
|
|
iv := []byte{}
|
|
iv = append(iv, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
|
|
result, _ := utils.AESCBCDecpryt(data1, sign1, iv)
|
|
fmt.Println(string(result))
|
|
}
|