|
123456789101112131415161718192021222324252627282930 |
- package boc
-
- import (
- zhios_pay_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/utils"
- "fmt"
- )
-
- func Send(prd bool, appId, privateKeyStr string, param map[string]string) (string, error) {
- data := zhios_pay_utils.JoinStringsInASCII(param, "", "", false, false)
- sign, err := zhios_pay_utils.GetSign(privateKeyStr, data)
- if err != nil {
- return "", err
- }
- url := "https://cuaas.bocmacau.com/w/rsa/mercapi_ol"
- if prd {
- url = "https://aas.bocmacau.com/w/rsa/mercapi_ol"
- }
- headers := map[string]string{
- "Content-Type": "application/json",
- }
- param["merchantSign"] = sign
- fmt.Println(zhios_pay_utils.SerializeStr(param))
- fmt.Println(url)
- res, err := zhios_pay_utils.CurlPost(url, param, headers)
- if err != nil {
- return "", err
- }
- fmt.Println(string(res))
- return string(res), nil
- }
|