facturapi / facturapi-php Goto Github PK
View Code? Open in Web Editor NEWCrea Facturas Electrónicas válidas en México lo más fácil posible (CFDI) https://facturapi.io
License: MIT License
Crea Facturas Electrónicas válidas en México lo más fácil posible (CFDI) https://facturapi.io
License: MIT License
$this->facturapi = new Facturapi('facturapi_user_key');
$params = ['q' => $rfc];
$organizations = $this->facturapi->Organizations->all($params);
stdClass Object ( [page] => 1 [total_pages] => 1 [total_results] => 0 [data] => Array ( ) )
$facturapi = new Facturapi("sk_test_---");
$productItem = array(
"description" => "Banjo",
"product_key" => "7876543456",
"price" => 1345.60,
"sku" => "IMUSXXXX123"
);
$product = $facturapi->Products->create($productItem);
Response:
object(stdClass)#7 (2) { ["message"]=> string(44) "Invalid product_key, please check it exists." ["ok"]=> bool(false) }
When i make all in one request crates invoice and customer, products were not created.
Al mandar los siguientes parametros, the API breaks
Request
$params =[
'q' => 'XAXX010101000'
'date' => [
'gte' => '2019-03-01'
'lte' => '2019-03-31'
]
];
(new Facturapi($apiKey))->Invoices->all($params);
Response
stdClass Object
(
[message] => Cast to date failed for value "{}" at path "created_at" for model "Invoice"
[ok] =>
)
after creating a Invoice this message was returned:
object(stdClass)#14 (2) { ["message"]=> string(58) ""items[0]" > "customs_keys" must contain at least 1 items" ["ok"]=> bool(false) }
En Laravel genera
Unable to create customer: Facturapi\Exceptions\Facturapi_Exception: cURL error: SSL certificate problem: unable to get local issuer certificate in
para resolverlo ir a
vendor\facturapi\facturapi-php\src\Http\BaseClient.php
protected function execute_JSON_post_request( $url, $body ) {
$headers[] = 'Authorization: Basic ' . $this->FACTURAPI_KEY;
$headers[] = 'Content-Type: application/json';
// initialize cURL and send POST data
$ch = curl_init();
curl_setopt( $ch, CURLOPT_POST, true );
curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $body ) );
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
Agregar
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers );
$output = curl_exec( $ch );
$errno = curl_errno( $ch );
$error = curl_error( $ch );
$this->setLastStatusFromCurl( $ch );
curl_close( $ch );
if ( $errno > 0 ) {
throw new Facturapi_Exception( 'cURL error: ' . $error );
} else {
return $output;
}
}
Utilizo la funcionalidad para cargar el catalogo de articulos
$facturapi = new Facturapi($key);
return $facturapi->Catalogs->searchProducts([
'q' => request('search')
]);
Pero al momento de hacer la consulta, me arroja lo siguiente
{
"message": "Feature no disponible.",
"ok": false
}
Algún error en integración? Help!!!!1
Esta funcionalidad te exige además de los parámetros definidos en la documento
otros datos como payment_form e items.
puedo incluir la libreria sin usar composer?
[ya encontre el ejemplo como cierro el issue]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.