コード例 #1
0
        private void CreateTenpayOrder()
        {
            var            gateway        = new TenpayGateway();
            PaymentSetting paymentSetting = new PaymentSetting(gateway);

            //paymentSetting.Merchant.UserName = "******";
            //paymentSetting.Merchant.Key = "000000000000000000000000000000000000000000";
            //paymentSetting.Merchant.NotifyUrl = new Uri("http://yourwebsite.com/Notify.aspx");

            paymentSetting.Order.Amount     = 0.01;
            paymentSetting.Order.OutTradeNo = "93";
            paymentSetting.Order.Body       = "测测看";

            paymentSetting.Payment();
        }
コード例 #2
0
        /// <summary>
        /// 查询财付通的订单支付状态
        /// </summary>
        private void QueryTenpayOrder()
        {
            var            gateway      = new TenpayGateway();
            PaymentSetting querySetting = new PaymentSetting(gateway);

            //querySetting.Merchant.UserName = "******";
            //querySetting.Merchant.Key = "0000000000000000000000000000000000000000";

            // 查询时需要设置订单的Id与金额,在查询结果中将会核对订单的Id与金额,如果不相符会返回查询失败。
            querySetting.Order.OutTradeNo = "885";
            querySetting.Order.Amount     = 0.01;

            if (querySetting.CanQueryNow && querySetting.QueryNow())
            {
                // 订单已支付
            }
        }