Source for file gDeliverOrder.php

Documentation is available at gDeliverOrder.php

  1. <?php
  2.  
  3. /**
  4. * ========================================================
  5. * phpGCheckout, Open Source PHP G Checkout Library
  6. * http://www.phpgcheckout.com
  7. * ========================================================
  8. *
  9. * Copyright (c) 2006 Expert Database Solutions, LLC
  10. *
  11. * Permission is hereby granted, free of charge, to any person obtaining a
  12. * copy of this software and associated documentation files (the "Software"),
  13. * to deal in the Software without restriction, including without limitation the
  14. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15. * copies of the Software, and to permit persons to whom the Software is
  16. * furnished to do so, subject to the following conditions:
  17. *
  18. * The above copyright notice and this permission notice shall be included in all
  19. * copies or substantial portions of the Software.
  20. *
  21. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  22. * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  23. * PARTICULAR PURPOSE AND NONINFRINGEMENT.
  24. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
  25. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
  26. * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  27. *
  28. */
  29. class gDeliverOrder {
  30. var $_google_order_number;
  31. var $_carrier;
  32. var $_tracking_number;
  33. var $_send_email;
  34. /**
  35. * Deliver Order
  36. *
  37. * @param unknown_type $google_order_number
  38. * @param unknown_type $carrier
  39. * @param unknown_type $tracking_number
  40. * @param unknown_type $send_email
  41. * @return gDeliverOrder
  42. */
  43. function gDeliverOrder($google_order_number, $carrier = '', $tracking_number ='', $send_email = false) {
  44. $this->_google_order_number = $google_order_number;
  45. $this->_carrier = $carrier;
  46. $this->_tracking_number = $tracking_number;
  47. $this->_send_email = $send_email;
  48. }
  49. /**
  50. * Return XML Message
  51. *
  52. * @return unknown
  53. */
  54. function getXML() {
  55. $str_xml = "<?xml version=\"1.0\" encoding=\"UTF-8.0\"?>";
  56. $str_xml.= "<deliver-order xmlns=\"".$GLOBALS['GCheckout_xmlSchema']."\" google-order-number=\"$this->_google_order_number\">";
  57.  
  58. if(!empty($this->_carrier) && !empty($this->_tracking_number))
  59. $str_xml .= "<tracking-data>
  60. <carrier>$this->_carrier</carrier>
  61. <tracking-number>$this->_tracking_number</tracking-number>
  62. </tracking-data>";
  63. if(!empty($this->_send_email))
  64. $str_xml .= "<send-email>".($this->_send_email = true ? GCHECKOUT_TRUE : GCHECKOUT_FALSE)."</send-email>";
  65. $str_xml.= "</deliver-order>";
  66. return $str_xml;
  67. }
  68. }
  69. ?>

Documentation generated on Mon, 04 Dec 2006 11:09:33 -0500 by phpDocumentor 1.3.0RC3