PHP code example of taocomp / php-sdicoop-server
1. Go to this page and download the library: Download taocomp/php-sdicoop-server 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/ */
taocomp / php-sdicoop-server example snippets
#+END_SRC
** Web Service "RicezioneFatture"
Just include ~examples/ricezione-fatture.php~ in your endpoint. For example, if your test endpoint is
#+BEGIN_SRC
https://test.example.com/ricezione/index.php
#+END_SRC
put the following code in your ~index.php~:
#+BEGIN_SRC
Namespaces
Please note namespace is changed (v0.1.1), it is now ~Taocomp\Einvoicing\SdicoopServer~.
So to use e.g. ~WebService~ class:
#+BEGIN_SRC
use \Taocomp\Einvoicing\SdicoopServer\WebService;
#+END_SRC
** Setup
*** Web service "TrasmissioneFatture"
- Copy ~examples/TrasmissioneFattureHandler.php~ somewhere in your project and add logic for saving invoices and notices on filesystem and/or database
- Copy then content of ~examples/trasmissione-fatture.php~ in your endpoint file
- Modify paths accordingly
For example, if your handler class is:
#+BEGIN_SRC
class MyTrasmissioneFattureHandler
{
//...