public void Create(MscMcomPool mscMcomPool) { MscMcomConfig mscMcomConfig = _iMComConfigRepository.GetMComConfig(); mscMcomPool.IsAsynchronous = true; mscMcomPool.ProcessStatus = "S"; mscMcomPool.ResponseStatus = "INITIAL"; if (mscMcomConfig.IsSynchronized) { mscMcomPool.IsAsynchronous = !mscMcomConfig.IsSynchronized; } if (_isBatch) { mscMcomPool.IsAsynchronous = !mscMcomConfig.IsBatchSynchronized; } if (!mscMcomPool.IsAsynchronous) { IOperation operation = _iOperationFactory.GetOperation(mscMcomPool.ActionType); operation.Create(mscMcomPool); mscMcomPool.ProcessStatus = "C"; } _iTransactionRepository.CreatePoolItem(mscMcomPool); }
public ApiController(MscMcomConfig mcomConfig, IAuthAuthentication authAuthentication, IRestyClient iRestClient) { _mcomConfig = mcomConfig; _authAuthentication = authAuthentication; _restClient = iRestClient; }
public OAuthAuthentication(MscMcomConfig iMcomConfig, ICerteficateReader certeficateReader, SecurityProtocolType securityProtocolType) { this.clientId = iMcomConfig.ConsumerKey; this.password = iMcomConfig.KeyPassword; this.filePath = iMcomConfig.CertPath; this.xmlStringPrivateKey = certeficateReader.GetPrivateKey(filePath, password); this.encoder = new UTF8Encoding(); ServicePointManager.SecurityProtocol = securityProtocolType; }
public MscMcomConfig GetMComConfig() { //Db connecttion var iMComConfig = new MscMcomConfig(); iMComConfig.ConsumerKey = "E12Oa2VeIBRLNjGqYibjip0JQqOc88y9eTrfkT8c214972e8!efe18b12a3ce40b989a2f887b971f85d0000000000000000"; iMComConfig.KeyPassword = "******"; iMComConfig.CertPath = @"C:\Users\emrah.mersinli\Desktop\MasterCOM\Isbank-sandbox.p12"; iMComConfig.BaseUrl = "https://sandbox.api.mastercard.com"; iMComConfig.UserAgentVersion = "MasterCard-Mastercom:0.0.5"; iMComConfig.UrlVersionNumber = "/mastercom/v1/"; iMComConfig.Environment = "SANDBOX"; return(iMComConfig); }
public void SetUp() { iMcomConfig = new MscMcomConfig(); iMcomConfig.BaseUrl = "BaseUrl"; iMcomConfig.ConsumerKey = "ConsumerKey"; iMcomConfig.KeyPassword = "******"; iMcomConfig.CertPath = @"CertPath"; iMcomConfig.BaseUrl = "BaseUrl"; iMcomConfig.UserAgentVersion = "UserAgentVersion"; iMcomConfig.UrlVersionNumber = "UrlVersionNumber"; iMcomConfig.Environment = "Environment"; iCerteficateReaderMock = new Mock <ICerteficateReader>(); iCerteficateReaderMock.Setup(f => f.GetPrivateKey(It.IsAny <String>(), It.IsAny <String>())) .Returns(xmlStringPrivateKey); oAuthAuthentication = new OAuthAuthentication(iMcomConfig, iCerteficateReaderMock.Object, SecurityProtocolType.Tls12); iRestRequest = new RestRequest(uri, Method.GET); }