Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
CHANGELOG
---------

## 14.0.1
* **Feature** Support for Merchant Category Code - Payfac MP API version 14.0.1

## 14.0.0
* **Feature** Support for Payfac MP API version 14.0
* **Change** Package structure is changed from 'com.mp.sdk' to 'io.github.vantiv.mp.sdk' to support Sonatype repository for publishing artifacts.
Expand Down
18 changes: 10 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ sourceSets {


dependencies {
implementation group:'com.jcraft', name:'jsch', version:'0.1.54'
implementation group:'commons-io', name:'commons-io', version:'2.5'
implementation group:'org.apache.httpcomponents', name:'httpclient', version:'4.5.2'
implementation group: 'com.jcraft', name: 'jsch', version: '0.1.54'
implementation group: 'commons-io', name: 'commons-io', version: '2.5'
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.2'
//implementation group: 'org.apache.httpcomponents.client5', name: 'httpclient5', version: '5.2.1'
testImplementation group: 'junit', name: 'junit', version: '4.12'
implementation group: 'org.jacoco', name: 'org.jacoco.agent', version: '0.8.1'
generateJAXB group:'com.sun.xml.bind', name:'jaxb-core', version:'2.2.7'
generateJAXB group:'com.sun.xml.bind', name:'jaxb-impl', version:'2.2.5-5'
generateJAXB group:'com.sun.xml.bind', name:'jaxb-xjc', version:'2.2.5'
implementation group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.1'
implementation group: 'org.jacoco', name: 'org.jacoco.agent', version: '0.8.1'
generateJAXB group: 'com.sun.xml.bind', name: 'jaxb-core', version: '2.2.7'
generateJAXB group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '2.2.5-5'
generateJAXB group: 'com.sun.xml.bind', name: 'jaxb-xjc', version: '2.2.5'
generateJAXB group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.11.0'
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
JAR_VERSION=14.0.0
JAR_VERSION=14.0.1
SCHEMA_VERSION=14
JAR_NAME=payfac-mp-sdk-java
DIST_DIR=kit/dist
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/github/vantiv/mp/sdk/Versions.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

public class Versions {
public static final String language = "java";
public static final String sdkVersion = "14.0.0";
public static final String sdkVersion = "14.0.1";
}
16 changes: 16 additions & 0 deletions src/main/xsd/merchant-onboard-api-v14.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@
</xs:simpleType>
</xs:element>

<xs:element name="merchantCategoryCode" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="4"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="sdkVersion" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
Expand Down Expand Up @@ -1029,6 +1037,14 @@
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="merchantCategoryCode" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="4"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>

Expand Down
107 changes: 107 additions & 0 deletions src/test/java/io/github/vantiv/mp/sdk/unitTest/TestCommunication.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import io.github.vantiv.mp.sdk.Configuration;
import io.github.vantiv.mp.sdk.LegalEntityCreateResponse;
import io.github.vantiv.mp.sdk.LegalEntityResponse;
import io.github.vantiv.mp.sdk.PayFacWebException;
import io.github.vantiv.mp.sdk.PrincipalDeleteResponse;
import io.github.vantiv.mp.sdk.XMLConverters;

Expand Down Expand Up @@ -107,6 +108,7 @@ public void testHttpPutRequest(){
"\t\t<legalEntityName>Company Name</legalEntityName>\n" +
"\t\t<legalEntityType>INDIVIDUAL_SOLE_PROPRIETORSHIP</legalEntityType>\n" +
"\t\t<taxId>123456789</taxId>\n" +
"\t\t<merchantCategoryCode>9322</merchantCategoryCode>\n" +
"\t</backgroundCheckFields>\n" +
"\t<legalEntityOwnershipType>PUBLIC</legalEntityOwnershipType>\n" +
"\t<yearsInBusiness>10</yearsInBusiness>\n" +
Expand Down Expand Up @@ -159,6 +161,7 @@ public void testHttpPostRequest(){
"\t<stakePercent>33</stakePercent>\n" +
"</principal>\n" +
"<yearsInBusiness>12</yearsInBusiness>\n" +
"<merchantCategoryCode>9322</merchantCategoryCode>\n" +
"</legalEntityCreateRequest>";
String response = communication.httpPostRequest(xmlRequest,"https://www.testvantivcnp.com/sandbox/payfac/legalentity");
LegalEntityCreateResponse legalEntityCreateResponse = XMLConverters.generateCreateResponse(response);
Expand All @@ -177,4 +180,108 @@ public void testHttpDeleteRequest(){
assertEquals("Legal Entity Principal successfully deleted",principalDeleteResponse.getResponseDescription());

}
@Test(expected = PayFacWebException.class)
public void testHttpPostRequestForMcc(){
String xmlRequest = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" +
"<legalEntityCreateRequest xmlns=\"http://payfac.vantivcnp.com/api/merchant/onboard\">\n" +
"<legalEntityName>Legal Entity Name</legalEntityName>\n" +
"<legalEntityType>CORPORATION</legalEntityType>\n" +
"<legalEntityOwnershipType>PUBLIC</legalEntityOwnershipType>\n" +
"<doingBusinessAs>Alternate Business Name</doingBusinessAs>\n" +
"<taxId>123456789</taxId>\n" +
"<contactPhone>7817659800</contactPhone>\n" +
"<annualCreditCardSalesVolume>80000000</annualCreditCardSalesVolume>\n" +
"<hasAcceptedCreditCards>true</hasAcceptedCreditCards>\n" +
"<address>\n" +
"\t<streetAddress1>Street Address 1</streetAddress1>\n" +
"\t<streetAddress2>Street Address 2</streetAddress2>\n" +
"\t<city>City</city>\n" +
"\t<stateProvince>MA</stateProvince>\n" +
"\t<postalCode>01730</postalCode>\n" +
"\t<countryCode>USA</countryCode>\n" +
"</address>\n" +
"<principal>\n" +
"\t\t<title>Chief Financial Officer</title>\n" +
"\t<firstName>p first</firstName>\n" +
"\t<lastName>p last</lastName>\n" +
"\t<emailAddress>emailAddress</emailAddress>\n" +
"\t<ssn>123459876</ssn>\n" +
"\t<contactPhone>7817659800</contactPhone>\n" +
"\t<dateOfBirth>1980-10-12</dateOfBirth>\n" +
"\t<driversLicense>892327409832</driversLicense>\n" +
"\t<driversLicenseState>MA</driversLicenseState>\n" +
"\t<address>\n" +
"\t\t<streetAddress1>p street address 1</streetAddress1>\n" +
"\t\t<streetAddress2>p street address 2</streetAddress2>\n" +
"\t\t<city>Boston</city>\n" +
"\t\t<stateProvince>MA</stateProvince>\n" +
"\t\t<postalCode>01890</postalCode>\n" +
"\t\t<countryCode>USA</countryCode>\n" +
"\t</address>\n" +
"\t<stakePercent>33</stakePercent>\n" +
"</principal>\n" +
"<yearsInBusiness>12</yearsInBusiness>\n" +
"<merchantCategoryCode>gjy</merchantCategoryCode>\n" +
"</legalEntityCreateRequest>";
String response = communication.httpPostRequest(xmlRequest,"https://www.testvantivcnp.com/sandbox/payfac/legalentity");
LegalEntityCreateResponse legalEntityCreateResponse = XMLConverters.generateCreateResponse(response);
assertNotNull(legalEntityCreateResponse.getTransactionId());
assertNotNull(legalEntityCreateResponse.getLegalEntityId());
assertEquals((short)10,(short)legalEntityCreateResponse.getResponseCode());
}

@Test(expected = PayFacWebException.class)
public void testHttpPutRequestForMcc(){
String xmlRequest = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" +
"<legalEntityUpdateRequest\n" +
"\txmlns=\"http://payfac.vantivcnp.com/api/merchant/onboard\">\n" +
"\t<address>\n" +
"\t\t<streetAddress1>LE Street Address 1</streetAddress1>\n" +
"\t\t<streetAddress2>LE Street Address 2</streetAddress2>\n" +
"\t\t<city>LE City</city>\n" +
"\t\t<stateProvince>MA</stateProvince>\n" +
"\t\t<postalCode>01730</postalCode>\n" +
"\t\t<countryCode>USA</countryCode>\n" +
"\t</address>\n" +
"\t<contactPhone>9785550101</contactPhone>\n" +
"\t<doingBusinessAs>Other Name Co.</doingBusinessAs>\n" +
"\t<annualCreditCardSalesVolume>10000000</annualCreditCardSalesVolume>\n" +
"\t<hasAcceptedCreditCards>true</hasAcceptedCreditCards>\n" +
"\t<principal>\n" +
"\t\t<principalId>9</principalId>\n" +
"\t\t<title>CEO</title>\n" +
"\t\t<emailAddress>[email protected]</emailAddress>\n" +
"\t\t<contactPhone>9785551234</contactPhone>\n" +
"\t\t<address>\n" +
"\t\t\t<streetAddress1>p street address 1</streetAddress1>\n" +
"\t\t\t<streetAddress2>p street address 2</streetAddress2>\n" +
"\t\t\t<city>Boston</city>\n" +
"\t\t\t<stateProvince>MA</stateProvince>\n" +
"\t\t\t<postalCode>01890</postalCode>\n" +
"\t\t\t<countryCode>USA</countryCode>\n" +
"\t\t</address>\n" +
"\t\t<backgroundCheckFields>\n" +
"\t\t\t<firstName>p first</firstName>\n" +
"\t\t\t<lastName>p last</lastName>\n" +
"\t\t\t<ssn>123459876</ssn>\n" +
"\t\t\t<dateOfBirth>1980-10-12</dateOfBirth>\n" +
"\t\t\t<driversLicense>892327409832</driversLicense>\n" +
"\t\t\t<driversLicenseState>MA</driversLicenseState>\n" +
"\t\t</backgroundCheckFields>\n" +
"\t</principal>\n" +
"\t<backgroundCheckFields>\n" +
"\t\t<legalEntityName>Company Name</legalEntityName>\n" +
"\t\t<legalEntityType>INDIVIDUAL_SOLE_PROPRIETORSHIP</legalEntityType>\n" +
"\t\t<taxId>123456789</taxId>\n" +
"\t\t<merchantCategoryCode>gjy</merchantCategoryCode>\n" +
"\t</backgroundCheckFields>\n" +
"\t<legalEntityOwnershipType>PUBLIC</legalEntityOwnershipType>\n" +
"\t<yearsInBusiness>10</yearsInBusiness>\n" +
"</legalEntityUpdateRequest>";
String response = communication.httpPutRequest(xmlRequest,"https://www.testvantivcnp.com/sandbox/payfac/legalentity/1000293");
LegalEntityResponse legalEntityResponse = XMLConverters.generateLegalEntityResponse(response);
assertNotNull(legalEntityResponse.getTransactionId());
assertEquals("1000293",legalEntityResponse.getLegalEntityId());
assertEquals((short)10,(short)legalEntityResponse.getResponseCode());
}
}