Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.26 KB | None | 0 0
  1. #!/usr/bin/php
  2. <?php
  3.  
  4. /**
  5.  * Adding PHP include
  6.  */
  7. set_include_path(get_include_path() . PATH_SEPARATOR . "/usr/local/mgr5/include/php");
  8. define('__MODULE__', "pmw1.php");
  9.  
  10. require_once 'bill_util.php';
  11.  
  12. /**
  13.  * [$longopts description]
  14.  * @var array
  15.  */
  16. $longopts  = array
  17. (
  18.     "command:",
  19.     "payment:",
  20.     "amount:",
  21. );
  22.  
  23. $options = getopt("", $longopts);
  24.  
  25. /**
  26.  * Processing --command
  27.  */
  28. try {
  29.     $command = $options['command'];
  30.     Debug("command ". $options['command']);
  31.  
  32.     if ($command == "config") {
  33.         $config_xml = simplexml_load_string($default_xml_string);
  34.         $feature_node = $config_xml->addChild("feature");
  35.         $feature_node->addChild("redirect",         "on"); // If redirect supported
  36.         $feature_node->addChild("notneedprofile",   "on"); // If notneedprofile supported
  37.         $feature_node->addChild("pmtune",           "off");
  38.         $feature_node->addChild("pmvalidate",       "off");
  39.         $feature_node->addChild("crvalidate",       "off");
  40.         $feature_node->addChild("crset",            "on");
  41.         $feature_node->addChild("crdelete",         "off");
  42.  
  43.         $param_node = $config_xml->addChild("param");
  44.  
  45.         $param_node->addChild("payment_script", "/cgi/w1.php");
  46.  
  47.         echo $config_xml->asXML();
  48.     } else {
  49.         throw new Error("unknown command");
  50.     }
  51. } catch (Exception $e) {
  52.     echo $e;
  53. }
  54.  
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement