protected override void BuildXmlBody(XmlRequestBuilder xmlRequestBuilder)
        {
            if (null == xmlRequestBuilder)
            {
                throw new ArgumentNullException(nameof(xmlRequestBuilder));
            }

            xmlRequestBuilder.WriteStartElement("trust"); // <trust>

            xmlRequestBuilder.AppendAttribute("inv", InvoiceAllowed ? 1 : 0);
            xmlRequestBuilder.AppendAttribute("trans", TransferAllowed ? 1 : 0);
            xmlRequestBuilder.AppendAttribute("purse", BalanceAllowed ? 1 : 0);
            xmlRequestBuilder.AppendAttribute("transhist", HistoryAllowed ? 1 : 0);

            xmlRequestBuilder.WriteElement("masterwmid", Master.ToString());
            xmlRequestBuilder.WriteElement("slavewmid", Initializer.Id.ToString());
            xmlRequestBuilder.WriteElement("purse", Purse.ToString());

            xmlRequestBuilder.WriteElement("limit", Limit.ToString());
            xmlRequestBuilder.WriteElement("daylimit", DayLimit.ToString());
            xmlRequestBuilder.WriteElement("weeklimit", WeekLimit.ToString());
            xmlRequestBuilder.WriteElement("monthlimit", MonthLimit.ToString());

            xmlRequestBuilder.WriteEndElement(); // </trust>
        }
예제 #2
0
        protected override void BuildXmlBody(XmlRequestBuilder xmlRequestBuilder)
        {
            if (null == xmlRequestBuilder)
            {
                throw new ArgumentNullException(nameof(xmlRequestBuilder));
            }

            xmlRequestBuilder.WriteStartElement("getoutinvoices"); // <getoutinvoices>

            xmlRequestBuilder.WriteElement("purse", Purse.ToString());
            xmlRequestBuilder.WriteElement("wminvid", InvoiceId);
            xmlRequestBuilder.WriteElement("orderid", OrderId);
            xmlRequestBuilder.WriteElement("datestart", StartTime.ToServerString());
            xmlRequestBuilder.WriteElement("datefinish", FinishTime.ToServerString());

            xmlRequestBuilder.WriteEndElement(); // </getoutinvoices>
        }
예제 #3
0
        /// <summary>
        /// Получить список транзакций кошелька, за указанный период времени. Период времени должен быть не больше трёх месяцев.
        /// </summary>
        public List <Transfer> GetTransfers(DateTime startTime, DateTime finishTime)
        {
            var transferFilter = new TransferFilter(purse, startTime.AddHours(wmServerTimeDifference), finishTime.AddHours(wmServerTimeDifference));

            try
            {
                var transferRegister = transferFilter.Submit();
                return(transferRegister.TransferList);
            }
            catch (Exception ex)
            {
                Logger.Error(
                    string.Format("GetTransfers() - Не удалось получить список транзакций с сервера WebMoney кошелька {0} за период времени {1} от до {2}",
                                  purse.ToString(), startTime, finishTime), ex);
                return(null);
            }
        }
예제 #4
0
        protected override void BuildXmlBody(XmlRequestBuilder xmlRequestBuilder)
        {
            if (null == xmlRequestBuilder)
            {
                throw new ArgumentNullException(nameof(xmlRequestBuilder));
            }

            xmlRequestBuilder.WriteStartElement("paymer2purse"); // <paymer2purse>

            xmlRequestBuilder.WriteElement("purse", Purse.ToString());

            xmlRequestBuilder.WriteStartElement("paymer"); // <paymer>
            xmlRequestBuilder.WriteElement("number", Number);
            xmlRequestBuilder.WriteElement("code", Code);
            xmlRequestBuilder.WriteEndElement(); // </paymer>

            xmlRequestBuilder.WriteEndElement(); // </paymer2purse>
        }