Exemplo n.º 1
0
        public void test8and15()
        {
            legalEntityCreateRequest.legalEntityType        = legalEntityType.INDIVIDUAL_SOLE_PROPRIETORSHIP;
            legalEntityCreateRequest.address                = address;
            legalEntityCreateRequest.address.streetAddress1 = streetAdrss1ForTest1;
            legalEntityCreateRequest.taxId = (rand.NextDouble() * 9000000000) + 100000000 + "";

            legalEntityCreateResponse responseFromTest1 = legalEntityCreateRequest.PostLegalEntityCreateRequest();
            string legalEntityIdFromTest1 = responseFromTest1.legalEntityId;


            subMerchantCreateResponse responseFromTest8 = subMerchantCreateRequest.PostSubMerchantCreateRequest(legalEntityIdFromTest1);
            string submerchantIdFromTest8 = responseFromTest8.subMerchantId;

            SubMerchantRetrievalRequest subMerchantRetrievalRequest = new SubMerchantRetrievalRequest();

            subMerchantRetrievalRequest.Communication = comm;
            subMerchantRetrievalRequest.Configuration = config;

            try
            {
                subMerchantRetrievalRequest.GetSubMerchantRequest("0", submerchantIdFromTest8);
            } catch (Exception ex)
            {
                Assert.AreEqual("Error in request: Could not find requested object.", ex.Message);
            }
        }
        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);
        }
Exemplo n.º 3
0
 public void test9()
 {
     try
     {
         subMerchantCreateResponse response = subMerchantCreateRequest.PostSubMerchantCreateRequest("0");
     } catch (Exception ex)
     {
         Assert.AreEqual("Request failed - HTTP 400 ErrorError in request: Could not find requested object.", ex.Message);
     }
 }
Exemplo n.º 4
0
        public void test1and8()
        {
            legalEntityCreateRequest.legalEntityType        = legalEntityType.INDIVIDUAL_SOLE_PROPRIETORSHIP;
            legalEntityCreateRequest.address.streetAddress1 = streetAdrss1ForTest1;
            legalEntityCreateRequest.taxId = (rand.NextDouble() * 9000000000) + 100000000 + "";

            legalEntityCreateResponse responseFromTest1 = legalEntityCreateRequest.PostLegalEntityCreateRequest();
            string legalEntityIdFromTest1 = responseFromTest1.legalEntityId;

            subMerchantCreateResponse response = subMerchantCreateRequest.PostSubMerchantCreateRequest(legalEntityIdFromTest1);
        }
Exemplo n.º 5
0
        public void test1and8and14()
        {
            legalEntityCreateRequest.legalEntityType        = legalEntityType.INDIVIDUAL_SOLE_PROPRIETORSHIP;
            legalEntityCreateRequest.address                = address;
            legalEntityCreateRequest.address.streetAddress1 = streetAdrss1ForTest1;
            legalEntityCreateRequest.taxId = (rand.NextDouble() * 9000000000) + 100000000 + "";

            legalEntityCreateResponse responseFromTest1 = legalEntityCreateRequest.PostLegalEntityCreateRequest();
            string legalEntityIdFromTest1 = responseFromTest1.legalEntityId;


            subMerchantCreateResponse responseFromTest8 = subMerchantCreateRequest.PostSubMerchantCreateRequest(legalEntityIdFromTest1);
            string submerchantIdFromTest8 = responseFromTest8.subMerchantId;

            SubMerchantRetrievalRequest subMerchantRetrievalRequest = new SubMerchantRetrievalRequest();

            subMerchantRetrievalRequest.Communication = comm;
            subMerchantRetrievalRequest.Configuration = config;

            subMerchantRetrievalRequest.GetSubMerchantRequest(legalEntityIdFromTest1, submerchantIdFromTest8);
        }
Exemplo n.º 6
0
        public void test1and13()
        {
            legalEntityCreateRequest.legalEntityType        = legalEntityType.INDIVIDUAL_SOLE_PROPRIETORSHIP;
            legalEntityCreateRequest.address                = address;
            legalEntityCreateRequest.address.streetAddress1 = streetAdrss1ForTest1;
            legalEntityCreateRequest.taxId = (rand.NextDouble() * 9000000000) + 100000000 + "";

            legalEntityCreateResponse responseFromTest1 = legalEntityCreateRequest.PostLegalEntityCreateRequest();
            string legalEntityIdFromTest1 = responseFromTest1.legalEntityId;


            subMerchantCreateResponse responseFromTest8 = subMerchantCreateRequest.PostSubMerchantCreateRequest(legalEntityIdFromTest1);
            string submerchantIdFromTest8 = responseFromTest8.subMerchantId;

            try
            {
                subMerchantUpdateRequest.PutSubMerchantUpdateRequest(legalEntityIdFromTest1, "0");
            }
            catch (Exception ex)
            {
                Assert.AreEqual("Error in request: Could not find requested object.", ex.Message);
            }
        }
        public void TestPostSubMerchantCreateRequest()
        {
            var xmlReq = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" +
                         "<subMerchantCreateRequest xmlns=\"http://payfac.vantivcnp.com/api/merchant/onboard\">" +
                         "<merchantName>Merchant Name</merchantName>" +
                         "<amexMid>12345</amexMid>" +
                         "<discoverConveyedMid>123456789012345</discoverConveyedMid>" +
                         "<url>http://merchantUrl</url>" +
                         "<customerServiceNumber>8407809000</customerServiceNumber>" +
                         "<hardCodedBillingDescriptor>billing Descriptor</hardCodedBillingDescriptor>" +
                         "<maxTransactionAmount>8400</maxTransactionAmount>" +
                         "<purchaseCurrency>USD</purchaseCurrency>" +
                         "<merchantCategoryCode>5964</merchantCategoryCode>" +
                         "<bankRoutingNumber>840123124</bankRoutingNumber>" +
                         "<bankAccountNumber>84012312415</bankAccountNumber>" +
                         "<pspMerchantId>123456</pspMerchantId>" +
                         "<fraud enabled=\"true\"></fraud>" +
                         "<amexAcquired enabled=\"false\"></amexAcquired>" +
                         "<address>" +
                         "<streetAddress1>Street Address 1</streetAddress1>" +
                         "<streetAddress2>Street Address 2</streetAddress2>" +
                         "<city>City</city>" +
                         "<stateProvince>MA</stateProvince>" +
                         "<postalCode>01970</postalCode>" +
                         "<countryCode>USA</countryCode>" +
                         "</address>" +
                         "<primaryContact>" +
                         "<firstName>Josh</firstName>" +
                         "<lastName>Doe</lastName>" +
                         "<emailAddress>[email protected]</emailAddress>" +
                         "<phone>9785552222</phone>" +
                         "</primaryContact>" +
                         "<createCredentials>true</createCredentials>" +
                         "<eCheck enabled =\"true\">" +
                         "<eCheckCompanyName>Company Name</eCheckCompanyName>" +
                         "<eCheckBillingDescriptor>9785552222</eCheckBillingDescriptor>" +
                         "</eCheck>" +
                         "<subMerchantFunding enabled =\"false\">" +
                         "</subMerchantFunding>" +
                         "<settlementCurrency>USD</settlementCurrency>" +
                         "<sdkVersion>" + Versions.SDK_VERSION + "</sdkVersion>" +
                         "<language>" + Versions.LANGUAGE + "</language>" +
                         "</subMerchantCreateRequest>";

            string expectedResposne = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" +
                                      "<subMerchantCreateResponse xmlns=\"http://payfac.vantivcnp.com/api/merchant/onboard\">" +
                                      "    <transactionId>6939508653</transactionId>" +
                                      "    <subMerchantId>12271</subMerchantId>" +
                                      "    <merchantIdentString>G1XN3lxPIA</merchantIdentString>" +
                                      "    <credentials>" +
                                      "        <username>JDoe123</username>" +
                                      "        <password>MyPassword</password>" +
                                      "        <passwordExpirationDate>2016-06-30T23:59:59-05:00</passwordExpirationDate>" +
                                      "    </credentials>" +
                                      "    <paypageCredentials>" +
                                      "        <paypageCredential>" +
                                      "            <username>JDoe123</username>" +
                                      "            <paypageId>1234567890123456</paypageId>" +
                                      "        </paypageCredential>" +
                                      "        <paypageCredential>" +
                                      "            <username>JDoe123</username>" +
                                      "            <paypageId>1234567890123456</paypageId>" +
                                      "        </paypageCredential>" +
                                      "    </paypageCredentials>" +
                                      "    <amexSellerId>12345</amexSellerId>" +
                                      "</subMerchantCreateResponse>";


            var mock = new Mock <Communication>();

            mock.Setup(Communication => Communication.Post("/legalentity/201003/submerchant", xmlReq)).Returns(expectedResposne);
            Communication communicationMock = mock.Object;

            request.Communication = communicationMock;
            response = request.PostSubMerchantCreateRequest("201003");
            Assert.NotNull(response.transactionId);
            Assert.NotNull(response.subMerchantId);
        }
        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]);
            }
        }