Pārlūkot izejas kodu

付呗支付

tags/v1.6.1^2
jiaoboxiang pirms 2 gadiem
vecāks
revīzija
fd95d3c932
1 mainītis faili ar 86 papildinājumiem un 0 dzēšanām
  1. +86
    -0
      test/fb_pay_test.go

+ 86
- 0
test/fb_pay_test.go Parādīt failu

@@ -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)
}

Notiek ielāde…
Atcelt
Saglabāt