Example #1
0
 private Action <IWeChatMsg, string> GenernateWeChatProccesor(IWeChatMsg weChatMsg)
 {
     switch (weChatMsg.Event)
     {
     case WeChatEventTypes.user_get_card:
         return(this.UserGetCardProccesor);
     }
     return(null);
 }
Example #2
0
        public static RegisterCardCoupon Convert(this IWeChatMsg message, string appid)
        {
            var getcard = message as GetCardCouponWeChatMsg;

            Guard.ArgumentNotNull(getcard, "getcard");
            return(new RegisterCardCoupon()
            {
                AppId = appid,
                ActiveTime = DateTime.UtcNow.ToUnixStampDateTime(),
                CardId = getcard.CardId,
                Event = getcard.Event,
                FriendOpenId = getcard.FriendUserName,
                IsGiveByFriend = getcard.IsGiveByFriend,
                IsRestoreMemberCard = getcard.IsRestoreMemberCard,
                MsgType = getcard.MsgType,
                OpenId = getcard.FromUserName,
                UnionId = getcard.UnionId,
                UserCode = getcard.UserCardCode
            });
        }
Example #3
0
 private void UserGetCardProccesor(IWeChatMsg message, string appid)
 {
     this.wxUserService.RegisterCardCoupon(message.Convert(appid));
 }