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

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

            var gateway = new PorticoConnector {
                SiteId         = SiteId,
                LicenseId      = LicenseId,
                DeviceId       = DeviceId,
                Username       = Username,
                Password       = Password,
                SecretApiKey   = SecretApiKey,
                DeveloperId    = DeveloperId,
                VersionNumber  = VersionNumber,
                Timeout        = Timeout,
                ServiceUrl     = ServiceUrl + "/Hps.Exchange.PosGateway/PosGatewayService.asmx",
                UniqueDeviceId = UniqueDeviceId,
                RequestLogger  = RequestLogger
            };

            services.GatewayConnector = gateway;

            // no data connector
            if (string.IsNullOrEmpty(DataClientId))
            {
                services.ReportingService = gateway;
            }

            var payplan = new PayPlanConnector {
                SecretApiKey  = SecretApiKey,
                Timeout       = Timeout,
                ServiceUrl    = ServiceUrl + PayPlanEndpoint,
                RequestLogger = RequestLogger
            };

            services.RecurringConnector = payplan;
        }
Example #2
0
        internal override void ConfigureContainer(ConfiguredServices services)
        {
            if (!string.IsNullOrEmpty(MerchantId))
            {
                var gateway = new RealexConnector {
                    AccountId           = AccountId,
                    Channel             = Channel,
                    MerchantId          = MerchantId,
                    RebatePassword      = RebatePassword,
                    RefundPassword      = RefundPassword,
                    SharedSecret        = SharedSecret,
                    Timeout             = Timeout,
                    ServiceUrl          = ServiceUrl,
                    HostedPaymentConfig = HostedPaymentConfig
                };
                services.GatewayConnector   = gateway;
                services.RecurringConnector = gateway;
            }
            else
            {
                var gateway = new PorticoConnector {
                    SiteId        = SiteId,
                    LicenseId     = LicenseId,
                    DeviceId      = DeviceId,
                    Username      = Username,
                    Password      = Password,
                    SecretApiKey  = SecretApiKey,
                    DeveloperId   = DeveloperId,
                    VersionNumber = VersionNumber,
                    Timeout       = Timeout,
                    ServiceUrl    = ServiceUrl + "/Hps.Exchange.PosGateway/PosGatewayService.asmx"
                };
                services.GatewayConnector = gateway;

                var payplan = new PayPlanConnector {
                    SecretApiKey = SecretApiKey,
                    Timeout      = Timeout,
                    ServiceUrl   = ServiceUrl + "/Portico.PayPlan.v2/"
                };
                services.RecurringConnector = payplan;
            }
        }
Example #3
0
        internal override void ConfigureContainer(ConfiguredServices services)
        {
            if (!string.IsNullOrEmpty(MerchantId))
            {
                var gateway = new RealexConnector {
                    AccountId           = AccountId,
                    Channel             = Channel,
                    MerchantId          = MerchantId,
                    RebatePassword      = RebatePassword,
                    RefundPassword      = RefundPassword,
                    SharedSecret        = SharedSecret,
                    Timeout             = Timeout,
                    ServiceUrl          = ServiceUrl,
                    HostedPaymentConfig = HostedPaymentConfig,
                    OpenPathApiKey      = OpenPathApiKey,
                    OpenPathApiUrl      = OpenPathApiUrl
                };
                services.GatewayConnector   = gateway;
                services.RecurringConnector = gateway;

                var reportingService = new DataServicesConnector {
                    ClientId     = DataClientId,
                    ClientSecret = DataClientSecret,
                    UserId       = DataClientUserId,
                    ServiceUrl   = DataClientSeviceUrl ?? "https://globalpay-test.apigee.net/apis/reporting/",
                    Timeout      = Timeout
                };
                services.ReportingService = reportingService;
            }
            else
            {
                var gateway = new PorticoConnector {
                    SiteId         = SiteId,
                    LicenseId      = LicenseId,
                    DeviceId       = DeviceId,
                    Username       = Username,
                    Password       = Password,
                    SecretApiKey   = SecretApiKey,
                    DeveloperId    = DeveloperId,
                    VersionNumber  = VersionNumber,
                    Timeout        = Timeout,
                    ServiceUrl     = ServiceUrl + "/Hps.Exchange.PosGateway/PosGatewayService.asmx",
                    UniqueDeviceId = UniqueDeviceId,
                    OpenPathApiKey = OpenPathApiKey,
                    OpenPathApiUrl = OpenPathApiUrl
                };
                services.GatewayConnector = gateway;

                if (!string.IsNullOrEmpty(DataClientId))
                {
                    services.ReportingService = new DataServicesConnector {
                        ClientId     = DataClientId,
                        ClientSecret = DataClientSecret,
                        UserId       = DataClientUserId,
                        ServiceUrl   = DataClientSeviceUrl ?? "https://globalpay-test.apigee.net/apis/reporting/",
                        Timeout      = Timeout
                    };
                }
                else
                {
                    services.ReportingService = gateway;
                }

                var payplan = new PayPlanConnector {
                    SecretApiKey = SecretApiKey,
                    Timeout      = Timeout,
                    ServiceUrl   = ServiceUrl + getPayPlanEndpoint(SecretApiKey)
                };
                services.RecurringConnector = payplan;
            }
        }
Example #4
0
        internal override void ConfigureContainer(ConfiguredServices services)
        {
            base.ConfigureContainer(services);

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

            var gateway = new PorticoConnector {
                SiteId         = SiteId,
                LicenseId      = LicenseId,
                DeviceId       = DeviceId,
                Username       = Username,
                Password       = Password,
                SecretApiKey   = SecretApiKey,
                DeveloperId    = DeveloperId,
                VersionNumber  = VersionNumber,
                Timeout        = Timeout,
                ServiceUrl     = ServiceUrl + "/Hps.Exchange.PosGateway/PosGatewayService.asmx",
                UniqueDeviceId = UniqueDeviceId,
                RequestLogger  = RequestLogger
            };

            services.GatewayConnector = gateway;

            // no data connector
            if (string.IsNullOrEmpty(DataClientId))
            {
                services.ReportingService = gateway;
            }

            var payplan = new PayPlanConnector {
                SecretApiKey  = SecretApiKey,
                Timeout       = Timeout,
                ServiceUrl    = ServiceUrl + PayPlanEndpoint,
                RequestLogger = RequestLogger
            };

            services.RecurringConnector = payplan;

            // ProPay Connector
            if (CertificationStr != null && CertificationStr.Length > 0)
            {
                if (Environment == Entities.Environment.TEST)
                {
                    ServiceUrl = ProPayUS ? ServiceEndpoints.PROPAY_TEST : ServiceEndpoints.PROPAY_TEST_CANADIAN;
                }
                else
                {
                    ServiceUrl = ProPayUS ? ServiceEndpoints.PROPAY_PRODUCTION : ServiceEndpoints.PROPAY_PRODUCTION_CANADIAN;
                }

                var payFac = new ProPayConnector()
                {
                    CertStr      = CertificationStr,
                    TermID       = TerminalID,
                    Timeout      = Timeout,
                    ServiceUrl   = ServiceUrl,
                    X509CertPath = X509CertificatePath
                };

                services.PayFacProvider = payFac;
            }
        }
Example #5
0
        internal override void ConfigureContainer(ConfiguredServices services)
        {
            if (!string.IsNullOrEmpty(MerchantId))
            {
                if (string.IsNullOrEmpty(ServiceUrl))
                {
                    if (Environment.Equals(Entities.Environment.TEST))
                    {
                        ServiceUrl = ServiceEndpoints.GLOBAL_ECOM_TEST;
                    }
                    else
                    {
                        ServiceUrl = ServiceEndpoints.GLOBAL_ECOM_PRODUCTION;
                    }
                }

                var gateway = new RealexConnector {
                    AccountId           = AccountId,
                    Channel             = Channel,
                    MerchantId          = MerchantId,
                    RebatePassword      = RebatePassword,
                    RefundPassword      = RefundPassword,
                    SharedSecret        = SharedSecret,
                    Timeout             = Timeout,
                    ServiceUrl          = ServiceUrl,
                    HostedPaymentConfig = HostedPaymentConfig
                };
                services.GatewayConnector   = gateway;
                services.RecurringConnector = gateway;

                var reportingService = new DataServicesConnector {
                    ClientId     = DataClientId,
                    ClientSecret = DataClientSecret,
                    UserId       = DataClientUserId,
                    ServiceUrl   = DataClientSeviceUrl ?? "https://globalpay-test.apigee.net/apis/reporting/",
                    Timeout      = Timeout
                };
                services.ReportingService = reportingService;

                // set default
                if (Secure3dVersion == null)
                {
                    Secure3dVersion = Entities.Secure3dVersion.One;
                }

                // secure 3d v1
                if (Secure3dVersion.Equals(Entities.Secure3dVersion.One) || Secure3dVersion.Equals(Entities.Secure3dVersion.Any))
                {
                    services.SetSecure3dProvider(Entities.Secure3dVersion.One, gateway);
                }

                // secure 3d v2
                if (Secure3dVersion.Equals(Entities.Secure3dVersion.Two) || Secure3dVersion.Equals(Entities.Secure3dVersion.Any))
                {
                    Gp3DSProvider secure3d2 = new Gp3DSProvider {
                        MerchantId               = MerchantId,
                        AccountId                = AccountId,
                        SharedSecret             = SharedSecret,
                        ServiceUrl               = Environment.Equals(Entities.Environment.TEST) ? ServiceEndpoints.THREE_DS_AUTH_TEST : ServiceEndpoints.THREE_DS_AUTH_PRODUCTION,
                        MerchantContactUrl       = MerchantContactUrl,
                        MethodNotificationUrl    = MethodNotificationUrl,
                        ChallengeNotificationUrl = ChallengeNotificationUrl,
                        Timeout = Timeout
                                  //secure3d2.EnableLogging = EnableLogging
                    };

                    services.SetSecure3dProvider(Entities.Secure3dVersion.Two, secure3d2);
                }
            }
            else
            {
                if (string.IsNullOrEmpty(ServiceUrl))
                {
                    if (Environment.Equals(Entities.Environment.TEST))
                    {
                        ServiceUrl = ServiceEndpoints.PORTICO_TEST;
                    }
                    else
                    {
                        ServiceUrl = ServiceEndpoints.PORTICO_PRODUCTION;
                    }
                }

                var gateway = new PorticoConnector {
                    SiteId         = SiteId,
                    LicenseId      = LicenseId,
                    DeviceId       = DeviceId,
                    Username       = Username,
                    Password       = Password,
                    SecretApiKey   = SecretApiKey,
                    DeveloperId    = DeveloperId,
                    VersionNumber  = VersionNumber,
                    Timeout        = Timeout,
                    ServiceUrl     = ServiceUrl + "/Hps.Exchange.PosGateway/PosGatewayService.asmx",
                    UniqueDeviceId = UniqueDeviceId
                };
                services.GatewayConnector = gateway;

                if (!string.IsNullOrEmpty(DataClientId))
                {
                    services.ReportingService = new DataServicesConnector {
                        ClientId     = DataClientId,
                        ClientSecret = DataClientSecret,
                        UserId       = DataClientUserId,
                        ServiceUrl   = DataClientSeviceUrl ?? "https://globalpay-test.apigee.net/apis/reporting/",
                        Timeout      = Timeout
                    };
                }
                else
                {
                    services.ReportingService = gateway;
                }

                var payplan = new PayPlanConnector {
                    SecretApiKey = SecretApiKey,
                    Timeout      = Timeout,
                    ServiceUrl   = ServiceUrl + getPayPlanEndpoint(SecretApiKey)
                };
                services.RecurringConnector = payplan;
            }
        }