支付模块
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.

46 line
2.2 KiB

  1. package adapay
  2. import (
  3. "strings"
  4. adapayCore "code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/lib/adapay-sdk/adapay-core"
  5. )
  6. type memberInterface interface {
  7. Create(reqParam map[string]interface{}, multiMerchConfigId ...string) (map[string]interface{}, *adapayCore.ApiError, error)
  8. Query(reqParam map[string]interface{}, multiMerchConfigId ...string) (map[string]interface{}, *adapayCore.ApiError, error)
  9. Update(reqParam map[string]interface{}, multiMerchConfigId ...string) (map[string]interface{}, *adapayCore.ApiError, error)
  10. QueryList(reqParam map[string]interface{}, multiMerchConfigId ...string) (map[string]interface{}, *adapayCore.ApiError, error)
  11. }
  12. type Member struct {
  13. *Adapay
  14. }
  15. func (m *Member) Create(reqParam map[string]interface{}, multiMerchConfigId ...string) (map[string]interface{}, *adapayCore.ApiError, error) {
  16. reqUrl := BASE_URL + MEMBER_CREATE
  17. return adapayCore.RequestAdaPay(reqUrl, adapayCore.POST, reqParam, m.HandleConfig(multiMerchConfigId...))
  18. }
  19. func (m *Member) CreateRealName(reqParam map[string]interface{}, multiMerchConfigId ...string) (map[string]interface{}, *adapayCore.ApiError, error) {
  20. reqUrl := BASE_URL + MEMBER_CREATE_REALNAME
  21. return adapayCore.RequestAdaPay(reqUrl, adapayCore.POST, reqParam, m.HandleConfig(multiMerchConfigId...))
  22. }
  23. func (m *Member) Query(reqParam map[string]interface{}, multiMerchConfigId ...string) (map[string]interface{}, *adapayCore.ApiError, error) {
  24. reqUrl := BASE_URL + strings.Replace(MEMBER_QUERY, "{member_id}", adapayCore.ToString(reqParam["member_id"]), -1)
  25. return adapayCore.RequestAdaPay(reqUrl, adapayCore.GET, reqParam, m.HandleConfig(multiMerchConfigId...))
  26. }
  27. func (m *Member) Update(reqParam map[string]interface{}, multiMerchConfigId ...string) (map[string]interface{}, *adapayCore.ApiError, error) {
  28. reqUrl := BASE_URL + MEMBER_UPDATE
  29. return adapayCore.RequestAdaPay(reqUrl, adapayCore.POST, reqParam, m.HandleConfig(multiMerchConfigId...))
  30. }
  31. func (m *Member) QueryList(reqParam map[string]interface{}, multiMerchConfigId ...string) (map[string]interface{}, *adapayCore.ApiError, error) {
  32. reqUrl := BASE_URL + MEMBER_QUERY_LIST
  33. return adapayCore.RequestAdaPay(reqUrl, adapayCore.GET, reqParam, m.HandleConfig(multiMerchConfigId...))
  34. }