[wp-trac] [WordPress Trac] #51571: Problema con API Rest

WordPress Trac noreply at wordpress.org
Tue Oct 20 01:31:00 UTC 2020


#51571: Problema con API Rest
--------------------------+-----------------------------
 Reporter:  claudisho     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  5.5.1
 Severity:  critical      |   Keywords:
  Focuses:  rest-api      |
--------------------------+-----------------------------
 Buenas tardes, utilizo la API Rest en varios clientes para ir actualizando
 sus productos y otros valores en woocommerce, el tema es que con uno en
 especifico me da un error que ya no se como solucionar, borré todo y
 reinstalé y sigue el problema, adjunto error

 [20-Oct-2020 01:21:21 UTC] PHP Fatal error:  Uncaught
 Automattic\WooCommerce\HttpClient\HttpClientException: Error: Firma no
 válida - la firma proporcionada no coincide.
 [woocommerce_rest_authentication_error] in
 /home3/cec64655/public_html/vendor/automattic/woocommerce/src/WooCommerce/HttpClient/HttpClient.php:350
 Stack trace:
 #0
 /home3/cec64655/public_html/vendor/automattic/woocommerce/src/WooCommerce/HttpClient/HttpClient.php(386):
 Automattic\WooCommerce\HttpClient\HttpClient->lookForErrors(Object(stdClass))
 #1
 /home3/cec64655/public_html/vendor/automattic/woocommerce/src/WooCommerce/HttpClient/HttpClient.php(422):
 Automattic\WooCommerce\HttpClient\HttpClient->processResponse()
 #2
 /home3/cec64655/public_html/vendor/automattic/woocommerce/src/WooCommerce/Client.php(82):
 Automattic\WooCommerce\HttpClient\HttpClient->request('products', 'GET',
 Array, Array)
 #3 /home3/cec64655/public_html/api.list.producto.php(28):
 Automattic\WooCommerce\Client->get('products')
 #4 {main}
   thrown in
 /home3/cec64655/public_html/vendor/automattic/woocommerce/src/WooCommerce/HttpClient/HttpClient.php
 on line 350


 Esto me sucede solo con este sitio, este es el php

 <?php
 // ****************************REQUERIDO PARA CONECTAR CON EL
 SERVICIO******************************
 //Clave del cliente
 $keyCte='ck_41d7cc38cb84eb11882244ab736c4f493994c005';

 //Clave secreta de cliente
 $keySecCte='cs_7a02dfd264fe9c6f14a53ba2e5023293d35df576';

 $keyURL='www.echaniz.cl';

 $autoloader = dirname( __FILE__ ) . '/vendor/autoload.php';
 if ( is_readable( $autoloader ) ) {
         require_once $autoloader;
 }

 use Automattic\WooCommerce\Client;
 use Automattic\WooCommerce\HttpClient\HttpClientException;
 $woocommerce = new Client(
         'http://' . $keyURL,
         $keyCte,
         $keySecCte,

         [
                 'wp_api'  => true,
                 'version' => 'wc/v3',
         ]

 );
  //  https://woocommerce.github.io/woocommerce-rest-api-
 docs/v3.html#products

 //
 ******************************FIN*****************************************************



 $salida=$woocommerce->get('products');
 echo json_encode($salida);

 ?>

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51571>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list