Ejemplo n.º 1
0
        internal override void ConfigureContainer(ConfiguredServices services)
        {
            if (string.IsNullOrEmpty(ServiceUrl))
            {
                if (Environment.Equals(Entities.Environment.TEST))
                {
                    ServiceUrl = ServiceEndpoints.GP_API_TEST;
                }
                else
                {
                    ServiceUrl = ServiceEndpoints.GP_API_PRODUCTION;
                }
            }

            var gpApiConfig = new GpApiConfig
            {
                AppId                    = AppId,
                AppKey                   = AppKey,
                SecondsToExpire          = SecondsToExpire,
                IntervalToExpire         = IntervalToExpire,
                Channel                  = Channel,
                Language                 = Language,
                Country                  = Country,
                ServiceUrl               = ServiceUrl,
                Timeout                  = Timeout,
                Permissions              = Permissions,
                MethodNotificationUrl    = MethodNotificationUrl,
                RequestLogger            = RequestLogger,
                MerchantContactUrl       = MerchantContactUrl,
                ChallengeNotificationUrl = ChallengeNotificationUrl,
                WebProxy                 = WebProxy,
                DynamicHeaders           = DynamicHeaders,
                MerchantId               = MerchantId,
                AccessTokenInfo          = AccessTokenInfo,
            };

            var gateway = new GpApiConnector(gpApiConfig);

            services.GatewayConnector = gateway;

            services.ReportingService = gateway;

            services.SetSecure3dProvider(Secure3dVersion.One, gateway);
            services.SetSecure3dProvider(Secure3dVersion.Two, gateway);
        }
Ejemplo n.º 2
0
        internal override void ConfigureContainer(ConfiguredServices services)
        {
            if (string.IsNullOrEmpty(ServiceUrl))
            {
                if (Environment.Equals(Entities.Environment.TEST))
                {
                    ServiceUrl = ServiceEndpoints.GP_API_TEST;
                }
                else
                {
                    ServiceUrl = ServiceEndpoints.GP_API_PRODUCTION;
                }
            }

            var gateway = new GpApiConnector {
                AppId                            = AppId,
                AppKey                           = AppKey,
                SecondsToExpire                  = SecondsToExpire,
                IntervalToExpire                 = IntervalToExpire,
                Channel                          = Channel,
                Language                         = Language,
                Country                          = Country,
                ServiceUrl                       = ServiceUrl,
                Timeout                          = Timeout,
                Permissions                      = Permissions,
                AccessToken                      = AccessTokenInfo?.Token,
                DataAccountName                  = AccessTokenInfo?.DataAccountName,
                DisputeManagementAccountName     = AccessTokenInfo?.DisputeManagementAccountName,
                TokenizationAccountName          = AccessTokenInfo?.TokenizationAccountName,
                TransactionProcessingAccountName = AccessTokenInfo?.TransactionProcessingAccountName,
                ChallengeNotificationUrl         = ChallengeNotificationUrl,
                MethodNotificationUrl            = MethodNotificationUrl,
                RequestLogger                    = RequestLogger,
                WebProxy                         = WebProxy,
            };

            services.GatewayConnector = gateway;

            services.ReportingService = gateway;

            services.SetSecure3dProvider(Secure3dVersion.One, gateway);
            services.SetSecure3dProvider(Secure3dVersion.Two, gateway);
        }
Ejemplo n.º 3
0
        internal override void ConfigureContainer(ConfiguredServices services)
        {
            base.ConfigureContainer(services);

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

            var gateway = new GpEcomConnector {
                AccountId           = AccountId,
                Channel             = Channel,
                MerchantId          = MerchantId,
                RebatePassword      = RebatePassword,
                RefundPassword      = RefundPassword,
                SharedSecret        = SharedSecret,
                Timeout             = Timeout,
                ServiceUrl          = ServiceUrl,
                HostedPaymentConfig = HostedPaymentConfig,
                RequestLogger       = RequestLogger,
                WebProxy            = WebProxy
            };

            services.GatewayConnector   = gateway;
            services.RecurringConnector = gateway;

            // set reporting gateway
            if (!UseDataReportingService)
            {
                services.ReportingService = gateway;
            }

            // 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,
                    RequestLogger = RequestLogger,
                    WebProxy      = WebProxy
                                    //secure3d2.EnableLogging = EnableLogging
                };

                services.SetSecure3dProvider(Entities.Secure3dVersion.Two, secure3d2);
            }
        }
Ejemplo n.º 4
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;
            }
        }