Пример #1
0
        public void pay()
        {
            //SybWxPayService sybService = new SybWxPayService();
            AllinPayClient client = new AllinPayClient();
            var            req    = new UnionOrderRequest()
            {
                trxamt   = 1,
                reqsn    = DateTime.Now.ToFileTime().ToString(),
                paytype  = "W01",
                body     = "测试商品",
                remark   = "测试备注",
                acct     = "",
                authcode = "",

                notify_url = "http://www.baidu.com",
                limit_pay  = "",
                idno       = "",
                truename   = "",
                asinfo     = "",
                validtime  = 100
            };

            //   Dictionary<String, String> rsp = sybService.pay(1, DateTime.Now.ToFileTime().ToString(), "W01", "商品内容", "备注", "", "", "http://baidu.com", "", "", "", "");


            var rsp = client.pay(req);
        }
Пример #2
0
        /// <summary>
        /// 统一下单接口
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public UnionOrderResponse pay(UnionOrderRequest req)
        {
            UnionOrderResponse rsp = null;

            try
            {
                var strResp = this.InternalRequest(req, "pay");
                rsp = JsonConvert.DeserializeObject <UnionOrderResponse>(strResp);
            }
            catch (JsonSerializationException e)
            {
                throw new Exception(e.Message);
            }
            return(rsp);
        }