$identification |-> $application |-> $product |-> $request |-> $CSR |-> $organization |-> $contactAdm |-> $contactTech |-> $payment |-> $misc */ //login $identification = array ( 'utilisateur' => '', //Your username 'motDePasse' => '' //Your password ); /*Applicaiton*/ //Product $product = array( 'code' => 'PSfreeW', //Product code, see our documentation. 'dureeVie' => '90' //Product duration, can be '1','2' , '3' (years) or '90' (days) ); //Certificate information $CSR = ''; //Add your CSR here $request = array( 'logiciel' => 'Apache 2.x', //Software used : see our documentation for our sofware codes. 'nbLicence' => '', //Number of licenses for product requiring licenses, e.g. Symantec Secure Site or TBS X509 omnidomaine. 'CSR' => $CSR, 'domainePrincipal' => 'example.com', //Your main domain (CN) 'domaines' => 'example.com', //All your domains (space or new-line separated) (SAN), main domain included 'cloneTBS' => '', //If clonning, precise the TBS reference 'accompagnement' => 'oui', //oui (yes) or non (no) 'adresseDVC' => 'HTTP_CSR_HASH' //See DCV comment below. ); /*DCV: Possible values for the PositiveSSL fFree DV's DCV: - HTTP_CSR_HASH : HTTP file validation - HTTPS_CSR_HASH : HTTPS file validation */ //Organization $organization = array ( 'siren' => '123456789', //National identification number, i.e SIREN for French companies 'typeOrg' => 'FRRCS', //Organization type, see our documentation 'nom' => 'Example Ltd', //Official organization name, not a commercial name 'adresse1' => '01 Example Street', //Address Fields 'adresse2' => '', 'adresse3' => '', 'ville' => 'City', //City 'codePostal'=> '12345', //Postal Code 'pays' => 'FR', //ISO-3166 two letter country code 'state' => 'State', //State/Province/Département/etc 'telephone' => '+33-1-2345-6789', //Phone number, optionnal 'fax' => '', //Fax number, optionnal 'codeNAF' => '1356', //NAF Code, see our documentation 'numTVA' => 'FR12345678900',//VAT Number, optionnal 'siteWeb' => "www.example.com" //Website, optionnal ); //Administrative Contact $contactAdm = array ( 'nomAdm' => 'Test', //Lastname 'prenomAdm' => 'John', //Firstname 'fonctionAdm'=> 'CEO', //Function 'telAdm' => '++33-1-2345-6789', //Phone number 'emailAdm' => 'john.test@example.com', //Email Address ); //Technical Contact $contactTech = array ( 'nomTech' => 'Test', //Lastname 'prenomTech' => 'Jane', //Firstname 'fonctionTech'=> 'IT', //Function 'telTech' => '+33-1-2345-6789', //Phone number 'emailTech' => 'jane.test@example.com' //Email Address ); //No payment will be done unless a paying product or option is purchased $payment = array ( 'modePaiement'=>'0ch', //Payment method, see our documentation 'devis'=> 'non' //Quotation ? oui (yes) or non (no) ); $misc = array ( 'codePromo' => '', //Optionnal promotionnal code 'notesClient'=> '', //Optional note you might want to leave 'refClient' => '' //Your (optionnal) reference ); //Main order information $application = array( 'refDemande' => '', 'produit' => $product, 'requete' => $request, 'organisation' => $organization, 'contactAdm' => $contactAdm, 'contactTech' => $contactTech, 'paiement' => $payment, 'divers' => $misc ); //Making the final array $order = array ( 'identification' => $identification, 'demande' => $application ); /** XML-RPC **/ //Type vars $RpcType = array ( 'dureeVie' => 'int', 'nbLicence' => 'int', 'keySize' => 'int', 'typeDemande' => 'int' ); $rpcValues = array(); //Functions //Converts our arrays into RPC-ready data, uses recursivity for structures. function tab2rpc($tab) { $tabReturn = false; if ($tab && is_array($tab)) { $tabReturn = array(); while (list($key,$val) = each($tab)) { if ($val && is_array($val)) { $tabReturn[$key]=new xmlrpcval(tab2rpc($val), "struct"); }else{ if (isset($RpcType[$key])) $type = $RpcType[$key]; else $type = "string"; $tabReturn[$key]=new xmlrpcval($val, $type); } } } return $tabReturn; } /*RPC main code*/ $rpcValues = tab2rpc($order); $message = new xmlrpcmsg('achat'); $message->addParam(new xmlrpcval($rpcValues,"struct")); $client = new xmlrpc_client($appli, $serveur, $port); $client->setSSLVerifyPeer(false); $client->setSSLVerifyHost(false); $client->setDebug(2); $reponse = $client->send($message,0,$transport); $valeur = $reponse->value(); //Response Display if(!$reponse->faultCode()) { $msig = php_xmlrpc_decode($valeur); echo "
".nl2br(print_r($msig,true))."
"; echo '
'; foreach($msig AS $l => $table) echo ''; echo '
'.$l.' '.$table['codeReponse'].' '.$table['messageReponse'].'
'; } else{ echo "Erreur:

Code: ".$reponse->faultCode()."
Message : ".$reponse->faultString()."

"; echo "
reponse :
".print_r($reponse, true)."

\n"; }