private function generateTransferXML(TransferRequest $request) { $xml = null; if ($request->getFundingMapped() == null) { $xml = "<TransferRequest>"; $xml .= "<LocalDate>" . $request->getLocalDate() . "</LocalDate>"; $xml .= "<LocalTime>" . $request->getLocalTime() . "</LocalTime>"; $xml .= "<TransactionReference>" . $request->getTransactionReference() . "</TransactionReference>"; $xml .= "<SenderName>" . $request->getSenderName() . "</SenderName>"; $xml .= "<SenderAddress>"; $xml .= "<Line1>" . $request->getSenderAddress()->getLine1() . "</Line1>"; $xml .= "<Line2>" . $request->getSenderAddress()->getLine2() . "</Line2>"; $xml .= "<City>" . $request->getSenderAddress()->getCity() . "</City>"; $xml .= "<CountrySubdivision>" . $request->getSenderAddress()->getCountrySubdivision() . "</CountrySubdivision>"; $xml .= "<PostalCode>" . $request->getSenderAddress()->getPostalCode() . "</PostalCode>"; $xml .= "<Country>" . $request->getSenderAddress()->getCountry() . "</Country>"; $xml .= "</SenderAddress>"; $xml .= "<FundingCard>"; $xml .= "<AccountNumber>" . $request->getFundingCard()->getAccountNumber() . "</AccountNumber>"; $xml .= "<ExpiryMonth>" . $request->getFundingCard()->getExpiryMonth() . "</ExpiryMonth>"; $xml .= "<ExpiryYear>" . $request->getFundingCard()->getExpiryYear() . "</ExpiryYear>"; $xml .= "</FundingCard>"; $xml .= "<FundingUCAF>" . $request->getFundingUCAF() . "</FundingUCAF>"; $xml .= "<FundingMasterCardAssignedId>" . $request->getFundingMasterCardAssignedId() . "</FundingMasterCardAssignedId>"; $xml .= "<FundingAmount>"; $xml .= "<Value>" . $request->getFundingAmount()->getValue() . "</Value>"; $xml .= "<Currency>" . $request->getFundingAmount()->getCurrency() . "</Currency>"; $xml .= "</FundingAmount>"; $xml .= "<ReceiverName>" . $request->getReceiverName() . "</ReceiverName>"; $xml .= "<ReceiverAddress>"; $xml .= "<Line1>" . $request->getReceiverAddress()->getLine1() . "</Line1>"; $xml .= "<Line2>" . $request->getReceiverAddress()->getLine2() . "</Line2>"; $xml .= "<City>" . $request->getReceiverAddress()->getCity() . "</City>"; $xml .= "<PostalCode>" . $request->getReceiverAddress()->getPostalCode() . "</PostalCode>"; $xml .= "<Country>" . $request->getReceiverAddress()->getCountry() . "</Country>"; $xml .= "</ReceiverAddress>"; $xml .= "<ReceiverPhone>" . $request->getReceiverPhone() . "</ReceiverPhone>"; $xml .= "<ReceivingCard>"; $xml .= "<AccountNumber>" . $request->getReceivingCard()->getAccountNumber() . "</AccountNumber>"; $xml .= "</ReceivingCard>"; $xml .= "<ReceivingAmount>"; $xml .= "<Value>" . $request->getReceivingAmount()->getValue() . "</Value>"; $xml .= "<Currency>" . $request->getReceivingAmount()->getCurrency() . "</Currency>"; $xml .= "</ReceivingAmount>"; $xml .= "<Channel>" . $request->getChannel() . "</Channel>"; $xml .= "<UCAFSupport>" . $request->getUCAFSupport() . "</UCAFSupport>"; $xml .= "<ICA>" . $request->getICA() . "</ICA>"; $xml .= "<ProcessorId>" . $request->getProcessorId() . "</ProcessorId>"; $xml .= "<RoutingAndTransitNumber>" . $request->getRoutingAndTransitNumber() . "</RoutingAndTransitNumber>"; $xml .= "<CardAcceptor>"; $xml .= "<Name>" . $request->getCardAcceptor()->getName() . "</Name>"; $xml .= "<City>" . $request->getCardAcceptor()->getCity() . "</City>"; $xml .= "<State>" . $request->getCardAcceptor()->getState() . "</State>"; $xml .= "<PostalCode>" . $request->getCardAcceptor()->getPostalCode() . "</PostalCode>"; $xml .= "<Country>" . $request->getCardAcceptor()->getCountry() . "</Country>"; $xml .= "</CardAcceptor>"; $xml .= "<TransactionDesc>" . $request->getTransactionDesc() . "</TransactionDesc>"; $xml .= "<MerchantId>" . $request->getMerchantId() . "</MerchantId>"; $xml .= "</TransferRequest>"; } else { $xml = "<TransferRequest>"; $xml .= "<LocalDate>" . $request->getLocalDate() . "</LocalDate>"; $xml .= "<LocalTime>" . $request->getLocalTime() . "</LocalTime>"; $xml .= "<TransactionReference>" . $request->getTransactionReference() . "</TransactionReference>"; $xml .= "<FundingMapped>"; $xml .= "<SubscriberId>" . $request->getFundingMapped()->getSubscriberId() . "</SubscriberId>"; $xml .= "<SubscriberType>" . $request->getFundingMapped()->getSubscriberType() . "</SubscriberType>"; $xml .= "<SubscriberAlias>" . $request->getFundingMapped()->getSubscriberAlias() . "</SubscriberAlias>"; $xml .= "</FundingMapped>"; $xml .= "<FundingUCAF>" . $request->getFundingUCAF() . "</FundingUCAF>"; $xml .= "<FundingMasterCardAssignedId>" . $request->getFundingMasterCardAssignedId() . "</FundingMasterCardAssignedId>"; $xml .= "<FundingAmount>"; $xml .= "<Value>" . $request->getFundingAmount()->getValue() . "</Value>"; $xml .= "<Currency>" . $request->getFundingAmount()->getCurrency() . "</Currency>"; $xml .= "</FundingAmount>"; $xml .= "<ReceiverName>" . $request->getReceiverName() . "</ReceiverName>"; $xml .= "<ReceiverAddress>"; $xml .= "<Line1>" . $request->getReceiverAddress()->getLine1() . "</Line1>"; $xml .= "<Line2>" . $request->getReceiverAddress()->getLine2() . "</Line2>"; $xml .= "<City>" . $request->getReceiverAddress()->getCity() . "</City>"; $xml .= "<PostalCode>" . $request->getReceiverAddress()->getPostalCode() . "</PostalCode>"; $xml .= "<Country>" . $request->getReceiverAddress()->getCountry() . "</Country>"; $xml .= "</ReceiverAddress>"; $xml .= "<ReceiverPhone>" . $request->getReceiverPhone() . "</ReceiverPhone>"; $xml .= "<ReceivingCard>"; $xml .= "<AccountNumber>" . $request->getReceivingCard()->getAccountNumber() . "</AccountNumber>"; $xml .= "</ReceivingCard>"; $xml .= "<ReceivingAmount>"; $xml .= "<Value>" . $request->getReceivingAmount()->getValue() . "</Value>"; $xml .= "<Currency>" . $request->getReceivingAmount()->getCurrency() . "</Currency>"; $xml .= "</ReceivingAmount>"; $xml .= "<Channel>" . $request->getChannel() . "</Channel>"; $xml .= "<UCAFSupport>" . $request->getUCAFSupport() . "</UCAFSupport>"; $xml .= "<ICA>" . $request->getICA() . "</ICA>"; $xml .= "<ProcessorId>" . $request->getProcessorId() . "</ProcessorId>"; $xml .= "<RoutingAndTransitNumber>" . $request->getRoutingAndTransitNumber() . "</RoutingAndTransitNumber>"; $xml .= "<CardAcceptor>"; $xml .= "<Name>" . $request->getCardAcceptor()->getName() . "</Name>"; $xml .= "<City>" . $request->getCardAcceptor()->getCity() . "</City>"; $xml .= "<State>" . $request->getCardAcceptor()->getState() . "</State>"; $xml .= "<PostalCode>" . $request->getCardAcceptor()->getPostalCode() . "</PostalCode>"; $xml .= "<Country>" . $request->getCardAcceptor()->getCountry() . "</Country>"; $xml .= "</CardAcceptor>"; $xml .= "<TransactionDesc>" . $request->getTransactionDesc() . "</TransactionDesc>"; $xml .= "<MerchantId>" . $request->getMerchantId() . "</MerchantId>"; $xml .= "</TransferRequest>"; } return $xml; }