Skip to content

Conversation

@ecs515
Copy link
Contributor

@ecs515 ecs515 commented Sep 7, 2018

Se agregan nuevos servicios de cancelación/consulta status SAT

Se elimina token temporal comentado
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
'Postman-Token' => 'c05b3bc8-3038-4179-b32d-93a73e738a2e',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No se necesita este header

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

se elimina código, se mueve a SatQuery


public static function soapRequest($rfcEmisor, $rfcReceptor, $total, $uuid){
$request = new HttpRequest();
$request->setUrl('https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?wdsl');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Se supone que la url debería ser un parametro , esto para poder cambiar entre ambientes "Pruebas" y "Produccion"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

se elimina código, se mueve a SatQuery

<soapenv:Header/>
<soapenv:Body>
<tem:Consulta>
<tem:expresionImpresa><![CDATA[?re=LSO1306189R5&rr=LSO1306189R5&tt=1.16&id=E0AAE6B3-43CC-4B9C-B229-7E221000E2BB]]></tem:expresionImpresa>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codigo quemado?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lo deje como prueba, ya lo quito, queda en el de SatQuery

}
}

public static function soapRequest($rfcEmisor, $rfcReceptor, $total, $uuid){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Que no se supone que esta función es parte de otro archivo ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

se elimina código, se mueve a SatQuery

<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/C:/laragon/www/sw-sdk-php/.travis.yml</file>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alguna razón para eliminar estos ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Es parte de mi proyecto en netbeans, no es necesario para que funcione

namespace SWServices\Cancelation;
use Exception;

class cancelationHandler{
Copy link
Contributor

@flavioochoa flavioochoa Sep 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debe ser PascalCase, CamelCase , camel caps
https://en.wikipedia.org/wiki/Camel_case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Se realiza cambio

return array("uuid" => $data);
}

public static function soapBody(){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Método sin usar...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Se elimina método, se migra a SatQuery


public static function sendReqGet($url, $token, $rfc, $proxy, $service){
$curl = curl_init();
if(isset($proxy)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

La indentacion es importante. Las llaves no son necesarias.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Se refactoriza código

$request->setUrl('https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?wdsl');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pregunta, ¿cualquiera puede tener acceso al token y Authorization?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no se necesita token para entrar a consumir el SOAP del SAT, es público el servicio, de igual manera se mueve el código a SatQuery

</soapenv:Body>
</soapenv:Envelope>');

echo $response->getBody();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No deberia ser return en vez de echo ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

se mueve a SatQuery, donde si queda de esa manera


$soap = curl_exec($ch);
curl_close($ch);
return SatQueryRequest::response(SatQueryRequest::xml2array($soap));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Como se manejarían las exceptions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Se utiliza código para manejar exception de cURL

<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

este archivo lo utiliza tu ide? tal vez deberías excluirlo en el .gitignore

@ecs515 ecs515 merged commit 4d8f372 into develop Sep 11, 2018
@ecs515 ecs515 deleted the feature/0.0.2.4 branch September 11, 2018 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants