Esempio n. 1
0
        public static string[] AllocateVouchers(HeaderNP header, int countryId, int retailerId, string postId, int volume,
                                                string originator, out int from, out int to)
        {
            using (var service = new Server())
            {
                var allocationId = service.AllocateRangePOS(
                    header,
                    countryId: countryId,
                    retailerId: retailerId,
                    posId: postId,
                    orderVolume: volume,
                    originator: originator);

                var allocation = service.RetrieveAllocation(header, allocationId);
                from = allocation.RangeFrom;
                to   = allocation.RangeTo;

                List <string> vouchers = new List <string>();

                for (int voucher = allocation.RangeFrom / 10; voucher <= allocation.RangeTo / 10; voucher++)
                {
                    vouchers.Add(voucher.ToString());
                }

                return(vouchers.ToArray());
            }
        }
Esempio n. 2
0
 public static bool CheckTerminalValid(HeaderNP header, int countryId, int retailerId, string postId)
 {
     using (var service = new Server())
     {
         var valid = service.CheckTerminalValid(header, countryId: countryId, retailerId: retailerId, posId: postId);
         return(valid);
     }
 }
Esempio n. 3
0
 public static string CalculateCheckDigit(HeaderNP header, int Id)
 {
     using (var service = new Server())
     {
         var retailerId = service.CalculateCheckDigit(header, Id);
         return(retailerId);
     }
 }