protected override void Fill(WmXmlPackage wmXmlPackage)
        {
            if (null == wmXmlPackage)
            {
                throw new ArgumentNullException(nameof(wmXmlPackage));
            }

            Token    = wmXmlPackage.SelectNotEmptyString("transtoken");
            Lifetime = wmXmlPackage.SelectUInt32("validityperiodinhours");
        }
Exemple #2
0
        protected override void Fill(WmXmlPackage wmXmlPackage)
        {
            if (null == wmXmlPackage)
            {
                throw new ArgumentNullException(nameof(wmXmlPackage));
            }

            string result = wmXmlPackage.SelectNotEmptyString("testsign/res");

            VerificationResult = result.Equals("yes", StringComparison.InvariantCultureIgnoreCase);
        }
        protected override void Fill(WmXmlPackage wmXmlPackage)
        {
            if (null == wmXmlPackage)
            {
                throw new ArgumentNullException(nameof(wmXmlPackage));
            }

            Id          = wmXmlPackage.SelectUInt32("purse/@id");
            Purse       = wmXmlPackage.SelectPurse("purse/pursename");
            Amount      = wmXmlPackage.SelectAmount("purse/amount");
            Description = (Description)wmXmlPackage.SelectNotEmptyString("purse/desc");
        }
        protected override void Fill(WmXmlPackage wmXmlPackage)
        {
            if (null == wmXmlPackage)
            {
                throw new ArgumentNullException(nameof(wmXmlPackage));
            }

            Id         = wmXmlPackage.SelectUInt32("message/@id");
            WmId       = wmXmlPackage.SelectWmId("message/receiverwmid");
            Subject    = (Description)wmXmlPackage.SelectString("message/msgsubj");
            Content    = (Message)wmXmlPackage.SelectNotEmptyString("message/msgtext");
            CreateTime = wmXmlPackage.SelectWmDateTime("message/datecrt");
        }
        protected override void Fill(WmXmlPackage wmXmlPackage)
        {
            if (null == wmXmlPackage)
            {
                throw new ArgumentNullException(nameof(wmXmlPackage));
            }

            TransferId  = wmXmlPackage.SelectUInt32("operation/@wmtransid");
            InvoiceId   = wmXmlPackage.SelectUInt32("operation/@wminvoiceid");
            Amount      = wmXmlPackage.SelectAmount("operation/amount");
            Date        = wmXmlPackage.SelectWmDateTime("operation/operdate");
            Description = (Description)wmXmlPackage.SelectString("operation/purpose");
            ClientPurse = wmXmlPackage.SelectPurse("operation/pursefrom");
            ClientWmId  = wmXmlPackage.SelectWmId("operation/wmidfrom");
            Info        = wmXmlPackage.SelectString("userdesc");

            if (wmXmlPackage.Exists("smssentstate"))
            {
                SmsState =
                    (SmsState)Enum.Parse(typeof(SmsState), wmXmlPackage.SelectNotEmptyString("smssentstate"), true);
            }
        }
        protected override void Fill(WmXmlPackage wmXmlPackage)
        {
            if (null == wmXmlPackage)
            {
                throw new ArgumentNullException(nameof(wmXmlPackage));
            }

            TransferId     = wmXmlPackage.SelectInt64("operation/@wmtransid");
            InvoiceId      = wmXmlPackage.SelectInt64("operation/@wminvoiceid");
            CreateTime     = wmXmlPackage.SelectWmDateTime("operation/operdate");
            Description    = (Description)wmXmlPackage.SelectString("operation/purpose");
            SourcePurse    = wmXmlPackage.SelectPurse("operation/pursefrom");
            SourceWmId     = wmXmlPackage.SelectWmId("operation/wmidfrom");
            CapitallerFlag = wmXmlPackage.SelectBoolIfExists("operation/capitallerflag") ?? false;
            EnumFlag       = wmXmlPackage.SelectUInt8IfExists("operation/enumflag") ?? 0;
            IpAddress      = IPAddress.Parse(wmXmlPackage.SelectNotEmptyString("operation/IPAddress"));
            TelepatPhone   = wmXmlPackage.SelectString("operation/telepat_phone");
            TelepatMethod  =
                (TelepatMethod?)wmXmlPackage.SelectEnumFromIntegerIfExists(typeof(TelepatMethod),
                                                                           "operation/telepat_paytype");
            PaymerNumber = wmXmlPackage.TrySelectNotEmptyString("operation/paymer_number");
            PaymerEmail  = wmXmlPackage.TrySelectNotEmptyString("operation/paymer_email");
            PaymerType   =
                (PaymerType?)wmXmlPackage.SelectEnumFromIntegerIfExists(typeof(PaymerType),
                                                                        "operation/paymer_type") ?? PaymerType.None;

            //CashierNumber = wmXmlResponsePackage.SelectString("operation/cashier_number");

            //if (!string.IsNullOrEmpty(wmXmlResponsePackage.SelectString("operation/cashier_date")))
            //    CashierDate = wmXmlResponsePackage.SelectWmDateTime("operation/cashier_date");

            //if (!string.IsNullOrEmpty(wmXmlResponsePackage.SelectString("operation/cashier_amount")))
            //    CashierAmount = wmXmlResponsePackage.SelectAmount("operation/cashier_amount");

            SdpType = wmXmlPackage.SelectInt32IfExists("operation/sdp_type");
        }
        protected override void Fill(WmXmlPackage wmXmlPackage)
        {
            if (null == wmXmlPackage)
            {
                throw new ArgumentNullException(nameof(wmXmlPackage));
            }

            OperationId = wmXmlPackage.SelectUInt32("operation/@wmtransid");
            InvoiceId   = wmXmlPackage.SelectUInt32("operation/@wminvoiceid");
            CreateTime  = wmXmlPackage.SelectWmDateTime("operation/operdate");
            Description = (Description)wmXmlPackage.SelectString("operation/purpose");
            SourcePurse = wmXmlPackage.SelectPurse("operation/pursefrom");
            SourceWmId  = wmXmlPackage.SelectWmId("operation/wmidfrom");

            var capitallerFlagXPath = "operation/capitallerflag";

            if (!string.IsNullOrEmpty(wmXmlPackage.SelectString(capitallerFlagXPath)))
            {
                CapitallerFlag = wmXmlPackage.SelectBool(capitallerFlagXPath);
            }

            var enumFlagFlagXPath = "operation/enumflag";

            if (!string.IsNullOrEmpty(wmXmlPackage.SelectString(enumFlagFlagXPath)))
            {
                EnumFlag = wmXmlPackage.SelectUInt8(enumFlagFlagXPath);
            }

            IpAddress    = IPAddress.Parse(wmXmlPackage.SelectNotEmptyString("operation/IPAddress"));
            TelepatPhone = wmXmlPackage.SelectString("operation/telepat_phone");

            // TelepatMethod
            var telepatMethod = wmXmlPackage.SelectString("operation/telepat_paytype");

            if (!string.IsNullOrEmpty(telepatMethod) && !"null".Equals(telepatMethod))
            {
                TelepatMethod =
                    (TelepatMethod)int.Parse(telepatMethod, NumberStyles.Integer, CultureInfo.InvariantCulture.NumberFormat);
            }

            PaymerNumber = wmXmlPackage.SelectString("operation/paymer_number");
            PaymerEmail  = wmXmlPackage.SelectString("operation/paymer_email");

            string paymerType = wmXmlPackage.SelectString("operation/paymer_type");

            if (!string.IsNullOrEmpty(paymerType) && !"null".Equals(paymerType))
            {
                PaymerType =
                    (PaymerType)int.Parse(paymerType, NumberStyles.Integer, CultureInfo.InvariantCulture.NumberFormat);
            }
            else
            {
                PaymerType = PaymerType.None;
            }

            //CashierNumber = wmXmlResponsePackage.SelectString("operation/cashier_number");

            //if (!string.IsNullOrEmpty(wmXmlResponsePackage.SelectString("operation/cashier_date")))
            //    CashierDate = wmXmlResponsePackage.SelectWmDateTime("operation/cashier_date");

            //if (!string.IsNullOrEmpty(wmXmlResponsePackage.SelectString("operation/cashier_amount")))
            //    CashierAmount = wmXmlResponsePackage.SelectAmount("operation/cashier_amount");

            string sdpType = wmXmlPackage.SelectString("operation/sdp_type");

            if (!string.IsNullOrEmpty(sdpType))
            {
                SdpType = int.Parse(sdpType, NumberStyles.Integer, CultureInfo.InvariantCulture.NumberFormat);
            }
        }