コード例 #1
0
        public ActionResult UnifiedPay(string out_trade_no, int total_amount, string body)
        {
            var request = new UnifiedPayRequest();

            request.AddGatewayData(new UnifiedPayModel()
            {
                PayType     = PayType.A01,
                Body        = body,
                TotalAmount = total_amount,
                OutTradeNo  = out_trade_no
            });

            var response = _gateway.Execute(request);

            return(Json(response));
        }
コード例 #2
0
        public void TestUnifiedPay()
        {
            var request = new UnifiedPayRequest();

            request.AddGatewayData(new UnifiedPayModel
            {
                PayType     = PayType.A01,
                Body        = "通联收银宝统一支付测试",
                TotalAmount = 1,
                OutTradeNo  = OutTradeNo
            });

            var response = _allinpayGateway.Execute(request);

            _output.WriteLine(response.PayInfo);
            Assert.NotNull(response.PayInfo);
        }