forked from objcoding/wxpay
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi_type.go
More file actions
42 lines (35 loc) · 756 Bytes
/
api_type.go
File metadata and controls
42 lines (35 loc) · 756 Bytes
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
package wxpay
// type API interface {
// URL() string
// }
// type defaultAPI struct {
// apiType APIType
// url string
// // sandboxURL string
// }
// func NewAPI(apiType APIType, isSandbox bool, serverURL string) API {
// var url string
// if serverURL != "" {
// url = serverURL
// } else if isSandbox {
// url = WxSandboxUrl
// } else {
// url = WxUrl
// }
// switch apiType {
// case APITypeUnifiedOrder:
// url = url + "pay/" + string(apiType)
// case APITypeRefund:
// url = url + "secapi/pay/" + string(apiType)
// }
// return &defaultAPI{
// apiType: apiType,
// url: url,
// }
// }
// func (p *defaultAPI) URL() string {
// // if isSandbox {
// // return p.sandboxURL
// // }
// return p.url
// }