Skip to content

Commit

Permalink
connector setter added
Browse files Browse the repository at this point in the history
  • Loading branch information
aahmetgaliev committed Sep 9, 2019
1 parent 2650da3 commit 8a588af
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 38 deletions.
25 changes: 17 additions & 8 deletions src/CorreosConnector/CorreosConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@
namespace CorreosSdk\CorreosConnector;

use CorreosSdk\ServiceType\Documentacion;
use CorreosSdk\StructType\SolicitudDocumentacionAduanera;
use CorreosSdk\StructType\SolicitudDocumentacionAduaneraCN23CP71;
use CorreosSdk\StructType\SolicitudEtiquetaExp;

use InvalidArgumentException;
use CorreosSdk\ServiceType\Anular;
use CorreosSdk\ServiceType\Modificar;
use CorreosSdk\StructType\PeticionAnular;
use CorreosSdk\StructType\PeticionModificar;
use CorreosSdk\ServiceType\Pre;
use CorreosSdk\ServiceType\Anular;
use CorreosSdk\Factories\Shipment;
use CorreosSdk\ServiceType\Modificar;
use CorreosSdk\ServiceType\Solicitud;
use CorreosSdk\StructType\PeticionAnular;
use CorreosSdk\StructType\PreregistroEnvio;
use CorreosSdk\StructType\SolicitudEtiqueta;
use CorreosSdk\Exceptions\CorreosException;
use CorreosSdk\StructType\PeticionModificar;
use CorreosSdk\StructType\SolicitudEtiquetaExp;
use CorreosSdk\Factories\SenderUnitedIdentity;
use CorreosSdk\StructType\SolicitudDocumentacionAduanera;
use CorreosSdk\StructType\SolicitudDocumentacionAduaneraCN23CP71;

class CorreosConnector
{
Expand Down Expand Up @@ -47,12 +48,20 @@ class CorreosConnector
* @param CorreosConfig $correosConfig
* @param SenderUnitedIdentity $senderUnitedIdentity
*/
public function __construct(CorreosConfig $correosConfig, SenderUnitedIdentity $senderUnitedIdentity)
public function __construct(CorreosConfig $correosConfig, SenderUnitedIdentity $senderUnitedIdentity = null)
{
$this->correosConfig = $correosConfig;
$this->senderUnitedIdentity = $senderUnitedIdentity;
}

/**
* @param SenderUnitedIdentity $senderUnitedIdentity
*/
public function setSenderUnitedIdentity(SenderUnitedIdentity $senderUnitedIdentity): void
{
$this->senderUnitedIdentity = $senderUnitedIdentity;
}

/**
* @param Shipment $invoice
* @return Shipment
Expand Down
30 changes: 0 additions & 30 deletions tests/UpdateShipmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,6 @@ class UpdateShipmentTest extends InitTest
{
public function testUpdateShipment()
{
// $config = (new IniReader())->readFile(__DIR__ . '/config.ini');
// $correosConfig = new CorreosConfig(
// "w81099174",
// "6pjUqAw4",
// "69RH",
// 'prod');
// $correosConfig->setClientContractNumber("54034824");
// $correosConfig->setClientNumber("81099174");
//
// $senderAddress = new Address(
// $config['sender_city_name'],
// $config['sender_street_name'],
// $config['sender_province_name'],
// $config['sender_street_number'],
// null,
// "C",
// null,
// null,
// $config['sender_street_floor']
// );
// $senderIdentification = new Identification(
// $config['sender_name']
// );
// $senderUnitedIdentity = new SenderUnitedIdentity(
// $senderAddress,
// $senderIdentification,
// $config['sender_post_code']
// );
//
// $this->client = new CorreosConnector($correosConfig, $senderUnitedIdentity);

$receiverAddress = new Address(
"TEST LAKEPORT",
Expand Down

0 comments on commit 8a588af

Please sign in to comment.