Skip to content

Commit

Permalink
Merge pull request #18 from rhutanu90/getCustomerOptionalDetails
Browse files Browse the repository at this point in the history
get CustomerIdentifierName, IBAN and BIC values
  • Loading branch information
hakito authored Dec 3, 2017
2 parents 81aa6c7 + 53a11b5 commit c2af496
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 3 deletions.
78 changes: 75 additions & 3 deletions src/BankConfirmationDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class BankConfirmationDetails
private $remittanceIdentifier;
private $paymentReferenceIdentifier;
private $referenceIdentifier;
private $orderingCustomerNameAddress;
private $orderingCustomerIdentifier;
private $orderingCustomerBIC;
private $sessionId;
private $statusCode;

Expand Down Expand Up @@ -62,10 +65,24 @@ private function init($simpleXml)
// ReferenceIdentifier used in TransferInitiatorDetails as $internalReferenceId
$t5 = $EpiDetails->IdentificationDetails;
$this->SetReferenceIdentifier($t5->ReferenceIdentifier);

//The following 3 data elements could be used e.g. for routing information within additional business scenarios (e.g. EBPP).
//These are optional data elements
if(isset($t5->OrderingCustomerNameAddressText)){
$this->SetOrderingCustomerNameAddressText($t5->OrderingCustomerNameAddressText);
}

if(isset($t5->OrderingCustomerIdentifier)){
$this->SetOrderingCustomerIdentifier($t5->OrderingCustomerIdentifier);
}

if(isset($t5->OrderingCustomerOfiIdentifier)){
$this->SetOrderingCustomerBIC($t5->OrderingCustomerOfiIdentifier);
}
}

if ($this->remittanceIdentifier == null)
throw new \LogicException('Could not find RemittanceIdentifier in XML');
throw new \LogicException('Could not find RemittanceIdentifier in XML');
}

public function SetRemittanceIdentifier($a)
Expand Down Expand Up @@ -98,14 +115,69 @@ public function GetPaymentReferenceIdentifier()

public function SetReferenceIdentifier($a)
{
$this->referenceIdentifier = (string) $a;
$this->referenceIdentifier = (string) $a;
}

public function GetReferenceIdentifier()
{
return $this->referenceIdentifier;
return $this->referenceIdentifier;
}


/**
* Set the identification of ordering customer (name and/or address of the buyer) in non-coded form
* @param $customerName
*/
public function SetOrderingCustomerNameAddressText($customerName)
{
$this->orderingCustomerNameAddress = (string) $customerName;
}

/**
* Get the identification of ordering customer (name and/or address of the buyer) in non-coded form
* @return mixed
*/
public function GetOrderingCustomerNameAddress()
{
return $this->orderingCustomerNameAddress;
}


/**
* Set the identification of the customer’s (buyer’s) account identification by e.g. IBAN, BBAN, etc.
* @param $iban
*/
public function SetOrderingCustomerIdentifier($iban){
$this->orderingCustomerIdentifier = (string) $iban;
}

/**
* Get the identification of the customer’s (buyer’s) account identification by e.g. IBAN, BBAN, etc.
* @return mixed
*/
public function GetOrderingCustomerIdentifier(){
return $this->orderingCustomerIdentifier;
}


/**
* Set the identification of the customer’s (buyer’s) financial institution by a BIC
* @param $bic
*/
public function SetOrderingCustomerBIC($bic){
$this->orderingCustomerBIC = (string) $bic;
}

/**
* Get the identification of the customer’s (buyer’s) financial institution by a BIC
* @return mixed
*/
public function GetOrderingCustomerBIC(){
return $this->orderingCustomerBIC;
}



public function SetSessionId($a)
{
$this->sessionId = (string) $a;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public function setUp()
$this->simpleXmls['UnstructuredWithoutSignature'] = new \SimpleXMLElement($this->GetEpsData('BankConfirmationDetailsWithoutSignatureUnstructuredRemittanceIdentifier.xml'));
$this->simpleXmls['WithoutSignature'] = new \SimpleXMLElement($this->GetEpsData('BankConfirmationDetailsWithoutSignature.xml'));
$this->simpleXmls['UnstructuredWithSignature'] = new \SimpleXMLElement($this->GetEpsData('BankConfirmationDetailsWithSignatureUnstructuredRemittanceIdentifier.xml'));
$this->simpleXmls['WithPaymentInititatorDetails'] = new \SimpleXMLElement($this->GetEpsData('BankConfirmationDetailsWithPaymentInitiatorDetailsWithoutSignature.xml'));
}

public function testGetRemittanceIdentifier()
Expand Down Expand Up @@ -75,4 +76,25 @@ public function testGetReferenceIdentifier()
$actual = $t->GetReferenceIdentifier();
$this->assertEquals('1234567890ABCDEFG', $actual);
}

public function testGetOrderingCustomerNameAddress()
{
$t = new BankConfirmationDetails($this->simpleXmls['WithPaymentInititatorDetails']);
$actual = $t->GetOrderingCustomerNameAddress();
$this->assertEquals('Customer Name', $actual);
}

public function testGetOrderingCustomerIdentifier()
{
$t = new BankConfirmationDetails($this->simpleXmls['WithPaymentInititatorDetails']);
$actual = $t->GetOrderingCustomerIdentifier();
$this->assertEquals('DE0815', $actual);
}

public function testGetOrderingCustomerBIC()
{
$t = new BankConfirmationDetails($this->simpleXmls['WithPaymentInititatorDetails']);
$actual = $t->GetOrderingCustomerBIC();
$this->assertEquals('GERMAN2A', $actual);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<epsp:EpsProtocolDetails SessionLanguage="DE" xsi:schemaLocation="http://www.stuzza.at/namespaces/eps/protocol/2013/02 EPSProtocol-V25.xsd" xmlns:atrul="http://www.stuzza.at/namespaces/eps/austrianrules/2013/02" xmlns:epi="http://www.stuzza.at/namespaces/eps/epi/2013/02" xmlns:eps="http://www.stuzza.at/namespaces/eps/payment/2013/02" xmlns:epsp="http://www.stuzza.at/namespaces/eps/protocol/2013/02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<epsp:BankConfirmationDetails>
<epsp:SessionId>13212452dea</epsp:SessionId>
<eps:PaymentConfirmationDetails>
<eps:PaymentInitiatorDetails>
<epi:EpiDetails>
<epi:IdentificationDetails>
<epi:Date>2013-02-28</epi:Date>
<epi:ReferenceIdentifier>1234567890ABCDEFG</epi:ReferenceIdentifier>
<epi:OrderingCustomerOfiIdentifier>GERMAN2A</epi:OrderingCustomerOfiIdentifier>
<epi:OrderingCustomerIdentifier>DE0815</epi:OrderingCustomerIdentifier>
<epi:OrderingCustomerNameAddressText>Customer Name</epi:OrderingCustomerNameAddressText>
</epi:IdentificationDetails>
<epi:PartyDetails>
<epi:BfiPartyDetails>
<epi:BfiBicIdentifier>GAWIATW1XXX</epi:BfiBicIdentifier>
</epi:BfiPartyDetails>
<epi:BeneficiaryPartyDetails>
<epi:BeneficiaryNameAddressText>Max Mustermann</epi:BeneficiaryNameAddressText>
<epi:BeneficiaryAccountIdentifier>AT611904300234573201</epi:BeneficiaryAccountIdentifier>
</epi:BeneficiaryPartyDetails>
</epi:PartyDetails>
<epi:PaymentInstructionDetails>
<epi:RemittanceIdentifier>AT1234567890XYZ</epi:RemittanceIdentifier>
<epi:InstructedAmount AmountCurrencyIdentifier="EUR">150.00</epi:InstructedAmount>
<epi:ChargeCode>SHA</epi:ChargeCode>
<epi:DateOptionDetails DateSpecificationCode="CRD">
<epi:OptionDate>2013-02-28</epi:OptionDate>
<epi:OptionTime>11:00:00-05:00</epi:OptionTime>
</epi:DateOptionDetails>
</epi:PaymentInstructionDetails>
</epi:EpiDetails>
<atrul:AustrianRulesDetails>
<atrul:DigSig>SIG</atrul:DigSig>
<atrul:ExpirationTime>2013-02-28T09:30:47Z</atrul:ExpirationTime>
</atrul:AustrianRulesDetails>
</eps:PaymentInitiatorDetails>
<eps:PayConApprovingUnitDetails>
<eps:ApprovingUnitBankIdentifier>AAAAAAAAAAA</eps:ApprovingUnitBankIdentifier>
</eps:PayConApprovingUnitDetails>
<eps:PayConApprovalTime>2007-03-19T11:11:00-05:00</eps:PayConApprovalTime>
<eps:PaymentReferenceIdentifier>120000302122320812201106461</eps:PaymentReferenceIdentifier>
<eps:StatusCode>OK</eps:StatusCode>
</eps:PaymentConfirmationDetails>
</epsp:BankConfirmationDetails>
</epsp:EpsProtocolDetails>

0 comments on commit c2af496

Please sign in to comment.