Signature

Before the API integration, you need to get your AppId and AppKey.

ReelPay API authenticates your requests by AppId and AppKey. Log in to your ReelPay account, go to AppManage page, you can find your AppId and AppKey on this page.

AppId and AppKey carries many privileges, so be sure to keep it secure. Please do not share your developer information in publicly accessible areas such as GitHub, client code, etc.

Signature Guide

NameTypeDescription

X-Sign

string

Signature

X-Timestamp

int

Timestamp(sec)

X-Appid

string

Merchant APPID

content-type

string

application/json

Signature Algorithm

// sign
func hmacSHA256Sign(appKey, timestamp string, body interface{}) (string, error) {
   jsonStr, err := json.Marshal(body)
   if err != nil {
      return  "", err
   }
   sha256Mac := hmac.New(sha256.New, []byte(appKey))
   _, err = sha256Mac.Write(append(jsonStr, []byte(timestamp)...))
   if err != nil {
      return "", err
   }
   return hex.EncodeToString(sha256Mac.Sum(nil)), nil
}

Last updated