public TPaySecupayManager(TPaySecupayConfig config)
 {
     Config  = config;
     Context = new PaySecupayContext(config.ConnectionString, config.Username);
     if (EventLog.Exists("pay.secupay"))
     {
         EventLog.CreateEventSource("Application", "pay.secupay");
     }
 }
Example #2
0
        internal static InitRequestDtoRoot CreateInitRequestDtoRoot(PaySecupayInit secupayInit, TPaySecupayConfig config)
        {
            InitRequestDtoRoot root = new InitRequestDtoRoot
            {
                Data = new InitRequestDtoData
                {
                    ApiKey = secupayInit.ApiKey,
                    Amount = secupayInit.Amount,
                    Currency = secupayInit.Currency,
                    ApiVersion = secupayInit.ApiVersion,

                    Title = secupayInit.Title,
                    Firstname = secupayInit.Firstname,
                    Lastname = secupayInit.Lastname,
                    Company = secupayInit.Company,
                    Street = secupayInit.Street,
                    Housenumber = secupayInit.Housenumber,
                    Zip = secupayInit.Zip,
                    City = secupayInit.City,
                    Country = secupayInit.Country,
                    Telephone = secupayInit.Telephone,
                    Dob = secupayInit.Dob,

                    Demo = secupayInit.Demo,
                    Email = secupayInit.Email,
                    Ip = secupayInit.Ip,
                    Langauge = secupayInit.Langauge,
                    ModulVersion = secupayInit.ModulVersion,
                    Note = secupayInit.Note,
                    OrderId = secupayInit.OrderId,
                    PaymentAction = secupayInit.PaymentAction,
                    PaymentType = secupayInit.PaymentType,
                    Purpose = secupayInit.Purpose,
                    Shop = secupayInit.Shop,
                    ShopVersion = secupayInit.ShopVersion,
                    UrlFailure = secupayInit.UrlFailure,
                    UrlPush = secupayInit.UrlPush,
                    UrlSuccess = secupayInit.UrlSuccess
                }
            };

            if (secupayInit.DeliveryAddress != null && config.SendDeliveryAddress)
            {
                root.Data.DeliveryAddress = new InitRequestDtoDeliveryAddress
                {
                    Firstname = secupayInit.DeliveryAddress.Firstname,
                    Lastname = secupayInit.DeliveryAddress.Lastname,
                    Company = secupayInit.DeliveryAddress.Company,
                    Street = secupayInit.DeliveryAddress.Street,
                    Housenumber = secupayInit.DeliveryAddress.Housenumber,
                    Zip = secupayInit.DeliveryAddress.Zip,
                    City = secupayInit.DeliveryAddress.City,
                    Country = secupayInit.DeliveryAddress.Country,
                };
            }

            if (secupayInit.Basket != null && secupayInit.Basket.Any())
            {
                root.Data.Basket = new List<InitRequestDtoBasket>();
                foreach (var b in secupayInit.Basket)
                {
                    root.Data.Basket.Add(new InitRequestDtoBasket
                    {
                        ArticleNumber = b.ArticleNumber,
                        Model = b.Model,
                        Ean = b.Ean,
                        Name = b.Name,
                        Price = b.Price,
                        Quantity = b.Quantity,
                        Tax = b.Tax,
                        Total = b.Total
                    });
                }
            }

            return root;
        }
Example #3
0
 public TPayFactory(TPaySecupayConfig config)
 {
     Config = config;
 }
 public TPaySecupayManager(TPaySecupayConfig config)
 {
     Config = config;
     Context = new PaySecupayContext(config.ConnectionString, config.Username);
     if (EventLog.Exists("pay.secupay")) EventLog.CreateEventSource("Application", "pay.secupay");
 }
Example #5
0
 public TPayFactory(TPaySecupayConfig config)
 {
     Config = config;
 }
Example #6
0
        internal static InitRequestDtoRoot CreateInitRequestDtoRoot(PaySecupayInit secupayInit, TPaySecupayConfig config)
        {
            InitRequestDtoRoot root = new InitRequestDtoRoot
            {
                Data = new InitRequestDtoData
                {
                    ApiKey     = secupayInit.ApiKey,
                    Amount     = secupayInit.Amount,
                    Currency   = secupayInit.Currency,
                    ApiVersion = secupayInit.ApiVersion,

                    Title       = secupayInit.Title,
                    Firstname   = secupayInit.Firstname,
                    Lastname    = secupayInit.Lastname,
                    Company     = secupayInit.Company,
                    Street      = secupayInit.Street,
                    Housenumber = secupayInit.Housenumber,
                    Zip         = secupayInit.Zip,
                    City        = secupayInit.City,
                    Country     = secupayInit.Country,
                    Telephone   = secupayInit.Telephone,
                    Dob         = secupayInit.Dob,

                    Demo          = secupayInit.Demo,
                    Email         = secupayInit.Email,
                    Ip            = secupayInit.Ip,
                    Langauge      = secupayInit.Langauge,
                    ModulVersion  = secupayInit.ModulVersion,
                    Note          = secupayInit.Note,
                    OrderId       = secupayInit.OrderId,
                    PaymentAction = secupayInit.PaymentAction,
                    PaymentType   = secupayInit.PaymentType,
                    Purpose       = secupayInit.Purpose,
                    Shop          = secupayInit.Shop,
                    ShopVersion   = secupayInit.ShopVersion,
                    UrlFailure    = secupayInit.UrlFailure,
                    UrlPush       = secupayInit.UrlPush,
                    UrlSuccess    = secupayInit.UrlSuccess
                }
            };

            if (secupayInit.DeliveryAddress != null && config.SendDeliveryAddress)
            {
                root.Data.DeliveryAddress = new InitRequestDtoDeliveryAddress
                {
                    Firstname   = secupayInit.DeliveryAddress.Firstname,
                    Lastname    = secupayInit.DeliveryAddress.Lastname,
                    Company     = secupayInit.DeliveryAddress.Company,
                    Street      = secupayInit.DeliveryAddress.Street,
                    Housenumber = secupayInit.DeliveryAddress.Housenumber,
                    Zip         = secupayInit.DeliveryAddress.Zip,
                    City        = secupayInit.DeliveryAddress.City,
                    Country     = secupayInit.DeliveryAddress.Country,
                };
            }

            if (secupayInit.Basket != null && secupayInit.Basket.Any())
            {
                root.Data.Basket = new List <InitRequestDtoBasket>();
                foreach (var b in secupayInit.Basket)
                {
                    root.Data.Basket.Add(new InitRequestDtoBasket
                    {
                        ArticleNumber = b.ArticleNumber,
                        Model         = b.Model,
                        Ean           = b.Ean,
                        Name          = b.Name,
                        Price         = b.Price,
                        Quantity      = b.Quantity,
                        Tax           = b.Tax,
                        Total         = b.Total
                    });
                }
            }

            return(root);
        }