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

luso_pay_test.go 986 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package test
  2. import (
  3. luso "code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/lib/luso_bank"
  4. zhios_pay_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/utils"
  5. "testing"
  6. )
  7. func TestLusoPay(t *testing.T) {
  8. var (
  9. payParam luso.PayParam
  10. dataParam luso.DataParam
  11. )
  12. req := map[string]string{
  13. "mchtOrderId": "202211041102",
  14. "payScene ": "AS_MWEB",
  15. "mdseDesc ": "澳门世寶-自營購物",
  16. "transAmount ": "100",
  17. "transCur ": "MOP",
  18. "subMchtNm ": "世寶商城",
  19. "notifyUrl ": "http://inapi.izhyin.cn:80/pay/boc/callback",
  20. "extMsg ": zhios_pay_utils.SerializeStr(map[string]string{
  21. "mid": "123456",
  22. "ord_type": "mall_goods",
  23. }),
  24. }
  25. dataParam.Head.MchtNo = luso.MerchantId
  26. dataParam.ReqBody = req
  27. client := payParam.SetData(dataParam)
  28. err := client.SetSign(luso.PrivateKeyStr)
  29. if err != nil {
  30. t.Error(err)
  31. }
  32. resp, err := client.PayParam.Send(false)
  33. if err != nil {
  34. t.Error(err)
  35. }
  36. t.Logf("回調信息:%s", resp)
  37. }