Example #1
0
        internal override void ConfigureContainer(ConfiguredServices services)
        {
            base.ConfigureContainer(services);

            if (string.IsNullOrEmpty(ServiceUrl))
            {
                if (Environment.Equals(Entities.Environment.TEST))
                {
                    ServiceUrl = ServiceEndpoints.TRANSIT_MULTIPASS_TEST;
                }
                else
                {
                    ServiceUrl = ServiceEndpoints.TRANSIT_MULTIPASS_PRODUCTION;
                }
            }

            var gateway = new TransitConnector()
            {
                AcceptorConfig = AcceptorConfig,
                DeveloperId    = DeveloperId,
                DeviceId       = DeviceId,
                MerchantId     = MerchantId,
                TransactionKey = TransactionKey,
                ServiceUrl     = ServiceUrl,
                Timeout        = Timeout,
                RequestLogger  = RequestLogger
            };

            services.GatewayConnector = gateway;
        }
Example #2
0
        public static string GenerateTransactionKey(Environment environment, string merchantId, string userId, string password, string transactionKey = null)
        {
            var connector = new TransitConnector {
                MerchantId     = merchantId,
                TransactionKey = transactionKey,
                ServiceUrl     = environment.Equals(Environment.PRODUCTION) ? ServiceEndpoints.TRANSIT_MULTIPASS_PRODUCTION: ServiceEndpoints.TRANSIT_MULTIPASS_TEST,
                Timeout        = 10000
            };

            return(connector.GenerateKey(userId, password));
        }