Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- $wsdl = 'VerificaVoucher2024.wsdl';
- $endpoint = 'https://ws.cartadeldocente.istruzione.it/VerificaVoucherDocWEB/VerificaVoucher';
- $partitaiva = '00000000000';
- $certificato = 'cartadeldocente.pem';
- $password = 'xxxxxxxxxxx';
- $importo = 0;
- $codice = 'xxxxxxx';
- $client = new SoapClient($wsdl, array('location' => $endpoint,'local_cert' => $certificato,'passphrase' => $password));
- try
- {
- $result = $client->Check(array('checkReq' => array('tipoOperazione' => 1,'codiceVoucher' => $codice,'partitaIvaEsercente'=>$partitaiva)));
- $result = json_decode(json_encode($result), true);
- echo 'operazione riuscita';
- $importo = $result['checkResp']['importo'];
- } catch(Exception $e) {
- echo 'operazione non riuscita';
- die();
- }
- try
- {
- $result = $client->Confirm(array('checkReq' => array('tipoOperazione' => '1','codiceVoucher' => $codice,'importo'=> $importo)));
- $result = json_decode(json_encode($result), true);
- echo 'operazione riuscita';
- } catch(Exception $e) {
- echo 'Richiesta fallita';
- }
Advertisement
Add Comment
Please, Sign In to add comment