f
This commit is contained in:
@@ -1975,7 +1975,7 @@ type PaymentReq struct {
|
||||
Id string `json:"id"`
|
||||
PayMethod string `json:"pay_method"` // 支付方式: wechat, alipay, appleiap, test(仅开发环境), test_empty(仅开发环境-空报告模式)
|
||||
PayType string `json:"pay_type" validate:"required,oneof=query agent_vip agent_upgrade whitelist"`
|
||||
Code string `json:"code"` // 微信小程序登录 code,用于未绑定 openid 时换取 openid 并调起支付(可选)
|
||||
Code string `json:"code,optional"` // 微信小程序登录 code,未绑定 openid 时传此参数以换取 openid 并调起支付
|
||||
}
|
||||
|
||||
type PaymentResp struct {
|
||||
|
||||
@@ -78,7 +78,7 @@ func TestDecryptIDCard(t *testing.T) {
|
||||
|
||||
// TestEncryptIDCard_DecryptIDCard 身份证加密解密 round-trip 测试
|
||||
func TestEncryptIDCard_DecryptIDCard(t *testing.T) {
|
||||
idCard := "360733199005090032"
|
||||
idCard := "51018219920914121x"
|
||||
key, _ := hex.DecodeString("ff83609b2b24fc73196aac3d3dfb874f")
|
||||
|
||||
// 加密
|
||||
@@ -89,10 +89,11 @@ func TestEncryptIDCard_DecryptIDCard(t *testing.T) {
|
||||
}
|
||||
fmt.Printf("encrypted: %s\n", encrypted)
|
||||
// 解密
|
||||
decrypted, err := DecryptIDCard(encrypted, key)
|
||||
decrypted, err := DecryptIDCard("Ix2KZkm22Uuw8FfgmWYzdRoo7lEtuTpiT8mwkQqNrdk=", key)
|
||||
if err != nil {
|
||||
t.Fatalf("身份证解密失败: %v", err)
|
||||
}
|
||||
fmt.Printf("decrypted: %s\n", decrypted)
|
||||
|
||||
if decrypted != idCard {
|
||||
t.Errorf("解密结果不匹配,期望: %s, 实际: %s", idCard, decrypted)
|
||||
|
||||
Reference in New Issue
Block a user