Skip to content

Commit

Permalink
update invoice xml test + Refact params
Browse files Browse the repository at this point in the history
  • Loading branch information
giansalex committed Jul 27, 2017
1 parent c8409ef commit ae3d8f6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
24 changes: 15 additions & 9 deletions src/Greenter/FeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,7 @@ public function setCompany(Company $company)
*/
public function setParameters($params)
{
$ws = $params['ws'];
$this->sender->setCredentials($ws['user'], $ws['pass']);
if (isset($ws['service'])) {
$this->sender->setService($ws['service']);
}

if (isset($ws['wsdl'])) {
$this->sender->setUrlWsdl($ws['wsdl']);
}
$this->setWsParams($params['ws']);

if (isset($params['xml'])) {
$this->builder->setParameters($params['xml']);
Expand All @@ -165,6 +157,20 @@ public function setParameters($params)
}
}

/**
* @param array $ws
*/
private function setWsParams($ws)
{
$this->sender->setCredentials($ws['user'], $ws['pass']);
if (isset($ws['service'])) {
$this->sender->setService($ws['service']);
}
if (isset($ws['wsdl'])) {
$this->sender->setUrlWsdl($ws['wsdl']);
}
}

/**
* @param string $xml
* @param string $filename
Expand Down
11 changes: 0 additions & 11 deletions tests/Greenter/Resources/invoice.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,6 @@
<cac:PartyName>
<cbc:Name>EMPRESA</cbc:Name>
</cac:PartyName>
<cac:AgentParty>
<cac:PartyIdentification>
<cbc:ID>20000000001</cbc:ID>
</cac:PartyIdentification>
<cac:PartyName>
<cbc:Name>EMPRESA SAC</cbc:Name>
</cac:PartyName>
<cac:PartyLegalEntity>
<cbc:RegistrationName>EMPRESA SAC</cbc:RegistrationName>
</cac:PartyLegalEntity>
</cac:AgentParty>
</cac:SignatoryParty>
<cac:DigitalSignatureAttachment>
<cac:ExternalReference>
Expand Down

0 comments on commit ae3d8f6

Please sign in to comment.