Example #1
0
 /**
  * @param SimpleXMLElement $detailXml
  * @param EntryTransactionDetail $detail
  */
 private function addRemittanceInformationToTransactionDetails(SimpleXMLElement $detailXml, EntryTransactionDetail $detail)
 {
     if (isset($detailXml->RmtInf)) {
         if (isset($detailXml->RmtInf->Ustrd)) {
             $remittanceInformation = RemittanceInformation::fromUnstructured($detailXml->RmtInf->Ustrd);
             $detail->setRemittanceInformation($remittanceInformation);
         } elseif (isset($detailXml->RmtInf->Strd)) {
             if (isset($detailXml->RmtInf->Strd->CdtrRefInf) && isset($detailXml->RmtInf->Strd->CdtrRefInf->Ref)) {
                 $creditorReferenceInformation = CreditorReferenceInformation::fromUnstructured((string) $detailXml->RmtInf->Strd->CdtrRefInf->Ref);
                 $remittanceInformation = new RemittanceInformation();
                 $remittanceInformation->setCreditorReferenceInformation($creditorReferenceInformation);
                 $detail->setRemittanceInformation($remittanceInformation);
             }
         }
     }
 }
Example #2
0
 /**
  * @param SimpleXMLElement $detailXml
  * @param EntryTransactionDetail $detail
  */
 private function addRemittanceInformationToTransactionDetails(SimpleXMLElement $detailXml, EntryTransactionDetail $detail)
 {
     if (isset($detailXml->RmtInf)) {
         if (isset($detailXml->RmtInf->Ustrd)) {
             $remittanceInformation = RemittanceInformation::fromUnstructured((string) $detailXml->RmtInf->Ustrd);
             $detail->setRemittanceInformation($remittanceInformation);
         }
     }
 }