public GeneralSettings()
 {
     SmtpSettings           = new SmtpSettings();
     CryptoLicenseSettings  = new CryptoLicenseSettings();
     EmailSettings          = new EmailSettings();
     PayPalSettings         = new PayPalSettings();
     ProductProfileSettings = new ProductProfileSettings();
 }
        static GlobalSettings()
        {
            IConfigurationProvider configurationProvider = new WebConfigurationProvider();

            ClientSettings  = new GlobalClientSettings(configurationProvider);
            UmbracoSettings = new GlobalUmbracoSettings(configurationProvider);
            PayPalSettings  = new PayPalSettings(configurationProvider);
        }
예제 #3
0
        public PayPalAccountInfo(PayPalSettings settings, IAPIProfile profile, CallerServices caller)
        {
            this.settings = settings;
            this.caller   = caller;

            profile.APIUsername  = settings.Username;
            profile.APIPassword  = settings.Password;
            profile.APISignature = settings.Signature;
            profile.Environment  = settings.Environment;

            caller.APIProfile = profile;
        }
        public PaypalDirectPaymentProcessor(CreditCard creditCard, PayPalSettings settings)
        {
            this.settings = settings;
            this.caller   = caller;

            profile.APIUsername  = settings.Username;
            profile.APIPassword  = settings.Password;
            profile.APISignature = settings.Signature;
            profile.Environment  = settings.Environment;

            caller.APIProfile = profile;
            this.creditCard = creditCard;
        }
예제 #5
0
        public IdentityInitializer(
            EasyShopContext dbContext,
            RoleManager <IdentityRole> roleManager,
            UserManager <AppUser> userManager,
            IConfiguration configuration,
            PayPalSettings payPalSettings)
        {
            _dbContext     = dbContext;
            _roleManager   = roleManager;
            _userManager   = userManager;
            _configuration = configuration;

            _percentPerTransaction = configuration.GetValue <int>("ServicePercentPerTransaction") + payPalSettings.Fees;
        }
예제 #6
0
        public RustShopSalesService(
            EasyShopContext easyShopContext,
            UserManager <AppUser> userManager,
            IHttpContextAccessor httpContextAccessor,
            IRustShopService rustShopService,
            IConfiguration configuration,
            PayPalSettings payPalSettings)
        {
            _easyShopContext = easyShopContext;
            _configuration   = configuration;
            _payPalSettings  = payPalSettings;

            _currentRequestAppUser =
                userManager.FindByEmailAsync(httpContextAccessor.HttpContext.User.Identity.Name).Result;
        }
 public RustStoreStandardProductPurchaseService(
     ISteamUserService steamUserService,
     EasyShopContext easyShopContext,
     IRustShopService rustShopService,
     UserManager <AppUser> userManager,
     ILogger <RustStoreStandardProductPurchaseService> logger,
     PayPalSettings payPalSettings,
     IConfiguration configuration)
 {
     _steamUserService             = steamUserService;
     _easyShopContext              = easyShopContext;
     _rustShopService              = rustShopService;
     _userManager                  = userManager;
     _logger                       = logger;
     _servicePercentPerTransaction =
         configuration.GetValue <int>("ServicePercentPerTransaction") + payPalSettings.Fees;
 }
        public PayPalAuthenticationService(
            IConfiguration configuration,
            PayPalSettings payPalSettings,
            UserManager <AppUser> userManager,
            IHttpContextAccessor httpContextAccessor,
            ILogger <PayPalAuthenticationService> logger)
        {
            var credentialsTextBytes = Encoding.UTF8.GetBytes($"{payPalSettings.ClientId}:{payPalSettings.ClientSecret}");

            _userCredentialsBase64 = Convert.ToBase64String(credentialsTextBytes);

            _configuration       = configuration;
            _httpContextAccessor = httpContextAccessor;
            _logger = logger;

            _currentRequestUser = userManager.FindByEmailAsync(httpContextAccessor.HttpContext.User.Identity.Name).Result;
        }
        public void ShouldDoSomething()
        {
            var parser     = new FileIniDataParser();
            var parsedData = parser.ReadFile(@"../../../LicenseGeneratorWorkflowDataFiles/LicenseGeneratorWorkflow.ini");

            var smtpSettings = new SmtpSettings();

            smtpSettings.Server   = parsedData["SMTP"].GetKeyData("smtpServer").Value;
            smtpSettings.Port     = Convert.ToInt32(parsedData["SMTP"].GetKeyData("smtpPort").Value);
            smtpSettings.UseSsl   = Convert.ToBoolean(parsedData["SMTP"].GetKeyData("smtpUseSsl").Value);
            smtpSettings.Username = parsedData["SMTP"].GetKeyData("smtpUsername").Value;
            smtpSettings.Password = parsedData["SMTP"].GetKeyData("smtpPassword").Value;

            var cryptoLicenseSettings = new CryptoLicenseSettings();

            cryptoLicenseSettings.LicenseCode         = parsedData["CryptoLicensing"].GetKeyData("LicenseCode").Value;
            cryptoLicenseSettings.LicenseFileLocation = parsedData["CryptoLicensing"].GetKeyData("LicenseFileLocation").Value;

            var emailSettings = new EmailSettings();

            emailSettings.Subject = parsedData["Email"].GetKeyData("Subject").Value;
            emailSettings.EndUserEmailTemaplateFileLocation = parsedData["Email"].GetKeyData("EndUserEmailTemaplateFileLocation").Value;
            emailSettings.ProductName = parsedData["Email"].GetKeyData("ProductName").Value;
            emailSettings.From        = parsedData["Email"].GetKeyData("From").Value;

            var cryptoLicenseGeneratorWrapper = new CryptoLicenseGeneratorWrapper(cryptoLicenseSettings);
            var emailSender            = new EmailSender(smtpSettings);
            var userLicenseEmail       = new UserLicenseEmail(emailSettings, new TemplateToMessageConverter(), new EmailTemplatePlaceholders());
            var adminLicenseEmail      = new AdminLicenseEmail(emailSettings, new TemplateToMessageConverter(), new EmailTemplatePlaceholders());
            var paypalSettings         = new PayPalSettings();
            var paypalValidation       = new PaypalIpnValidation(paypalSettings);
            var productProfileSettings = new ProductProfileSettings();

            var licenseWorkflow = new PaypalLicenseWorkflow(
                cryptoLicenseGeneratorWrapper,
                emailSender,
                userLicenseEmail,
                paypalValidation,
                productProfileSettings);

            var payPalInfo = new PayPalInfo();

            licenseWorkflow.Run(payPalInfo);
            Assert.True(true);
        }
예제 #10
0
 public RustStoreStorePaymentService(IHttpContextAccessor httpContextAccessor,
                                     IConfiguration configuration,
                                     ILogger <RustStoreStorePaymentService> logger,
                                     PayPalSettings payPalSettings,
                                     ISteamUserService steamUserService,
                                     EasyShopContext easyShopContext,
                                     IPayPalCreatedPaymentService payPalCreatedPaymentService,
                                     IPayPalExecutedPaymentService payPalExecutedPaymentService)
 {
     _httpContextAccessor = httpContextAccessor;
     _configuration       = configuration;
     _logger                       = logger;
     _payPalSettings               = payPalSettings;
     _steamUserService             = steamUserService;
     _easyShopContext              = easyShopContext;
     _payPalCreatedPaymentService  = payPalCreatedPaymentService;
     _payPalExecutedPaymentService = payPalExecutedPaymentService;
     _hostString                   = $"{httpContextAccessor.HttpContext.Request.Scheme}://{httpContextAccessor.HttpContext.Request.Host}";
     _multiTenantContext           = httpContextAccessor.HttpContext.GetMultiTenantContext();
 }
        public void ShouldValidateIpn()
        {
            var payPalSettings = new PayPalSettings();

            payPalSettings.IpnValidationUrl = "https://www.sandbox.paypal.com/cgi-bin/webscr";

            var paypalIpnValidation = new PaypalIpnValidation(payPalSettings);
            //var paypalInfo = new PayPalInfo(
            //    "*****@*****.**",
            //    "MCP",
            //    1,
            //    "1",
            //    "",
            //    "60084167VS558930E",
            //    "web_accept",
            //    "*****@*****.**",
            //    "test account's Test Store";
            //var paypalInfo = new PayPalInfo("","",1,1,1,"","","","");


            //paypalIpnValidation.EnsureValid(paypalInfo);
        }
예제 #12
0
 public PaymentsService(CoursesP2PDbContext db, IOptions <PayPalSettings> settings)
 {
     this.db       = db;
     this.settings = settings.Value;
 }
 public PaypalIpnValidation(PayPalSettings payPalSettings)
 {
     _payPalSettings = payPalSettings;
 }
예제 #14
0
 public PayPalAccountInfo(PayPalSettings settings)
     : this(settings, 
     ProfileFactory.createSignatureAPIProfile(), 
     new CallerServices())
 {
 }
예제 #15
0
 public PayPal(PayPalSettings settings)
 {
     Settings = settings;
 }