Example #1
0
        public void TestInitialize()
        {
            var config = new GpEcomConfig {
                MerchantId        = "openbankingsandbox",
                SharedSecret      = "sharedsecret",
                AccountId         = "internet",
                EnableBankPayment = true,
                ShaHashType       = ShaHashType.SHA512,
                RequestLogger     = new RequestConsoleLogger()
            };

            ServicesContainer.ConfigureService(config);
        }
        public GpEcomReportingTest()
        {
            var config = new GpEcomConfig {
                MerchantId     = "heartlandgpsandbox",
                AccountId      = "api",
                SharedSecret   = "secret",
                RebatePassword = "******",
                RefundPassword = "******",
                ServiceUrl     = "https://api.sandbox.realexpayments.com/epage-remote.cgi",
            };

            ServicesContainer.ConfigureService(config);
        }
Example #3
0
        public void Init()
        {
            var config = new GpEcomConfig {
                MerchantId     = "heartlandgpsandbox",
                AccountId      = "api",
                SharedSecret   = "secret",
                RebatePassword = "******",
                RefundPassword = "******"
            };

            ServicesContainer.ConfigureService(config);

            config.AccountId = "apidcc";
            ServicesContainer.ConfigureService(config, "dcc");

            card = new CreditCardData {
                Number         = "4111111111111111",
                ExpMonth       = 12,
                ExpYear        = 2025,
                Cvn            = "123",
                CardHolderName = "Joe Smith"
            };
        }
Example #4
0
        public void OpenBanking_FasterPaymentsCharge_AllSHATypes()
        {
            foreach (ShaHashType shaHashType in Enum.GetValues(typeof(ShaHashType)))
            {
                var config = new GpEcomConfig {
                    MerchantId        = "openbankingsandbox",
                    SharedSecret      = "sharedsecret",
                    AccountId         = "internet",
                    EnableBankPayment = true,
                    ShaHashType       = shaHashType,
                    RequestLogger     = new RequestConsoleLogger()
                };

                ServicesContainer.ConfigureService(config, shaHashType.ToString());

                var bankPayment = FasterPaymentsConfig();

                var transaction = bankPayment.Charge(AMOUNT)
                                  .WithCurrency(CURRENCY)
                                  .WithRemittanceReference(RemittanceReferenceType.TEXT, "Nike Bounce Shoes")
                                  .Execute(shaHashType.ToString());

                AssertTransactionResponse(transaction);

                Thread.Sleep(2000);

                var detail = ReportingService.BankPaymentDetail(transaction.BankPaymentResponse.Id, 1, 10)
                             .Execute(shaHashType.ToString());

                Assert.IsNotNull(detail);
                Assert.IsNull(detail.Results[0].BankPaymentResponse.SortCode);
                Assert.IsNull(detail.Results[0].BankPaymentResponse.AccountNumber);
                Assert.IsNull(detail.Results[0].BankPaymentResponse.AccountName);
                Assert.IsNull(detail.Results[0].BankPaymentResponse.Iban);
            }
        }
Example #5
0
        public GpEcomSecure3dServiceExemptionTests()
        {
            GatewayConfig config = new GpEcomConfig {
                MerchantId               = "myMerchantId",
                AccountId                = "ecomeos",
                SharedSecret             = "secret",
                MethodNotificationUrl    = "https://www.example.com/methodNotificationUrl",
                ChallengeNotificationUrl = "https://www.example.com/challengeNotificationUrl",
                Secure3dVersion          = Secure3dVersion.Any,
            };

            ServicesContainer.ConfigureService(config);

            // create card data
            card = new CreditCardData {
                Number         = "4263970000005262",
                ExpMonth       = 12,
                ExpYear        = 2025,
                CardHolderName = "John Smith"
            };

            // stored card
            stored = new RecurringPaymentMethod(
                "20190809-Realex",
                "20190809-Realex-Credit"
                );

            // shipping address
            shippingAddress = new Address {
                StreetAddress1 = "Apartment 852",
                StreetAddress2 = "Complex 741",
                StreetAddress3 = "no",
                City           = "Chicago",
                PostalCode     = "5001",
                State          = "IL",
                CountryCode    = "840"
            };

            // billing address
            billingAddress = new Address {
                StreetAddress1 = "Flat 456",
                StreetAddress2 = "House 789",
                StreetAddress3 = "no",
                City           = "Halifax",
                PostalCode     = "W5 9HR",
                CountryCode    = "826"
            };

            // browser data
            browserData = new BrowserData {
                AcceptHeader        = "text/html,application/xhtml+xml,application/xml;q=9,image/webp,img/apng,*/*;q=0.8",
                ColorDepth          = ColorDepth.TWENTY_FOUR_BITS,
                IpAddress           = "123.123.123.123",
                JavaEnabled         = true,
                Language            = "en",
                ScreenHeight        = 1080,
                ScreenWidth         = 1920,
                ChallengeWindowSize = ChallengeWindowSize.WINDOWED_600X400,
                Timezone            = "0",
                UserAgent           = "Mozilla/5.0 (Windows NT 6.1; Win64, x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
            };
        }
Example #6
0
 public HostedService(GpEcomConfig config, string configName = "default")
 {
     _config = config;
     ServicesContainer.ConfigureService(config, configName);
 }
Example #7
0
 public HostedService(GpEcomConfig config)
 {
     _config = config;
     ServicesContainer.ConfigureService(config);
 }