蛋蛋星球-客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

face.go 1.3 KiB

3 weeks ago
1 week ago
3 weeks ago
1 week ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
1234567891011121314151617181920212223242526272829303132333435363738
  1. package alipay
  2. import (
  3. "applet/app/db"
  4. "applet/app/svc/sys_cfg"
  5. "code.fnuoos.com/EggPlanet/egg_system_rules.git/enum"
  6. "errors"
  7. )
  8. func FacePrepareAlipayCode(method string, params map[string]string) (interface{}, error) {
  9. sysCfgDb := sys_cfg.NewSysCfgDb(db.Db)
  10. sysCfgMap := sysCfgDb.SysCfgFindWithDb("alipay_face_url", enum.AlipayAppId, enum.AlipayPrivateKey, enum.AlipayPublicKey, enum.AlipayPublicContentRSA2, enum.AlipayRootContent, enum.AppPublicContent)
  11. // 获取私钥和APPID
  12. var paySet = &PayData{
  13. AlipayAppId: sysCfgMap[enum.AlipayAppId],
  14. AlipayPrivateKey: sysCfgMap[enum.AlipayPrivateKey],
  15. AlipayPublicKey: sysCfgMap[enum.AlipayPublicKey],
  16. AlipayPublicContentRSA2: sysCfgMap[enum.AlipayPublicContentRSA2],
  17. AlipayRootContent: sysCfgMap[enum.AlipayRootContent],
  18. AppPublicContent: sysCfgMap[enum.AppPublicContent],
  19. }
  20. notifyURL := sysCfgMap["alipay_face_url"]
  21. var param interface{}
  22. var err error
  23. switch method {
  24. case "face_init":
  25. param, err = UserCertifyOpenInit(params["name"], params["id_num"], params["oid"], notifyURL, paySet)
  26. case "face_certify":
  27. param, err = UserCertifyOpenCertify(params["certify_id"], notifyURL, paySet)
  28. case "face_query":
  29. param, err = UserCertifyOpenQuery(params["certify_id"], notifyURL, paySet)
  30. default:
  31. return "", errors.New("失败")
  32. }
  33. return param, err
  34. }