public void TestPostSubMerchantCreateRequestSimple()
        {
            legalEntityId = "201003";

            request = new subMerchantCreateRequest
            {
                merchantName        = "Merchant Name",
                amexMid             = "12345",
                discoverConveyedMid = "123456789012345",
                url = "http://merchantUrl",
                customerServiceNumber      = "8407809000",
                hardCodedBillingDescriptor = "billing Descriptor",
                maxTransactionAmount       = 8400,
                purchaseCurrency           = "USD",
                merchantCategoryCode       = "5964",
                bankRoutingNumber          = "840123124",
                bankAccountNumber          = "84012312415",
                pspMerchantId = "123456",
                fraud         = new subMerchantFraudFeature
                {
                    enabled = true
                },
                amexAcquired = new subMerchantAmexAcquiredFeature
                {
                    enabled = false
                },
                address = new address
                {
                    streetAddress1 = "Street Address 1",
                    streetAddress2 = "Street Address 2",
                    city           = "City",
                    stateProvince  = "MA",
                    postalCode     = "01970",
                    countryCode    = "USA"
                },
                primaryContact = new subMerchantPrimaryContact
                {
                    firstName    = "Josh",
                    lastName     = "Doe",
                    emailAddress = "*****@*****.**",
                    phone        = "9785552222"
                },
                createCredentials = true,
                eCheck            = new subMerchantECheckFeature
                {
                    enabled                 = true,
                    eCheckCompanyName       = "Company Name",
                    eCheckBillingDescriptor = "9785552222"
                },
                subMerchantFunding = new subMerchantFunding
                {
                    enabled = false
                },
                settlementCurrency = "USD"
            };

            response = request.PostSubMerchantCreateRequest(legalEntityId);
            Assert.NotNull(response.transactionId);
        }
Example #2
0
        public void SetUp()
        {
            config = new Configuration();
            config.Set("url", "https://payfac.vantivprelive.com");
            config.Set("username", "SDKMPAPI");
            config.Set("password", "Q2m9X4y6");
            comm = new Communication();

            rand = new Random();

            streetAdrss1ForTest1 = "900 Chelmsford St";
            streetAdrss1ForTest2 = "912 Chelmsford St";
            streetAdrss1ForTest3 = "914 Chelmsford St";
            //Canada Test
            //streetAdrss1ForTestC1_1 = "900 Chelmsford St";
            //streetAdrss1ForTestC1_2 = "900 Chelmsford St";
            //streetAdrss1ForTestC1_3 = "912 Chelmsford St";

            address = new address
            {
                streetAddress1 = "Street Address 1",
                streetAddress2 = "Street Address 2",
                city           = "City",
                stateProvince  = "MA",
                postalCode     = "01970",
                countryCode    = "USA"
            };

            CanadaAddress = new address
            {
                streetAddress1 = null,
                streetAddress2 = "Street Address 2",
                city           = "City",
                stateProvince  = "AB",
                postalCode     = "K1A0B1",
                countryCode    = "CAN"
            };

            legalEntityCreateRequest = new legalEntityCreateRequest
            {
                legalEntityName          = "test legalentity",
                legalEntityType          = legalEntityType.INDIVIDUAL_SOLE_PROPRIETORSHIP,
                legalEntityOwnershipType = legalEntityOwnershipType.PRIVATE,
                doingBusinessAs          = "Alternate Business Name",
                taxId        = (100000000 + 900000) + "",
                contactPhone = "7817659800",
                annualCreditCardSalesVolume = "500000",
                hasAcceptedCreditCards      = true,
                address   = address,
                principal = new legalEntityPrincipal
                {
                    title          = "Chief Financial Officer",
                    firstName      = "p first",
                    lastName       = "p last",
                    emailAddress   = "*****@*****.**",
                    ssn            = "123459876",
                    contactPhone   = "7817659800",
                    dateOfBirth    = new DateTime(1980, 10, 12),
                    driversLicense = "892327409832",
                    address        = new principalAddress
                    {
                        streetAddress1 = "Street Address 1",
                        streetAddress2 = "Street Address 2",
                        city           = "Boston",
                        stateProvince  = "MA",
                        postalCode     = "01890",
                        countryCode    = "USA"
                    },
                    stakePercent = 100
                },
                yearsInBusiness = "12"
            };

            legalEntityCreateRequest.Configuration = config;
            legalEntityCreateRequest.Communication = comm;

            addressUpdatable = new addressUpdatable
            {
                streetAddress1 = "Street Address 1",
                streetAddress2 = "Street Address 2",
                city           = "City",
                stateProvince  = "MA",
                postalCode     = "01970",
                countryCode    = "USA"
            };

            principalAddress = new principalAddress
            {
                streetAddress1 = "Street Address 1",
                streetAddress2 = "Street Address 2",
                city           = "City",
                stateProvince  = "MA",
                postalCode     = "01970",
                countryCode    = "USA"
            };

            legalEntityUpdateRequest = new legalEntityUpdateRequest
            {
                address                     = addressUpdatable,
                contactPhone                = "77",
                doingBusinessAs             = "Alternate Business Name",
                annualCreditCardSalesVolume = 100000000,
                hasAcceptedCreditCards      = true,
                principal                   = new legalEntityPrincipalUpdatable
                {
                    title        = "CEO",
                    principalId  = 1,
                    emailAddress = "*****@*****.**",
                    contactPhone = "11",
                    address      = principalAddress
                }
            };

            legalEntityUpdateRequest.Configuration = config;
            legalEntityUpdateRequest.Communication = comm;

            legalEntityPrincipalUpdatable = new legalEntityPrincipalUpdatable
            {
                title        = "CEO",
                principalId  = 1,
                emailAddress = "*****@*****.**",
                contactPhone = "11",
                address      = principalAddress
            };

            legalEntityBackgroundCheckFields = new legalEntityBackgroundCheckFields
            {
                legalEntityName = "Company Name",
                legalEntityType = legalEntityType.INDIVIDUAL_SOLE_PROPRIETORSHIP,
                taxId           = "123456789"
            };

            subMerchantFunding = new subMerchantFunding
            {
                fundingSubmerchantId = "AUTO_GENERATE",
                enabled = true
            };

            subMerchantCreateRequest = new subMerchantCreateRequest
            {
                subMerchantFunding = subMerchantFunding,
                merchantName       = "name",
                url = "url",
                customerServiceNumber      = "1234567894",
                hardCodedBillingDescriptor = "SDK*",
                maxTransactionAmount       = 123,
                merchantCategoryCode       = "5137",
                bankRoutingNumber          = "211370545",
                bankAccountNumber          = "84012312415",
                pspMerchantId      = (100 + rand.Next(900)) + "",
                settlementCurrency = "USD",
                address            = address,
            };
            subMerchantCreateRequest.Communication = comm;
            subMerchantCreateRequest.Configuration = config;

            subMerchantPrimaryContactUpdatable = new subMerchantPrimaryContactUpdatable
            {
                firstName = "John",
                lastName  = "Doe",
                phone     = "9785552222"
            };

            subMerchantUpdateRequest = new subMerchantUpdateRequest
            {
                amexMid             = "1234567890",
                discoverConveyedMid = "123456789012345",
                url = "http://merchantUrl",
                customerServiceNumber      = "8407809000",
                hardCodedBillingDescriptor = "SDK*",
                maxTransactionAmount       = 84001,
                bankRoutingNumber          = "211370545",
                bankAccountNumber          = "84012312415",
                pspMerchantId    = (100 + rand.Next(900)) + "",
                purchaseCurrency = "USD",
                address          = addressUpdatable,
                primaryContact   = subMerchantPrimaryContactUpdatable
            };
        }
        public void TestPostSubMerchantCreateRequestErrorResponse503()
        {
            legalEntityId = "2010503";

            request = new subMerchantCreateRequest
            {
                merchantName        = "duplicate not matching",
                amexMid             = "1234567890",
                discoverConveyedMid = "123456789012345",
                url = "http://merchantUrl",
                customerServiceNumber      = "8407809000",
                hardCodedBillingDescriptor = "billing Descriptor",
                maxTransactionAmount       = 8400,
                purchaseCurrency           = "USD",
                merchantCategoryCode       = "5964",
                bankRoutingNumber          = "840123124",
                bankAccountNumber          = "84012312415",
                pspMerchantId = "123456",
                fraud         = new subMerchantFraudFeature
                {
                    enabled = true
                },
                amexAcquired = new subMerchantAmexAcquiredFeature
                {
                    enabled = false
                },
                address = new address
                {
                    streetAddress1 = "Street Address 1",
                    streetAddress2 = "Street Address 2",
                    city           = "City",
                    stateProvince  = "MA",
                    postalCode     = "01970",
                    countryCode    = "USA"
                },
                primaryContact = new subMerchantPrimaryContact
                {
                    firstName    = "Josh",
                    lastName     = "Doe",
                    emailAddress = "*****@*****.**",
                    phone        = "9785552222"
                },
                createCredentials = true,
                eCheck            = new subMerchantECheckFeature
                {
                    enabled                 = true,
                    eCheckCompanyName       = "Company Name",
                    eCheckBillingDescriptor = "9785552222"
                },
                subMerchantFunding = new subMerchantFunding
                {
                    enabled = false
                },
                settlementCurrency = "USD"
            };

            try
            {
                response = request.PostSubMerchantCreateRequest(legalEntityId);
                Assert.Fail("PayfacWebException expected, None thrown");
            }
            catch (PayFacWebException ex)
            {
                errorResponse errorResponse = ex.errorResponse;
                Assert.NotNull(errorResponse.transactionId);
                Assert.AreEqual("Service was unavailable.", errorResponse.errors[0]);
            }
        }