Beispiel #1
0
        public SSLCommerzService(ISSLCommerzConfig config, ILogger <SSLCommerzService> logger)
        {
            System.Net.ServicePointManager.SecurityProtocol = Tls12;
            this.logger = logger;
            this.config = config;

            this.SSLCommerzBaseUrl = config.IsDevelopmentMode ? config.SSLCommerzSandboxBaseUrl : config.SSLCommerzBaseUrl;
        }
Beispiel #2
0
        public SSLCommerzHttpClient(ISSLCommerzConfig config)
        {
            var httpClientHandler = new HttpClientHandler
            {
                ServerCertificateCustomValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true
            };

            Http = new HttpClient(httpClientHandler)
            {
                BaseAddress = new Uri(config.BaseUrl)
            };
            Http.DefaultRequestHeaders.Accept.Clear();
            Http.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
        }
Beispiel #3
0
 public PaymentsController(
     IMapper mapper,
     ISSLCommerzConfig config,
     ICartService cartService,
     ISSLCommerzService sslCommerzService,
     ICustomerTransactionService customerTransactionService,
     ICustomerTransactionSessionService customerTransactionSessionService
     )
 {
     _mapper                            = mapper;
     _config                            = config;
     _cartService                       = cartService;
     _sslCommerzService                 = sslCommerzService;
     _customerTransactionService        = customerTransactionService;
     _customerTransactionSessionService = customerTransactionSessionService;
 }
 public SSLCommerzService(SSLCommerzHttpClient httpClient, ISSLCommerzConfig config)
 {
     _httpClient = httpClient;
     _http       = httpClient.Http;
     _config     = config;
 }