diff --git a/test/fb_pay_test.go b/test/fb_pay_test.go index 3f1d984..4cde019 100644 --- a/test/fb_pay_test.go +++ b/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) +}