-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathclient_test.go
61 lines (56 loc) · 1.14 KB
/
client_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package wxpayv3
import (
"testing"
)
func TestNewClient(t *testing.T) {
//client, err := NewClient(
// InjectWechatPayParameterUseCertPath("1234", "1234", "apiclient_key.pem", "apiclient_cert.pem"),
//)
//if err != nil {
// t.Log(err)
// return
//}
//下载证书
//resp, err := client.Certificate()
//if err != nil {
// t.Log(err)
// return
//}
//
//for _, v := range resp.Data {
// t.Logf("%+v", *v)
// t.Logf("%+v", *v.EncryptCertificate)
//}
//获取结算账号
//resp, err := client.QuerySettlementAccount("1609337198")
//if err != nil {
// t.Log(err)
// return
//}
//t.Log(resp)
//上传图片
//resp, err := client.UploadImage("./1.jpg")
//if err != nil {
// t.Log(err)
// return
//}
//t.Logf("%+v", resp)
//退款
//uid, _ := utils.GenerateNonce()
//resp, err := client.PaymentRefund(custom.ReqPaymentRefund{
// SubMchid: "123",
// TransactionId: "4200001126202108129763281234",
// OutRefundNo: uid,
// Reason: "API调试",
// Amount: custom.PaymentRefundAmount{
// Refund: 1,
// Total: 1,
// Currency: "CNY",
// },
//})
//if err != nil {
// t.Log(err)
// return
//}
//t.Log(resp)
}