PHP code example of webneex / sw-sdk-php
1. Go to this page and download the library: Download webneex/sw-sdk-php library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
webneex / sw-sdk-php example snippets
{
"name": "martinflores/implement",
"authors": [
{
"name": "Martin Flores",
"email": "[email protected] "
}
],
"
$params = array(
"url"=>"http://services.test.sw.com.mx",
"proxy"=> "server.domain.com:8888"
);
rvices\Authentication\AuthenticationService as Authentication;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"cuentaUsuario",
"password"=> "contraseña"
);
try
{
header('Content-type: application/json');
Authentication::auth($params);
$token = Authentication::Token();
echo $token;
}
catch(Exception $e)
{
header('Content-type: text/plain');
echo 'Caught exception: ', $e->getMessage(), "\n";
}
WServices\Stamp\StampService as StampService;
try{
header('Content-type: application/json');
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"cuentaUsuario",
"password"=> "contraseña"
);
$xml = file_get_contents('./file.xml');
StampService::Set($params);
$result = StampService::StampV1($xml);
var_dump($result);
}
catch(Exception $e){
header('Content-type: text/plain');
echo 'Caught exception: ', $e->getMessage(), "\n";
}
WServices\Stamp\StampService as StampService;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"token"=>"T2lYQ0t4L0RHVkR4dHZ5Nkk1VHNEakZ3Y0J4Nk9GODZuRyt4cE..............."
);
try
{
header('Content-type: application/json');
$xml = file_get_contents('./file.xml');
StampService::Set($params);
$result = StampService::StampV1($xml);
var_dump($result);
}
catch(Exception $e)
{
header('Content-type: text/plain');
echo $e->getMessage();
}
$params = array(
"proxy"=> "server.domain.com"
);
WServices\Stamp\StampService as StampService;
try{
header('Content-type: application/json');
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"cuentaUsuario",
"password"=> "contraseña"
);
$xml = file_get_contents('./file.xml');
StampService::Set($params);
$result = StampService::StampV2($xml);
var_dump($result);
}
catch(Exception $e){
header('Content-type: text/plain');
echo 'Caught exception: ', $e->getMessage(), "\n";
}
WServices\Stamp\StampService as StampService;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"token"=>"T2lYQ0t4L0RHVkR4dHZ5Nkk1VHNEakZ3Y0J4Nk9GODZuRyt4cE..............."
);
try
{
header('Content-type: application/json');
$xml = file_get_contents('./file.xml');
StampService::Set($params);
$result = StampService::StampV2($xml);
var_dump($result);
}
catch(Exception $e)
{
header('Content-type: text/plain');
echo $e->getMessage();
}
WServices\Stamp\StampService as StampService;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"token"=>"T2lYQ0t4L0RHVkR4dHZ5Nkk1VHNEakZ3Y0J4Nk9GODZuRyt4cE..............."
);
try
{
header('Content-type: application/json');
$xml = file_get_contents('./file.xml');
StampService::Set($params);
//Se agrega un segundo parametro de tipo boolean para activar la modalidad base64
$result = StampService::StampV2($xml,true);
var_dump($result);
}
catch(Exception $e)
{
header('Content-type: text/plain');
echo $e->getMessage();
}
WServices\Stamp\StampService as StampService;
try{
header('Content-type: application/json');
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"cuentaUsuario",
"password"=> "contraseña"
);
$xml = file_get_contents('./file.xml');
StampService::Set($params);
$result = StampService::StampV3($xml);
var_dump($result);
}
catch(Exception $e){
header('Content-type: text/plain');
echo 'Caught exception: ', $e->getMessage(), "\n";
}
WServices\Stamp\StampService as StampService;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"token"=>"T2lYQ0t4L0RHVkR4dHZ5Nkk1VHNEakZ3Y0J4Nk9GODZuRyt4cE..............."
);
try
{
header('Content-type: application/json');
$xml = file_get_contents('./file.xml');
StampService::Set($params);
$result = StampService::StampV3($xml);
var_dump($result);
}
catch(Exception $e)
{
header('Content-type: text/plain');
echo $e->getMessage();
}
SWServices\PDF\PDFService as pdfService;
use SWServices\Stamp\StampService as StampService;
use SWServices\Stamp\EmisionTimbrado as EmisionTimbrado;
$prefixOne = date('Y-m-d');
$prefixTwo = rand(0, 555);
$customId = "Serie-" . $prefixOne . "-" . $prefixTwo;
$resultSpect = "success";
$params = array(
"url" => "https://services.test.sw.com.mx",
"token" => "T2lYQ0t4L0R...."
);
$xml = file_get_contents('./file.xml');
$stamp = EmisionTimbrado::Set($params);
$result = $stamp::issueV4CustomIdPdfV1($xml, $customId);
var_dump($result);
SWServices\PDF\PDFService as pdfService;
use SWServices\Stamp\StampService as StampService;
use SWServices\Stamp\EmisionTimbrado as EmisionTimbrado;
$prefixOne = date('Y-m-d');
$prefixTwo = rand(0, 555);
$customId = "Serie-" . $prefixOne . "-" . $prefixTwo;
$resultSpect = "success";
$params = array(
"url" => "https://services.test.sw.com.mx",
"token" => "T2lYQ0t4L0R...."
);
$xml = file_get_contents('./file.xml');
$stamp = EmisionTimbrado::Set($params);
$result = $stamp::issueV4CustomIdPdfV2($xml, $customId);
var_dump($result);
SWServices\PDF\PDFService as pdfService;
use SWServices\Stamp\StampService as StampService;
use SWServices\Stamp\EmisionTimbrado as EmisionTimbrado;
$prefixOne = date('Y-m-d');
$prefixTwo = rand(0, 555);
$customId = "Serie-" . $prefixOne . "-" . $prefixTwo;
$resultSpect = "success";
$params = array(
"url" => "https://services.test.sw.com.mx",
"token" => "T2lYQ0t4L0R...."
);
$xml = file_get_contents('./file.xml');
$stamp = EmisionTimbrado::Set($params);
$result = $stamp::issueV4CustomIdPdfV3($xml, $customId);
var_dump($result);
SWServices\PDF\PDFService as pdfService;
use SWServices\Stamp\StampService as StampService;
use SWServices\Stamp\EmisionTimbrado as EmisionTimbrado;
$prefixOne = date('Y-m-d');
$prefixTwo = rand(0, 555);
$customId = "Serie-" . $prefixOne . "-" . $prefixTwo;
$resultSpect = "success";
$params = array(
"url" => "https://services.test.sw.com.mx",
"token" => "T2lYQ0t4L0R...."
);
$xml = file_get_contents('./file.xml');
$stamp = EmisionTimbrado::Set($params);
$result = $stamp::issueV4CustomIdPdfV3($xml, $customId);
var_dump($result);
SWServices\PDF\PDFService as pdfService;
use SWServices\Stamp\StampService as StampService;
use SWServices\Stamp\EmisionTimbrado as EmisionTimbrado;
$prefixOne = date('Y-m-d');
$prefixTwo = rand(0, 555);
$customId = "Serie-" . $prefixOne . "-" . $prefixTwo;
$email = array("[email protected] ", "[email protected] ");
$resultSpect = "success";
$params = array(
"url" => "https://services.test.sw.com.mx",
"token" => "T2lYQ0t4L0R...."
);
$xml = file_get_contents('./file.xml');
$stamp = EmisionTimbrado::Set($params);
$result = $stamp::issueV4CustomIdEmailV1($xml, $customId);
var_dump($result);
SWServices\PDF\PDFService as pdfService;
use SWServices\Stamp\StampService as StampService;
use SWServices\Stamp\EmisionTimbrado as EmisionTimbrado;
$prefixOne = date('Y-m-d');
$prefixTwo = rand(0, 555);
$customId = "Serie-" . $prefixOne . "-" . $prefixTwo;
$email = array("[email protected] ", "[email protected] ");
$resultSpect = "success";
$params = array(
"url" => "https://services.test.sw.com.mx",
"token" => "T2lYQ0t4L0R...."
);
$xml = file_get_contents('./file.xml');
$stamp = EmisionTimbrado::Set($params);
$result = $stamp::issueV4CustomIdEmailV2($xml, $customId);
var_dump($result);
SWServices\PDF\PDFService as pdfService;
use SWServices\Stamp\StampService as StampService;
use SWServices\Stamp\EmisionTimbrado as EmisionTimbrado;
$prefixOne = date('Y-m-d');
$prefixTwo = rand(0, 555);
$customId = "Serie-" . $prefixOne . "-" . $prefixTwo;
$email = array("[email protected] ", "[email protected] ");
$resultSpect = "success";
$params = array(
"url" => "https://services.test.sw.com.mx",
"token" => "T2lYQ0t4L0R...."
);
$xml = file_get_contents('./file.xml');
$stamp = EmisionTimbrado::Set($params);
$result = $stamp::issueV4CustomIdEmailV3($xml, $customId);
var_dump($result);
SWServices\PDF\PDFService as pdfService;
use SWServices\Stamp\StampService as StampService;
use SWServices\Stamp\EmisionTimbrado as EmisionTimbrado;
$prefixOne = date('Y-m-d');
$prefixTwo = rand(0, 555);
$customId = "Serie-" . $prefixOne . "-" . $prefixTwo;
$email = array("[email protected] ", "[email protected] ");
$resultSpect = "success";
$params = array(
"url" => "https://services.test.sw.com.mx",
"token" => "T2lYQ0t4L0R...."
);
$xml = file_get_contents('./file.xml');
$stamp = EmisionTimbrado::Set($params);
$result = $stamp::issueV4CustomIdEmailV4($xml, $customId);
var_dump($result);
WServices\Stamp\StampService as StampService;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"token"=>"T2lYQ0t4L0RHVkR4dHZ5Nkk1VHNEakZ3Y0J4Nk9GODZuRyt4cE..............."
);
try
{
header('Content-type: application/json');
$xml = file_get_contents('./file.xml');
StampService::Set($params);
//Se agrega un segundo parametro de tipo boolean para activar la modalidad base64
$result = StampService::StampV3($xml,true);
var_dump($result);
}
catch(Exception $e)
{
header('Content-type: text/plain');
echo $e->getMessage();
}
WServices\Stamp\StampService as StampService;
try{
header('Content-type: application/json');
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"cuentaUsuario",
"password"=> "contraseña"
);
$xml = file_get_contents('./file.xml');
StampService::Set($params);
$result = StampService::StampV4($xml);
var_dump($result);
}
catch(Exception $e){
header('Content-type: text/plain');
echo 'Caught exception: ', $e->getMessage(), "\n";
}
WServices\Stamp\StampService as StampService;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"token"=>"T2lYQ0t4L0RHVkR4dHZ5Nkk1VHNEakZ3Y0J4Nk9GODZuRyt4cE..............."
);
try
{
header("Content-type: application/json");
$xml = file_get_contents("./file.xml");
StampService::Set($params);
$result = StampService::StampV4($xml);
var_dump($result);
}
catch(Exception $e)
{
header("Content-type: text/plain");
echo $e->getMessage();
}
WServices\Stamp\StampService as StampService;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"token"=>"T2lYQ0t4L0RHVkR4dHZ5Nkk1VHNEakZ3Y0J4Nk9GODZuRyt4cE..............."
);
try
{
header('Content-type: application/json');
$xml = file_get_contents('./file.xml');
StampService::Set($params);
//Se agrega un segundo parametro de tipo boolean para activar la modalidad base64
$result = StampService::StampV4($xml,true);
var_dump($result);
}
catch(Exception $e)
{
header('Content-type: text/plain');
echo $e->getMessage();
}
use SWServices\Stamp\EmisionTimbrado as EmisionTimbrado;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"[email protected] ",
"password"=> "contraseña"
);
$xml = file_get_contents('Test/Resources/file.xml');
EmisionTimbrado::Set($params);
$resultadoIssue = EmisionTimbrado::EmisionTimbradoV1($xml);
var_dump($resultadoIssue);
use SWServices\Stamp\EmisionTimbrado as EmisionTimbrado;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"[email protected] ",
"password"=> "contraseña"
);
$xml = file_get_contents('Test/Resources/file.xml');
EmisionTimbrado::Set($params);
$resultadoIssue = EmisionTimbrado::EmisionTimbradoV2($xml);
var_dump($result);
use SWServices\Stamp\EmisionTimbrado as EmisionTimbrado;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"[email protected] ",
"password"=> "contraseña"
);
$xml = file_get_contents('Test/Resources/file.xml');
EmisionTimbrado::Set($params);
$resultadoIssue = EmisionTimbrado::EmisionTimbradoV3($xml);
var_dump($result);
use SWServices\Stamp\EmisionTimbrado as EmisionTimbrado;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"[email protected] ",
"password"=> "contraseña"
);
$xml = file_get_contents('Test/Resources/file.xml');
EmisionTimbrado::Set($params);
$resultadoIssue = EmisionTimbrado::EmisionTimbradoV4($xml);
var_dump($result);
use SWServices\JSonIssuer\JsonEmisionTimbrado as JsonEmisionTimbrado;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"[email protected] ",
"password"=> "contraseña"
);
$json = file_get_contents("Test/Resources/cfdi.json");
JsonEmisionTimbrado::Set($params);
$resultadoJson = JsonEmisionTimbrado::jsonEmisionTimbradoV1($json);
var_dump($resultadoJson);
use SWServices\JSonIssuer\JsonEmisionTimbrado as JsonEmisionTimbrado;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"[email protected] ",
"password"=> "contraseña"
);
$json = file_get_contents("Test/Resources/cfdi.json");
JsonEmisionTimbrado::Set($params);
$resultadoJson = JsonEmisionTimbrado::jsonEmisionTimbradoV2($json);
var_dump($resultadoJson);
use SWServices\JSonIssuer\JsonEmisionTimbrado as jsonEmisionTimbrado;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"[email protected] ",
"password"=> "contraseña"
);
$json = file_get_contents("Test/Resources/cfdi.json");
jsonEmisionTimbrado::Set($params);
$resultadoJson = JsonEmisionTimbrado::jsonEmisionTimbradoV3($json);
var_dump($resultadoJson);
use SWServices\JSonIssuer\JsonEmisionTimbrado as JsonEmisionTimbrado;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"[email protected] ",
"password"=> "contraseña"
);
$json = file_get_contents("Test/Resources/cfdi.json");
JsonEmisionTimbrado::Set($params);
$resultadoJson = JsonEmisionTimbrado::jsonEmisionTimbradoV4($json);
var_dump($resultadoJson);
Services\Cancelation\CancelationService as CancelationService;
$rfc="";
$password="";
$uuid=" ";
$motivo="02";
$foliosustitucion=" ";
$b64Cer="MIIFuzCCA6OgAwIBAgIU.........";
$b64Key="MIIFDjBABgkqhkiG9w0B.........";
$url="http://services.test.sw.com.mx/";
$token=" ";
$params = array(
"url"=>$url,
"token"=>$token,
"uuid"=>$uuid,
"password"=>$password,
"rfc"=>$rfc,
"motivo"=>$motivo,
"cerB64"=>$b64Cer,
"keyB64"=>$b64Key
);
try {
header('Content-type: application/json');
$cancelationService = CancelationService::Set($params);
$result = $cancelationService::CancelationByCSD();
echo json_encode($result);
} catch(Exception $e) {
header('Content-type: text/plain');
echo $e->getMessage();
}
Services\Cancelation\CancelationService as CancelationService;
$resultSpect = "success";
$params = array(
"url"=>"http://services.test.sw.com.mx/",
"token"=>" "
);
$xml=file_get_contents("../Test/Resources/CancelationResources/cancelByXml.xml");
try {
$cancelationService = CancelationService::Set($params);
$result = $cancelationService::CancelationByXML($xml);
echo json_encode($result);
} catch(Exception $e) {
header('Content-type: text/plain');
echo $e->getMessage();
}
Services\Cancelation\CancelationService as CancelationService;
$rfc=" ";
$password=" ";
$uuid=" ";
$motivo=" ";
$foliosustitucion=" ";
$b64Pfx="MIIL+QIBAzCCC.................";
$url="http://services.test.sw.com.mx/";
$token=" ";
$params = array(
"url"=>$url,
"token"=>$token,
"uuid"=>$uuid,
"password"=>$password,
"rfc"=>$rfc,
"motivo"=>$motivo,
"foliosustitucion"=>$foliosustitucion,
"pfxB64"=>$b64Pfx,
);
try {
header('Content-type: application/json');
$cancelationService = CancelationService::Set($params);
$result = $cancelationService::CancelationByPFX();
echo json_encode($result);
} catch(Exception $e) {
header('Content-type: text/plain');
echo $e->getMessage();
}
Services\Cancelation\CancelationService as CancelationService;
$rfc=" ";
$uuid=" ";
$motivo=" ";
$foliosustitucion=" ";
$params = array(
"url"=>"http://services.test.sw.com.mx",
"token"=>" ",
"rfc"=>$rfc,
"uuid"=>$uuid,
"motivo"=>$motivo,
"foliosustitucion"=>$foliosustitucion
);
try {
header('Content-type: application/json');
$cancelationService = CancelationService::Set($params);
$result = $cancelationService::CancelationByUUID();
echo json_encode($result);
} catch(Exception $e) {
header('Content-type: text/plain');
echo $e->getMessage();
}
WServices\AccountBalance\AccountBalanceService as AccountBalanceService;
$params = array(
'url'=> 'services.test.sw.com.mx',
'token'=> 'T2lYQ0t4L0RHVkR4dHZ5Nkk1VHNEakZ3Y0J4Nk9GODZuRyt4cE...............',
);
try {
AccountBalanceService::Set($params);
$result = AccountBalanceService::GetAccountBalance();
var_dump($result);
} catch(Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
use SWServices\SatQuery\SatQueryService as SatQueryService;
$soapUrl = "http://consultaqrfacturaelectronicatest.sw.com.mx/ConsultaCFDIService.svc";
$re = "LAN8507268IA";
$rr = "LAN7008173R5";
$tt = 5800.00;
$uuid = "6ab07bef-4446-43ea-a3fd-04a804309457";
$sello = "zNDhfw=";
$consultaCfdi = SatQueryService::ServicioConsultaSAT($soapUrl, $re, $rr, $tt, $uuid, $sello);
var_dump($consultaCfdi);
use SWServices\Cancelation\CancelationService as cancelationService;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"cuentaUsuario",
"password"=> "contraseña"
);
$rfc = "LAN7008173R5";
cancelationService::Set($params);
$consultaPendientes = cancelationService::PendientesPorCancelar($rfc);
var_dump($consultaPendientes);
use SWServices\Cancelation\CancelationService as cancelationService;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"cuentaUsuario",
"password"=> "contraseña"
);
$cerB64 = base64_encode(file_get_contents('Test\Resources\CSD_Pruebas_CFDI_LAN7008173R5.cer'));
$keyB64 = base64_encode(file_get_contents('Test\Resources\CSD_Pruebas_CFDI_LAN7008173R5.key'));
$password = "12345678a";
$rfc = "LAN7008173R5";
$uuids[0]=array("6ab07bef-4446-43ea-a3fd-04a804309457","Rechazo");
cancelationService::Set($params);
$aceptarRechazar = cancelationService::AceptarRechazarCancelacionCSD($rfc, $cerB64, $keyB64, $password, $uuids);
var_dump($aceptarRechazar);
use SWServices\Cancelation\CancelationService as cancelationService;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"cuentaUsuario",
"password"=> "contraseña"
);
$pfxB64 = base64_encode(file_get_contents('Test\Resources\CSD_Pruebas_CFDI_LAN7008173R5.pfx'));
$password = "12345678a";
$rfc = "LAN7008173R5";
$uuids[0]=array("6ab07bef-4446-43ea-a3fd-04a804309457","Rechazo");
cancelationService::Set($params);
$aceptarRechazar = cancelationService::AceptarRechazarCancelacionPFX($rfc, $pfxB64, $password, $uuids);
var_dump($aceptarRechazar);
use SWServices\Cancelation\CancelationService as cancelationService;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"cuentaUsuario",
"password"=> "contraseña"
);
$xml = file_get_contents('Test\Resources\fileAcceptReject.xml');
cancelationService::Set($params);
$aceptarRechazar = cancelationService::AceptarRechazarCancelacionXML($xml);
var_dump($aceptarRechazar);
use SWServices\Cancelation\CancelationService as cancelationService;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"cuentaUsuario",
"password"=> "contraseña"
);
$rfc = "LAN7008173R5";
$uuid = "6ab07bef-4446-43ea-a3fd-04a804309457";
$accion = "Rechazo";
cancelationService::Set($params);
$aceptarRechazar = cancelationService::AceptarRechazarCancelacionUUID($rfc, $uuid, $accion);
var_dump($aceptarRechazar);
use SWServices\Cancelation\CancelationService as cancelationService;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"cuentaUsuario",
"password"=> "contraseña"
);
$cerB64 = base64_encode(file_get_contents('Test\Resources\CSD_Pruebas_CFDI_LAN7008173R5.cer'));
$keyB64 = base64_encode(file_get_contents('Test\Resources\CSD_Pruebas_CFDI_LAN7008173R5.key'));
$rfc = "LAN7008173R5";
$uuid = "52c02b64-d12e-4163-b581-bf749238896d";
cancelationService::Set($params);
$consultaRelacionados = cancelationService::ConsultarCFDIRelacionadosCSD($rfc, $cerB64, $keyB64, $password, $uuid);
var_dump($consultaRelacionados);
use SWServices\Cancelation\CancelationService as cancelationService;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"cuentaUsuario",
"password"=> "contraseña"
);
$pfxB64 = base64_encode(file_get_contents('Test\Resources\CSD_Pruebas_CFDI_LAN7008173R5.pfx'));
$rfc = "LAN7008173R5";
$uuid = "52c02b64-d12e-4163-b581-bf749238896d";
cancelationService::Set($params);
$consultaRelacionados = cancelationService::ConsultarCFDIRelacionadosPFX($rfc, $pfxB64, $password, $uuid);
var_dump($consultaRelacionados);
use SWServices\Cancelation\CancelationService as cancelationService;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"cuentaUsuario",
"password"=> "contraseña"
);
$rfc = "LAN7008173R5";
$uuid = "52c02b64-d12e-4163-b581-bf749238896d";
$xml = file_get_contents('Test\Resources\fileRelations.xml');
cancelationService::Set($params);
$consultaRelacionados = cancelationService::ConsultarCFDIRelacionadosXML($xml);
var_dump($consultaRelacionados);
use SWServices\Cancelation\CancelationService as cancelationService;
$params = array(
"url"=>"http://services.test.sw.com.mx",
"user"=>"cuentaUsuario",
"password"=> "contraseña"
);
$rfc = "LAN7008173R5";
$uuid = "52c02b64-d12e-4163-b581-bf749238896d";
cancelationService::Set($params);
$consultaRelacionados = cancelationService::ConsultarCFDIRelacionadosUUID($rfc, $uuid);
var_dump($consultaRelacionados);
use SWServices\PDF\PDFService as pdfService;
$xml = "<?xml version='1.0' encoding='utf-8'
use SWServices\PDF\PDFService as pdfService;
$xml = "<?xml version='1.0' encoding='utf-8'
use SWServices\PDF\PDFService as pdfService;
$uuid = "604729a6-a1d9-4969-b35f-e7d04c7ad75c";
$params = array(
"urlApi" => "https://api.test.sw.com.mx",
"url" => "https://services.test.sw.com.mx",
"user" => "usuario",
"password" => "contraseña"
);
$pdfService = pdfService::Set($params);
$result = $pdfService::RegeneratePDF($uuid);
var_dump($result);
use SWServices\PDF\PDFService as pdfService;
//Si se cuentan con distintos templateId,
//es necesario especificarlo
$extras = array(
"extras"=>array(
"EDIRECCION1"=>"STERNO PRODUCTS 2483 Harbor Avenue Memphis, TN 38113"
),
"templateId"=>"extradata"
);
$params = array(
"urlApi" => "https://api.test.sw.com.mx",
"url" => "https://services.test.sw.com.mx",
"user" => "usuario",
"password" => "contraseña"
);
$pdfService = pdfService::Set($params);
$result = $pdfService::RegeneratePDF($uuid,$extras);
var_dump($result);
$params = array(
"urlApi" => "https://api.test.sw.com.mx",
"url" => "https://services.test.sw.com.mx",
"user"=>"[email protected] ",
"password"=> "password"
);
$resend = ResendService::Set($params);
$params = array(
"urlApi" => "https://api.test.sw.com.mx",
"token" => "T2lYQ0t4L0RHVkR..."
);
$resend = ResendService::Set($params);
$emails = array(
"[email protected] "
);
$result = $resend::ResendEmail("506aecd4-fc5f-4581-a0e1-9b185967b212", $emails);
$emails = array(
"[email protected] ",
"[email protected] "
);
$result = $resend::ResendEmail("506aecd4-fc5f-4581-a0e1-9b185967b212", $emails);