Пример #1
0
 function get_xml()
 {
     $xml = '';
     $xml .= '<control fianetmodule="' . FIANET_MODULE . '" version="' . FIANET_VERSION . '">' . "\n";
     $xml .= $this->billing_user->get_xml();
     $xml .= $this->billing_adress->get_xml();
     if ($this->delivery_user != null) {
         if (var_is_object_of_class($this->delivery_user, 'fianet_delivery_user_xml')) {
             $xml .= $this->delivery_user->get_xml();
         } else {
             fianet_insert_log("fianet_order_xml.php - get_xml() <br />\nDelivery user is not an object of type fianet_delivery_user_xml");
         }
     }
     if ($this->delivery_adress != null && ($this->info_commande->transport->type == 4 || $this->info_commande->transport->type == 5)) {
         if (var_is_object_of_class($this->delivery_adress, 'fianet_delivery_adress_xml')) {
             $xml .= $this->delivery_adress->get_xml();
         } else {
             fianet_insert_log("fianet_order_xml.php - get_xml() <br />\nDelivery adress is not an object of type fianet_delivery_adress_xml");
         }
     }
     $xml .= $this->info_commande->get_xml();
     $xml .= $this->payment->get_xml();
     $xml .= '</control>';
     save_flux_xml($xml, $this->info_commande->refid);
     return $xml;
 }
 function get_xml()
 {
     $xml = '';
     $xml .= '<?xml version="1.0" encoding="' . FIANET_ENCODING . '" ?>' . "\n";
     $xml .= '<control fianetmodule="' . FIANET_MODULE . '" version="' . FIANET_VERSION . '">' . "\n";
     $xml .= $this->billing_user->get_xml();
     $xml .= $this->billing_adress->get_xml();
     if ($this->delivery_user != null) {
         if (var_is_object_of_class($this->delivery_user, 'fianet_delivery_user_xml')) {
             $xml .= $this->delivery_user->get_xml();
         } else {
             fianet_insert_log("fianet_rnp_order_xml.php - get_xml() <br />\nDelivery user is not an object of type fianet_delivery_user_xml");
         }
     }
     if ($this->delivery_adress != null && ($this->info_commande->transport->type == 4 || $this->info_commande->transport->type == 5)) {
         if (var_is_object_of_class($this->delivery_adress, 'fianet_delivery_adress_xml')) {
             $xml .= $this->delivery_adress->get_xml();
         } else {
             fianet_insert_log("fianet_rnp_order_xml.php - get_xml() <br />\nDelivery adress is not an object of type fianet_delivery_adress_xml");
         }
     }
     $xml .= $this->info_commande->get_xml();
     $this->wallet->generate_wallet_crypt_data($this->info_commande->refid, $this->billing_user->nom, $this->billing_user->email, $this->info_commande->montant);
     $xml .= $this->wallet->get_xml();
     $xml .= '</control>';
     save_flux_xml($xml, $this->info_commande->refid);
     return $xml;
 }
 function add_param($param)
 {
     if (var_is_object_of_class($param, 'fianet_paraobject_xml')) {
         $this->param_list[] = $param;
     } else {
         fianet_insert_log("Erreur : le paramètre n'est pas un objet fianet_paraobject_xml mais un objet : " . get_class($param) . "<br>");
     }
 }
 function add_product($product)
 {
     if (var_is_object_of_class($product, 'fianet_product_xml')) {
         $this->products_list[] = $product;
     } else {
         fianet_insert_log("fianet_product_list_xml.php - add_product() <br />Data are not a valid fianet_product_xml type\n");
     }
 }
 function get_xml()
 {
     $xml = '';
     if ($this->type != null) {
         $xml .= "\t" . '<adresse type="' . $this->type . '" format="' . $this->format . '">' . "\n";
         if ($this->rue1 != '') {
             $xml .= "\t\t" . '<rue1>' . clean_invalid_char($this->rue1) . '</rue1>' . "\n";
         } else {
             fianet_insert_log("fianet_adress_xml.php - get_xml() <br />\n rue1 is undefined");
             return;
         }
         if ($this->rue2 != "") {
             $xml .= "\t\t" . '<rue2>' . clean_invalid_char($this->rue2) . '</rue2>' . "\n";
         }
         if ($this->cpostal != "") {
             $xml .= "\t\t" . '<cpostal>' . clean_invalid_char($this->cpostal) . '</cpostal>' . "\n";
         } else {
             fianet_insert_log("fianet_adress_xml.php - get_xml() <br />\n cpostal is undefined");
             return;
         }
         if ($this->ville != "") {
             $xml .= "\t\t" . '<ville>' . clean_invalid_char($this->ville) . '</ville>' . "\n";
         } else {
             fianet_insert_log("fianet_adress_xml.php - get_xml() <br />\n ville is undefined");
             return;
         }
         if ($this->pays != "") {
             $xml .= "\t\t" . '<pays>' . clean_invalid_char($this->pays) . '</pays>' . "\n";
         } else {
             fianet_insert_log("fianet_adress_xml.php - get_xml() <br />\n pays is undefined");
             return;
         }
         if ($this->appartement != null) {
             if (var_is_object_of_class($this->appartement, 'fianet_appartment_xml')) {
                 $xml .= $this->appartement->get_xml();
             } else {
                 fianet_insert_log("fianet_adress_xml.php - get_xml() <br />\nAppartement is not an object of type fianet_appartment_xml");
             }
         }
         $xml .= "\t" . '</adresse>' . "\n";
     }
     return $xml;
 }
Пример #6
0
 function check_order_data()
 {
     $res = true;
     foreach ($this->orders as $order) {
         if (!var_is_object_of_class($order, 'fianet_order_xml')) {
             $res = false;
         }
     }
     return $res;
 }