コード例 #1
0
 public TPaySecupayManager(TPaySecupayConfig config)
 {
     Config  = config;
     Context = new PaySecupayContext(config.ConnectionString, config.Username);
     if (EventLog.Exists("pay.secupay"))
     {
         EventLog.CreateEventSource("Application", "pay.secupay");
     }
 }
コード例 #2
0
ファイル: TDtoFactory.cs プロジェクト: karlhaak/pay.secupay
        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;
        }
コード例 #3
0
 public TPayFactory(TPaySecupayConfig config)
 {
     Config = config;
 }
コード例 #4
0
 public TPaySecupayManager(TPaySecupayConfig config)
 {
     Config = config;
     Context = new PaySecupayContext(config.ConnectionString, config.Username);
     if (EventLog.Exists("pay.secupay")) EventLog.CreateEventSource("Application", "pay.secupay");
 }
コード例 #5
0
ファイル: TPayFactory.cs プロジェクト: karlhaak/pay.secupay
 public TPayFactory(TPaySecupayConfig config)
 {
     Config = config;
 }
コード例 #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);
        }