Source for file config.php

Documentation is available at config.php

  1. <?php
  2. /**
  3. * ========================================================
  4. * phpGCheckout, Open Source PHP G Checkout Library
  5. * http://www.phpgcheckout.com
  6. * ========================================================
  7. *
  8. * Copyright (c) 2006 Expert Database Solutions, LLC
  9. *
  10. * Permission is hereby granted, free of charge, to any person obtaining a
  11. * copy of this software and associated documentation files (the "Software"),
  12. * to deal in the Software without restriction, including without limitation the
  13. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14. * copies of the Software, and to permit persons to whom the Software is
  15. * furnished to do so, subject to the following conditions:
  16. *
  17. * The above copyright notice and this permission notice shall be included in all
  18. * copies or substantial portions of the Software.
  19. *
  20. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  21. * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  22. * PARTICULAR PURPOSE AND NONINFRINGEMENT.
  23. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
  24. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
  25. * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  26. *
  27. */
  28. /**
  29. * phpGCheckout Globals
  30. *
  31. * @author Ron Howard
  32. * @copyright Expert Database Solutions,LLC 2006
  33. *
  34. */
  35. $use_sandbox = true;
  36. //====================================================================================//
  37. // GCheckout Global Variables
  38. //====================================================================================//
  39.  
  40.  
  41. /**
  42. * Set the Global Constants used by the GCheckout Class
  43. */
  44. $GLOBALS['GCheckout_xmlSchema'] = 'http://checkout.google.com/schema/2';
  45. $GLOBALS['GCheckout_currency'] = 'USD';
  46. //====================================================================================//
  47. // SSL Validation
  48. //====================================================================================//
  49. define('VALIDATE_GOOGLE_SSL_CERT', 2); /*
  50. 1 to check the existence of a common name in the SSL peer certificate.
  51. 2 to check the existence of a common name and also verify that it matches the hostname provided.
  52. */
  53. define('VALIDATE_MY_SSL_CERT', false);
  54. //====================================================================================//
  55. // Setup Enviroment
  56. //====================================================================================//
  57. /**
  58. * Decides which include path delimerter to use. Windows should be using
  59. * a semi-colon and everything else should be using a colon.
  60. */
  61. if(strpos(__FILE__, ':') !== false) {
  62. $path_delimiter = ';';
  63. }
  64. else {
  65. $path_delimiter = ':';
  66. }
  67. /**
  68. * Set local installation of required PEAR
  69. * libraries
  70. */
  71. ini_set('include_path', ini_get('include_path').$path_delimiter.dirname(__FILE__).'/PEAR');
  72. //====================================================================================//
  73. // Link Libraries & Classes
  74. //====================================================================================//
  75. require_once('XML/Serializer.php');
  76. require_once('XML/Unserializer.php');
  77. require_once('classes/gCart.php');
  78. require_once('classes/gTaxTable.php');
  79. require_once('classes/gTaxRule.php');
  80. require_once('classes/gShipping.php');
  81. require_once('classes/gItem.php');
  82. require_once('classes/gMerchantCalculations.php');
  83. require_once('classes/gMessageRedirect.php');
  84. require_once('classes/gButton.php');
  85. require_once('classes/gWebListener.php');
  86. require_once('classes/gWebPoster.php');
  87. require_once('classes/notifications/gChargeAmountNotification.php');
  88. require_once('classes/notifications/gChargebackAmountNotification.php');
  89. require_once('classes/notifications/gNewOrderNotification.php');
  90. require_once('classes/notifications/gOrderStateChangeNotification.php');
  91. require_once('classes/notifications/gRefundAmountNotification.php');
  92. require_once('classes/notifications/gRiskInformationNotification.php');
  93. require_once('classes/notifications/gNotificationAcknowledgment.php');
  94. require_once('classes/commands/gChargeOrder.php');
  95. require_once('classes/commands/gDeliverOrder.php');
  96. require_once('classes/commands/gSendBuyerMessage.php');
  97. require_once('classes/commands/gProcessOrder.php');
  98. //====================================================================================//
  99. // Globals you probably shouldn't change.
  100. //====================================================================================//
  101. /**
  102. * Google Provided URLs
  103. */
  104. if($use_sandbox)
  105. $sub_domain = 'sandbox';
  106. else
  107. $sub_domain = 'checkout';
  108. /**
  109. * Google Checkout Button Params
  110. */
  111. $GLOBALS['GCheckout_button'] = "http://$sub_domain.google.com/buttons/checkout.gif";
  112. $GLOBALS['GCheckout_button_w'] = 180;
  113. $GLOBALS['GCheckout_button_h'] = 46;
  114. $GLOBALS['GCheckout_button_loc'] = 'en_US';
  115. $GLOBALS['GCheckout_button_style'] = 'trans';
  116.  
  117. if(!empty($merchant_id)) {
  118. $GLOBALS['merchant_id'] = $merchant_id;
  119. }
  120. else if(!empty($GLOBALS['merchant_id']))
  121. $GLOBALS['merchant_id'] = $GLOBALS['merchant_id'];
  122. else
  123. $GLOBALS['merchant_id'] = '';
  124. $base_url = "https://$sub_domain.google.com/cws/v2/Merchant/" . $GLOBALS["merchant_id"];
  125. $GLOBALS["checkout_domain"] = "$sub_domain.google.com";
  126. $GLOBALS["checkout_url"] = $base_url . "/checkout";
  127. $GLOBALS["checkout_diagnose_url"] = $base_url . "/checkout/diagnose";
  128. $GLOBALS["request_url"] = $base_url . "/request";
  129. $GLOBALS["request_diagnose_url"] = $base_url . "/request/diagnose";
  130. //====================================================================================//
  131. // Important Enumerations
  132. //====================================================================================//
  133. /**
  134. * Country Areas
  135. */
  136. define('COUNTRY_AREA_CONTINENTAL_48', 'CONTINENTAL_48');
  137. define('COUNTRY_AREA_FULL_50', 'FULL_50_STATES');
  138. define('COUNTRY_AREA_ALL', 'ALL');
  139. /**
  140. * Tax Table Types
  141. */
  142. define('TAX_TABLE_DEFAULT', 'default');
  143. define('TAX_TABLE_ALTERNATE', 'alternate');
  144. define('TAX_TABLE_STANDALONE', 'true');
  145. /**
  146. * Declare Shipping Enumerations
  147. *
  148. */
  149. define('SHIPPING_FLAT_RATE', 'flat-rate-shipping');
  150. define('SHIPPING_PICKUP', 'pickup');
  151. define('SHIPPING_MERCHANT_CALCULATED', 'merchant-calculated-shipping');
  152. /**
  153. * Google Booleans
  154. */
  155. define('GCHECKOUT_TRUE', 'true');
  156. define('GCHECKOUT_FALSE', 'false');
  157. /**
  158. * Google Notification Types
  159. */
  160. define("NEW_ORDER_NOTIFICATION", 'new-order-notification');
  161. define("RISK_INFORMATION_NOTIFICATION", "risk-information-notification");
  162. define("ORDER_STATE_CHANGE_NOTIFICATION", "order-state-change-notification");
  163. define("CHARGE_AMOUNT_NOTIFICATION", "charge-amount-notification");
  164. define("REFUND_AMOUNT_NOTIFICATION", "refund-amount-notification");
  165. define("CHARGEBACK_AMOUNT_NOTIFICATION", "chargeback-amount-notification");
  166. /**
  167. * Platform Identifier
  168. */
  169. define("PLATFORM_ID", '459782357066897');
  170. ?>

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