示例#1
0
        public AlipayWebPayRequestContent(IGateWay gateWay, IReturnOrder order)
            : base(gateWay)
        {
            ReturnUrl = order.ReturnUrl;

            if (string.IsNullOrEmpty(order.NotifyUrl))
            {
                throw new PaymentArgumentException(gateWay.Name, "notify_url", "notify_url参数错误");
            }
            NotifyUrl = order.NotifyUrl;

            if (string.IsNullOrEmpty(order.Subject))
            {
                throw new PaymentArgumentException(gateWay.Name, "subject", "subject参数错误");
            }
            this["subject"] = order.Subject;

            if (string.IsNullOrEmpty(order.OrderNo))
            {
                throw new PaymentArgumentException(gateWay.Name, "out_trade_no", "out_trade_no参数错误");
            }
            this["out_trade_no"] = order.OrderNo;

            if (order.Price <= 0)
            {
                throw new PaymentArgumentException(gateWay.Name, "total_amount", "total_amount参数错误");
            }
            this["total_amount"] = order.Price.ToString(CultureInfo.InvariantCulture);

            this["product_code"] = "FAST_INSTANT_TRADE_PAY";
        }
示例#2
0
 protected AlipayRequestContent(IGateWay gateWay)
 {
     Format    = "JSON";
     Charset   = "utf-8";
     SignType  = "RSA2";
     Version   = "1.0";
     Timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
     AppId     = gateWay.MerchantConfigure.MerchantId;
 }
示例#3
0
        public override async Task OnActivateAsync()
        {
            Log.Debug($"{typeof(MainEntryGrain)}OnActivateAsync");
            m_ChatRoom = await GetIChatRoom();

            m_IGateWay = await GetIGateWay();

            m_IHello = GrainFactory.GetGrain <IHello>(0);

            RegisterTimer(Update_Timer, null, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1));
            await base.OnActivateAsync();
        }
示例#4
0
 private bool accquireMemoryForFileModel(FileModel fdm)
 {
     //version ngày 26/7
     try
     {
         byte[] memblock = IGateWay.getByteFromFile(fdm.FileFullName);
         sendMemForFileModel(memblock, fdm);
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
示例#5
0
 public AlipayQueryRequestContent(IGateWay gateWay, IPlatformOrder order)
     : base(gateWay)
 {
     if (string.IsNullOrEmpty(order.OrderNo) && string.IsNullOrEmpty(order.PlatformTradeNo))
     {
         throw new PaymentArgumentException(gateWay.Name, "out_trade_no,trade_no", "参数错误out_trade_no和trade_no不能同时为空");
     }
     if (!string.IsNullOrEmpty(order.OrderNo))
     {
         this["out_trade_no"] = order.OrderNo;
     }
     if (!string.IsNullOrEmpty(order.PlatformTradeNo))
     {
         this["trade_no"] = order.PlatformTradeNo;
     }
 }
示例#6
0
        public override bool Init()
        {
            m_ClusterClient = InitialiseClient();

            m_MainEntry = m_ClusterClient.GetGrain <IMainEntry>(0);

            m_SiloGateWay_Obs = new SiloGateWay_Obs();
            m_IGateWay_Obs    = m_ClusterClient.CreateObjectReference <IGateWay_Obs>(m_SiloGateWay_Obs).Result;

            m_IGateWay = m_MainEntry.GetIGateWay().Result;

            m_IGateWay.SubscribeAsync(m_IGateWay_Obs).Wait();

            m_ChatRoom = m_MainEntry.GetIChatRoom().Result;


            return(base.Init());
        }
示例#7
0
 public AlipayRefundRequestContent(IGateWay gateWay, IRefundOrder order)
     : base(gateWay)
 {
     if (string.IsNullOrEmpty(order.OrderNo) && string.IsNullOrEmpty(order.PlatformTradeNo))
     {
         throw new PaymentArgumentException(gateWay.Name, "out_trade_no,trade_no", "参数错误out_trade_no和trade_no不能同时为空");
     }
     if (order.RefundAmount <= 0)
     {
         throw new PaymentArgumentException(gateWay.Name, "refund_amount", "参数错误refund_amount");
     }
     if (!string.IsNullOrEmpty(order.OrderNo))
     {
         this["out_trade_no"] = order.OrderNo;
     }
     if (!string.IsNullOrEmpty(order.PlatformTradeNo))
     {
         this["trade_no"] = order.PlatformTradeNo;
     }
     this["refund_amount"] = order.RefundAmount.ToString(CultureInfo.InvariantCulture);
 }
示例#8
0
 public AlipaySignature(IGateWay gateWay)
 {
     GateWay = gateWay;
 }
示例#9
0
 public AlipayWebPayRequest(IGateWay gateWay) : base(gateWay)
 {
 }
示例#10
0
 public AlipayNotify(IGateWay gateWay)
     : base(gateWay)
 {
 }
示例#11
0
 /// <summary>
 /// 初始化网关
 /// </summary>
 /// <param name="gateWay"></param>
 /// <param name="gateWayName"></param>
 public static void InitGateWay(IGateWay gateWay, string gateWayName)
 {
     InitGateWay(o => gateWay, gateWayName);
 }
示例#12
0
 protected AlipayHtmlRequest(IGateWay gateWay) : base(gateWay)
 {
 }
示例#13
0
 protected PostRequest(IGateWay gateWay) : base(gateWay)
 {
 }
示例#14
0
 protected RequestBase(IGateWay gateWay)
 {
     GateWay = gateWay;
 }
示例#15
0
 public AlipayRefundRequest(IGateWay gateWay) : base(gateWay)
 {
 }
示例#16
0
 private bool ProvideMemForModel(FileModel fmdl) // hop ly now
 {
     byte[] bytes = IGateWay.getByteFromFile(fmdl.FileFullName);
     fmdl.receiveMemoryFromInteractor(bytes);
     return(false);
 }
示例#17
0
 protected AlipayPostRequestContent(IGateWay gateWay)
     : base(gateWay)
 {
 }
示例#18
0
 public string[] getAllFilesInFolder(string dirPath)
 {
     return(IGateWay.getFileInFolderNonRecursive(dirPath));
 }
示例#19
0
 protected Notify(IGateWay gateWay)
 {
     GateWay = gateWay;
 }
示例#20
0
 protected HtmlRequest(IGateWay gateWay) : base(gateWay)
 {
 }
示例#21
0
 public AlipayQueryRequest(IGateWay gateWay) : base(gateWay)
 {
 }