Beispiel #1
0
        public void TestPutLegalEntityUpdateRequestSimple()
        {
            legalEntityId = "201003";
            request       = new legalEntityUpdateRequest
            {
                address = new addressUpdatable
                {
                    streetAddress1 = "LE Street Address 1",
                    streetAddress2 = "LE Street Address 2",
                    city           = "LE City",
                    stateProvince  = "MA",
                    postalCode     = "01730",
                    countryCode    = "USA",
                },
                contactPhone                = "9785550101",
                doingBusinessAs             = "Other Name Co.",
                annualCreditCardSalesVolume = 10000000,
                hasAcceptedCreditCards      = true,
                principal = new legalEntityPrincipalUpdatable
                {
                    principalId  = 9,
                    title        = "CEO",
                    emailAddress = "*****@*****.**",
                    contactPhone = "9785551234",
                    address      = new principalAddress
                    {
                        streetAddress1 = "p street address 1",
                        streetAddress2 = "p street address 2",
                        city           = "Boston",
                        stateProvince  = "MA",
                        postalCode     = "01890",
                        countryCode    = "USA",
                    },
                    backgroundCheckFields = new principalBackgroundCheckFields
                    {
                        firstName           = "p first",
                        lastName            = "p last",
                        ssn                 = "123459876",
                        dateOfBirth         = new DateTime(1980, 10, 12),
                        driversLicense      = "892327409832",
                        driversLicenseState = "MA"
                    },
                },
                backgroundCheckFields = new legalEntityBackgroundCheckFields
                {
                    legalEntityName = "Company Name",
                    legalEntityType = legalEntityType.INDIVIDUAL_SOLE_PROPRIETORSHIP,
                    taxId           = "123456789"
                },
                legalEntityOwnershipType = legalEntityOwnershipType.PUBLIC,
                yearsInBusiness          = "10"
            };

            response = request.PutLegalEntityUpdateRequest(legalEntityId);
            Assert.NotNull(response.transactionId);
            Assert.AreEqual(10, response.responseCode);
            Assert.AreEqual("Approved", response.responseDescription);
            Assert.AreEqual("201003", response.legalEntityId);
        }
Beispiel #2
0
 public void TestPutLegalEntityUpdateRequestErrorResponse400()
 {
     legalEntityId = "201400";
     request       = new legalEntityUpdateRequest
     {
         address = new addressUpdatable
         {
             streetAddress1 = "LE Street Address 1",
             streetAddress2 = "LE Street Address 2",
             city           = "LE City",
             stateProvince  = "MA",
             postalCode     = "01730",
             countryCode    = "USA",
         },
         contactPhone                = "9785550101",
         doingBusinessAs             = "Other Name Co.",
         annualCreditCardSalesVolume = 10000000,
         hasAcceptedCreditCards      = true,
         principal = new legalEntityPrincipalUpdatable
         {
             principalId  = 9,
             title        = "CEO",
             emailAddress = "*****@*****.**",
             contactPhone = "9785551234",
             address      = new principalAddress
             {
                 streetAddress1 = "p street address 1",
                 streetAddress2 = "p street address 2",
                 city           = "Boston",
                 stateProvince  = "MA",
                 postalCode     = "01890",
                 countryCode    = "USA",
             },
             backgroundCheckFields = new principalBackgroundCheckFields
             {
                 firstName           = "p first",
                 lastName            = "p last",
                 ssn                 = "123459876",
                 dateOfBirth         = new DateTime(1980, 10, 12),
                 driversLicense      = "892327409832",
                 driversLicenseState = "MA"
             },
         },
         backgroundCheckFields = new legalEntityBackgroundCheckFields
         {
             legalEntityName = "Company Name",
             legalEntityType = legalEntityType.INDIVIDUAL_SOLE_PROPRIETORSHIP,
             taxId           = "123456789"
         },
         legalEntityOwnershipType = legalEntityOwnershipType.PUBLIC,
         yearsInBusiness          = "10"
     };
     try
     {
         response = request.PutLegalEntityUpdateRequest(legalEntityId);
         Assert.Fail("PayfacWebException expected, None thrown");
     }
     catch (PayFacWebException ex)
     {
         errorResponse errorResponse = ex.errorResponse;
         Assert.NotNull(errorResponse.transactionId);
         Assert.AreEqual("Could not find requested object.", errorResponse.errors[0]);
     }
 }
Beispiel #3
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
            };
        }