Skip to content

Instantly share code, notes, and snippets.

@bdunn313
Created January 8, 2020 14:19
Show Gist options
  • Save bdunn313/92ab466b3682539befbd8c165321ee16 to your computer and use it in GitHub Desktop.
Save bdunn313/92ab466b3682539befbd8c165321ee16 to your computer and use it in GitHub Desktop.
originalLegalEntity not serialized properly in WorldPay C# SDK
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<legalEntityCreateRequest
xmlns="http://preprod-url">
<legalEntityName>Yarrgh Pirate Co.</legalEntityName>
<legalEntityType>INDIVIDUAL_SOLE_PROPRIETORSHIP</legalEntityType>
<legalEntityOwnershipType>PRIVATE</legalEntityOwnershipType>
<doingBusinessAs>Jolly Roger Services</doingBusinessAs>
<taxId>551351516</taxId>
<contactPhone>5555555555</contactPhone>
<annualCreditCardSalesVolume>0</annualCreditCardSalesVolume>
<hasAcceptedCreditCards>false</hasAcceptedCreditCards>
<address>
<streetAddress1>2223 Executive Dr</streetAddress1>
<streetAddress2>Suite 104</streetAddress2>
<city>Detroit</city>
<stateProvince>MI</stateProvince>
<postalCode>48201</postalCode>
<countryCode>USA</countryCode>
</address>
<principal>
<firstName>Joeya</firstName>
<lastName>Schmoeya</lastName>
<emailAddress>joe2a@example.com</emailAddress>
<ssn>111111113</ssn>
<contactPhone>1111111111</contactPhone>
<dateOfBirth>1982-01-31</dateOfBirth>
<address>
<streetAddress1>900 Chelmsford St</streetAddress1>
<streetAddress2>Ste 5</streetAddress2>
<city>Royal Oak</city>
<stateProvince>MI</stateProvince>
<postalCode>48067</postalCode>
<countryCode>USA</countryCode>
</address>
<stakePercent>100</stakePercent>
</principal>
<yearsInBusiness>0</yearsInBusiness>
</legalEntityCreateRequest>
<legalEntityCreateResponse xmlns="http://preprod-url" duplicate="true">
<transactionId>83982920810924792</transactionId>
<originalLegalEntityId>83982920810690989</originalLegalEntityId>
<originalLegalEntityStatus>Approved</originalLegalEntityStatus>
</legalEntityCreateResponse>
var request = new legalEntityCreateRequest
{
legalEntityName = "Yarrgh Pirate Co.",
legalEntityType = legalEntityType.LIMITED_LIABILITY_COMPANY,
legalEntityOwnershipType = legalEntityOwnershipType.PRIVATE,
doingBusinessAs = "Jolly Roger Services",
taxId = "551351516",
contactPhone = "5555555555",
annualCreditCardSalesVolume = "0",
hasAcceptedCreditCards = false,
address = new address()
{
streetAddress1 = "2223 Executive Dr",
city = "Suite 104",
stateProvince = "Detroit",
postalCode = "48201",
countryCode = "USA"
},
principal = new legalEntityPrincipal
{
firstName = "Joeya",
lastName = "Schmoeya",
emailAddress = "joe2a@example.com",
ssn = "111111113",
contactPhone = "1111111111",
dateOfBirth = (new DateTime(1982, 1, 31)).Value,
address = new principalAddress()
{
streetAddress1 = "900 Chelmsford St",
streetAddress2 = "Ste 5",
city = "Royal Oak",
stateProvince = "MI",
postalCode = "48067",
countryCode = "USA"
},
stakePercent = 100
},
yearsInBusiness = "0",
};
var response = request.PostLegalEntityCreateRequest();
if (respose.legalEntityId == null) {
Assert.True(response.orignallegalEntityId, null);
Assert.True(response.originallegalEntityStatus, null);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment