diff --git a/src/Facturacom33.php b/src/Facturacom33.php index 7dc42b8..e4c9ee4 100644 --- a/src/Facturacom33.php +++ b/src/Facturacom33.php @@ -9,8 +9,14 @@ namespace inquid\facturacom; +use inquid\facturacom\models\Cliente; +use inquid\facturacom\models\EmpresaFacturadora; +use inquid\facturacom\models\Factura; use inquid\facturacom\models\Factura33; use inquid\facturacom\models\Error; +use inquid\facturacom\models\Serie; +use yii\base\Model; +use yii\db\ActiveRecord; class Facturacom33 extends HttpClientV3 { @@ -144,21 +150,20 @@ public function getSeries() } /** - * @param Factura33 + * @param Factura33 $factura * @return boolean|Error */ public function createFactura33($factura) { - $model = new Factura33(); - $model->setAttributes($factura->getAttributes()); + $this->API_VERSION = 'api/v3'; if ($factura->validate()) { try { - return $this->booleanResponse($this->sendRequest('post', 'cfdi33/create', $model->getAttributes())); + return $this->booleanResponse($this->sendRequest('post', 'cfdi33/create', $factura->getAttributes())); } catch (\Exception $exception) { return new Error(500, $exception->getMessage()); } } - return new Error(500, $model->getErrors()); + return new Error(500, $factura->getErrors()); } /** diff --git a/src/models/Conceptos.php b/src/models/Conceptos.php index a4126a2..2fb74ef 100644 --- a/src/models/Conceptos.php +++ b/src/models/Conceptos.php @@ -44,7 +44,7 @@ class Conceptos extends Model /** * @var float */ - public $ValroUnitario; + public $ValorUnitario; /** * @var float */ diff --git a/src/models/Factura33.php b/src/models/Factura33.php index 9a99b76..cf797bb 100644 --- a/src/models/Factura33.php +++ b/src/models/Factura33.php @@ -23,9 +23,9 @@ class Factura33 extends Model */ public $TipoCfdi; /** - * @var string $NumOrden + * @var string $NumOrder */ - public $NumOrden; + public $NumOrder; /** * @var string $Comentarios */ @@ -119,9 +119,9 @@ class Factura33 extends Model */ public $MetodoPago; /** - * @var integer $LugarExpeicion + * @var integer $LugarExpedicion */ - public $LugarExpeicion; + public $LugarExpedicion; /** * @var string $Confirmacion */ @@ -143,9 +143,9 @@ class Factura33 extends Model "RegimenFiscal" => "" ]; /** - * @var array $Recpetor + * @var array $Receptor */ - public $Recpetor = [ + public $Receptor = [ "ResidenciaFiscal" => "", "UID" => "" ];