private function generateUpdateMappingXML(UpdateMappingRequest $request)
 {
     $xml = null;
     $xml = "<UpdateMappingRequest>";
     $xml .= "<AccountUsage>" . $request->getAccountUsage() . "</AccountUsage>";
     $xml .= "<DefaultIndicator>" . $request->getDefaultIndicator() . "</DefaultIndicator>";
     $xml .= "<Alias>" . $request->getAlias() . "</Alias>";
     $xml .= "<AccountNumber>" . $request->getAccountNumber() . "</AccountNumber>";
     $xml .= "<ExpiryDate>" . $request->getExpiryDate() . "</ExpiryDate>";
     $xml .= "<CardholderFullName>";
     $xml .= "<CardholderFirstName>" . $request->getCardholderFullName()->getCardholderFirstName() . "</CardholderFirstName>";
     $xml .= "<CardholderMiddleName>" . $request->getCardholderFullName()->getCardholderMiddleName() . "</CardholderMiddleName>";
     $xml .= "<CardholderLastName>" . $request->getCardholderFullName()->getCardholderLastName() . "</CardholderLastName>";
     $xml .= "</CardholderFullName>";
     $xml .= "<Address>";
     $xml .= "<Line1>" . $request->getAddress()->getLine1() . "</Line1>";
     $xml .= "<Line2>" . $request->getAddress()->getLine2() . "</Line2>";
     $xml .= "<City>" . $request->getAddress()->getCity() . "</City>";
     $xml .= "<CountrySubdivision>" . $request->getAddress()->getCountrySubdivision() . "</CountrySubdivision>";
     $xml .= "<PostalCode>" . $request->getAddress()->getPostalCode() . "</PostalCode>";
     $xml .= "<Country>" . $request->getAddress()->getCountry() . "</Country>";
     $xml .= "</Address>";
     $xml .= "<DateOfBirth>" . $request->getDateOfBirth() . "</DateOfBirth>";
     $xml .= "</UpdateMappingRequest>";
     return $xml;
 }
 public function testUpdateMappingServiceTest()
 {
     $inquireRequest = new InquireMappingRequest();
     $inquireRequest->setSubscriberId("*****@*****.**");
     $inquireRequest->setSubscriberType("EMAIL_ADDRESS");
     $inquireMapping = $this->cardMappingService->getInquireMapping($inquireRequest);
     $updateRequest = new \UpdateMappingRequest();
     $updateRequestOptions = new UpdateMappingRequestOptions();
     $updateRequestOptions->setMappingId($inquireMapping->getMappings()->getMapping(0)->getMappingId());
     $address = new \Address();
     $updateRequest->setAccountUsage("RECEIVING");
     $updateRequest->setAccountNumber("5184680430000006");
     $updateRequest->setDefaultIndicator("T");
     $updateRequest->setExpiryDate(201409);
     $updateRequest->setAlias("Debit Card");
     $updateRequest->setAddress($address);
     $updateRequest->getAddress()->setLine1("123 Main Street");
     $updateRequest->getAddress()->setLine2("#5A");
     $updateRequest->getAddress()->setCity("OFallon");
     $updateRequest->getAddress()->setCountrySubdivision("MO");
     $updateRequest->getAddress()->setCountry("USA");
     $updateRequest->getAddress()->setPostalCode(63368);
     $updateRequest->setCardholderFullName(new CardholderFullName());
     $updateRequest->getCardholderFullName()->setCardholderFirstName("John");
     $updateRequest->getCardholderFullName()->setCardholderMiddleName("Q");
     $updateRequest->getCardholderFullName()->setCardholderLastName("Public");
     $updateRequest->setDateOfBirth(19460102);
     $updateMapping = $this->cardMappingService->getUpdateMapping($updateRequest, $updateRequestOptions);
     $this->assertTrue($updateMapping->getRequestId() != null && $updateMapping->getRequestId() > 0);
     $this->assertTrue($updateMapping->getMapping()->getMappingId() > 0);
 }