浏览代码

付呗支付

tags/v1.6.1^2
jiaoboxiang 2 年前
父节点
当前提交
fd95d3c932
共有 1 个文件被更改,包括 86 次插入0 次删除
  1. +86
    -0
      test/fb_pay_test.go

+ 86
- 0
test/fb_pay_test.go 查看文件

@@ -77,3 +77,89 @@ func TestFBPayOrderWxconfig(t *testing.T) {
}
t.Logf("回调数据:%s\n", send)
}

func TestFBAccreditQuery(t *testing.T) {
requestParameters := fb.GetRequestParametersByVendorSn("2022120518415543840a")
requestParameters.Method = "openapi.share.accredit.query"
requestParameters.SignMethod = "md5"
requestParameters.Nonce = time.Now().Format("20060102150405")
param := make(map[string]interface{})
param["merchant_id"] = 1989190
for key, value := range param {
if value == "" {
delete(param, key)
}
}
requestParameters.SetBizContent(param)
requestParameters.SetSign("c5d47b9e515594313d80fb9903ece2d8")
send, err := requestParameters.Send(false)
if err != nil {
t.Error(err)
}
t.Logf("回调数据:%s\n", send)
}

func TestFBAccountOrderSwitch(t *testing.T) {
requestParameters := fb.GetRequestParametersByVendorSn("2022120518415543840a")
requestParameters.Method = "openapi.agent.account.order.switch"
requestParameters.SignMethod = "md5"
requestParameters.Nonce = time.Now().Format("20060102150405")
param := make(map[string]interface{})
param["merchant_id"] = 1989190
param["state"] = 1
param["share_percent"] = 60
for key, value := range param {
if value == "" {
delete(param, key)
}
}
requestParameters.SetBizContent(param)
requestParameters.SetSign("c5d47b9e515594313d80fb9903ece2d8")
send, err := requestParameters.Send(false)
if err != nil {
t.Error(err)
}
t.Logf("回调数据:%s\n", send)
}

func TestFBMerchantIncomeSuccess(t *testing.T) {
requestParameters := fb.GetRequestParametersByVendorSn("2022120518415543840a")
requestParameters.Method = "openapi.merchant.income.status.query"
requestParameters.SignMethod = "md5"
requestParameters.Nonce = time.Now().Format("20060102150405")
param := make(map[string]interface{})
param["merchant_code"] = "139334168531126"
for key, value := range param {
if value == "" {
delete(param, key)
}
}
requestParameters.SetBizContent(param)
requestParameters.SetSign("c5d47b9e515594313d80fb9903ece2d8")
send, err := requestParameters.Send(false)
if err != nil {
t.Error(err)
}
t.Logf("回调数据:%s\n", send)
}

func TestFBUrlSet(t *testing.T) {
requestParameters := fb.GetRequestParametersByVendorSn("2022120518415543840a")
requestParameters.Method = "fbpay.pay.callback.config"
requestParameters.SignMethod = "md5"
requestParameters.Nonce = time.Now().Format("20060102150405")
param := make(map[string]interface{})
param["second_callback_url"] = "http://api.zhiyingos.com/api/v1/comm/pay/fb/callback"
for key, value := range param {
if value == "" {
delete(param, key)
}
}
requestParameters.SetBizContent(param)
requestParameters.SetSign("c5d47b9e515594313d80fb9903ece2d8")
send, err := requestParameters.Send(false)
if err != nil {
t.Error(err)
}
t.Logf("回调数据:%s\n", send)
}

正在加载...
取消
保存