public IActionResult WapPay(string order_id, int total_amount) { var request = new WapPayRequest(); request.AddGatewayData(new WapPayModel() { TotalAmount = total_amount, OrderId = order_id }); var response = _gateway.Execute(request); return(Content(response.Html, "text/html", Encoding.UTF8)); }
public ActionResult WapPay(string out_trade_no, int total_amount, string body, string scene_info) { var request = new WapPayRequest(); request.AddGatewayData(new WapPayModel() { Body = body, TotalAmount = total_amount, OutTradeNo = out_trade_no, SceneInfo = scene_info }); var response = _gateway.Execute(request); return(Json(response)); }
public IActionResult WapPay(string out_trade_no, string subject, double total_amount, string body) { var request = new WapPayRequest(); request.AddGatewayData(new WapPayModel() { Body = body, TotalAmount = total_amount, Subject = subject, OutTradeNo = out_trade_no }); var response = _gateway.Execute(request); return(Redirect(response.Url)); }
public void TestWapPay() { var request = new WapPayRequest(); request.AddGatewayData(new WapPayModel() { TotalAmount = 1, Subject = "支付宝手机网站支付测试", OutTradeNo = _outTradeNo }); var response = _alipayGateway.Execute(request); _output.WriteLine(response.Url); string result = HttpUtil.Get(response.Url); Assert.Contains("支付宝", result); }