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

37 lines
1.4 KiB

  1. package adapay
  2. import (
  3. adapayCore "code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/lib/adapay-sdk/adapay-core"
  4. )
  5. type adapayToolsInterface interface {
  6. DownloadBill(bill_date string, multiMerchConfigId ...string) (map[string]interface{}, *adapayCore.ApiError, error)
  7. UserIdentity(reqParam map[string]interface{}, multiMerchConfigId ...string) (map[string]interface{}, *adapayCore.ApiError, error)
  8. VerifySign(signData string, originalData string, multiMerchConfigId ...string) error
  9. }
  10. type AdapayTools struct {
  11. *Adapay
  12. }
  13. func (b *AdapayTools) DownloadBill(bill_date string, multiMerchConfigId ...string) (map[string]interface{}, *adapayCore.ApiError, error) {
  14. reqUrl := BASE_URL + BILL_DOWNLOAD
  15. reqParam := make(map[string]interface{})
  16. reqParam["bill_date"] = bill_date
  17. return adapayCore.RequestAdaPay(reqUrl, adapayCore.POST, reqParam, b.HandleConfig(multiMerchConfigId...))
  18. }
  19. func (u *AdapayTools) UserIdentity(reqParam map[string]interface{}, multiMerchConfigId ...string) (map[string]interface{}, *adapayCore.ApiError, error) {
  20. reqUrl := BASE_URL + USER_IDENTITY
  21. return adapayCore.RequestAdaPay(reqUrl, adapayCore.POST, reqParam, u.HandleConfig(multiMerchConfigId...))
  22. }
  23. func (v *AdapayTools) VerifySign(signData string, originalData string, multiMerchConfigId ...string) error {
  24. return adapayCore.RsaSignVerify(signData, originalData, v.HandleConfig(multiMerchConfigId...))
  25. }