A modest collection of PHP libraries used at SparkFun.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

179 lines
7.5 KiB

  1. <?php
  2. namespace SparkLib\UPS\Rate;
  3. include_once('UPSSecurity.php');
  4. include_once('UsernameToken.php');
  5. include_once('ServiceAccessToken.php');
  6. include_once('Errors.php');
  7. include_once('ErrorDetailType.php');
  8. include_once('CodeType.php');
  9. include_once('AdditionalInfoType.php');
  10. include_once('AdditionalCodeDescType.php');
  11. include_once('LocationType.php');
  12. include_once('ClientInformationType.php');
  13. include_once('Property.php');
  14. include_once('RequestType.php');
  15. include_once('TransactionReferenceType.php');
  16. include_once('ResponseType.php');
  17. include_once('CodeDescriptionType.php');
  18. include_once('RateRequest.php');
  19. include_once('RateResponse.php');
  20. include_once('BillingWeightType.php');
  21. include_once('RatedPackageType.php');
  22. include_once('AccessorialType.php');
  23. include_once('RatedShipmentType.php');
  24. include_once('TotalChargeType.php');
  25. include_once('RatedShipmentInfoType.php');
  26. include_once('ChargesType.php');
  27. include_once('TransportationChargesType.php');
  28. include_once('FRSShipmentType.php');
  29. include_once('AddressType.php');
  30. include_once('ShipToAddressType.php');
  31. include_once('CODType.php');
  32. include_once('CODAmountType.php');
  33. include_once('DeliveryConfirmationType.php');
  34. include_once('DimensionsType.php');
  35. include_once('InsuredValueType.php');
  36. include_once('OnCallPickupType.php');
  37. include_once('PackageType.php');
  38. include_once('CommodityType.php');
  39. include_once('NMFCCommodityType.php');
  40. include_once('PackageServiceOptionsType.php');
  41. include_once('DryIceType.php');
  42. include_once('DryIceWeightType.php');
  43. include_once('ShipperDeclaredValueType.php');
  44. include_once('InsuranceType.php');
  45. include_once('InsuranceValueType.php');
  46. include_once('PackageWeightType.php');
  47. include_once('UOMCodeDescriptionType.php');
  48. include_once('ShipmentRatingOptionsType.php');
  49. include_once('ScheduleType.php');
  50. include_once('ShipFromType.php');
  51. include_once('ShipToType.php');
  52. include_once('ShipmentType.php');
  53. include_once('AlternateDeliveryAddressType.php');
  54. include_once('ADRType.php');
  55. include_once('IndicationType.php');
  56. include_once('ShipmentChargesType.php');
  57. include_once('ShipmentServiceOptionsType.php');
  58. include_once('ReturnServiceType.php');
  59. include_once('ImportControlType.php');
  60. include_once('RestrictedArticlesType.php');
  61. include_once('PickupOptionsType.php');
  62. include_once('DeliveryOptionsType.php');
  63. include_once('ShipperType.php');
  64. include_once('GuaranteedDeliveryType.php');
  65. include_once('FRSPaymentInfoType.php');
  66. include_once('PayerAddressType.php');
  67. include_once('InvoiceLineTotalType.php');
  68. /**
  69. *
  70. */
  71. class RateService extends \SoapClient
  72. {
  73. /**
  74. *
  75. * @var array $classmap The defined classes
  76. * @access private
  77. */
  78. private static $classmap = array(
  79. 'UPSSecurity' => '\SparkLib\UPS\Rate\UPSSecurity',
  80. 'UsernameToken' => '\SparkLib\UPS\Rate\UsernameToken',
  81. 'ServiceAccessToken' => '\SparkLib\UPS\Rate\ServiceAccessToken',
  82. 'Errors' => '\SparkLib\UPS\Rate\Errors',
  83. 'ErrorDetailType' => '\SparkLib\UPS\Rate\ErrorDetailType',
  84. 'CodeType' => '\SparkLib\UPS\Rate\CodeType',
  85. 'AdditionalInfoType' => '\SparkLib\UPS\Rate\AdditionalInfoType',
  86. 'AdditionalCodeDescType' => '\SparkLib\UPS\Rate\AdditionalCodeDescType',
  87. 'LocationType' => '\SparkLib\UPS\Rate\LocationType',
  88. 'ClientInformationType' => '\SparkLib\UPS\Rate\ClientInformationType',
  89. 'Property' => '\SparkLib\UPS\Rate\Property',
  90. 'RequestType' => '\SparkLib\UPS\Rate\RequestType',
  91. 'TransactionReferenceType' => '\SparkLib\UPS\Rate\TransactionReferenceType',
  92. 'ResponseType' => '\SparkLib\UPS\Rate\ResponseType',
  93. 'CodeDescriptionType' => '\SparkLib\UPS\Rate\CodeDescriptionType',
  94. 'RateRequest' => '\SparkLib\UPS\Rate\RateRequest',
  95. 'RateResponse' => '\SparkLib\UPS\Rate\RateResponse',
  96. 'BillingWeightType' => '\SparkLib\UPS\Rate\BillingWeightType',
  97. 'RatedPackageType' => '\SparkLib\UPS\Rate\RatedPackageType',
  98. 'AccessorialType' => '\SparkLib\UPS\Rate\AccessorialType',
  99. 'RatedShipmentType' => '\SparkLib\UPS\Rate\RatedShipmentType',
  100. 'TotalChargeType' => '\SparkLib\UPS\Rate\TotalChargeType',
  101. 'RatedShipmentInfoType' => '\SparkLib\UPS\Rate\RatedShipmentInfoType',
  102. 'ChargesType' => '\SparkLib\UPS\Rate\ChargesType',
  103. 'TransportationChargesType' => '\SparkLib\UPS\Rate\TransportationChargesType',
  104. 'FRSShipmentType' => '\SparkLib\UPS\Rate\FRSShipmentType',
  105. 'AddressType' => '\SparkLib\UPS\Rate\AddressType',
  106. 'ShipToAddressType' => '\SparkLib\UPS\Rate\ShipToAddressType',
  107. 'CODType' => '\SparkLib\UPS\Rate\CODType',
  108. 'CODAmountType' => '\SparkLib\UPS\Rate\CODAmountType',
  109. 'DeliveryConfirmationType' => '\SparkLib\UPS\Rate\DeliveryConfirmationType',
  110. 'DimensionsType' => '\SparkLib\UPS\Rate\DimensionsType',
  111. 'InsuredValueType' => '\SparkLib\UPS\Rate\InsuredValueType',
  112. 'OnCallPickupType' => '\SparkLib\UPS\Rate\OnCallPickupType',
  113. 'PackageType' => '\SparkLib\UPS\Rate\PackageType',
  114. 'CommodityType' => '\SparkLib\UPS\Rate\CommodityType',
  115. 'NMFCCommodityType' => '\SparkLib\UPS\Rate\NMFCCommodityType',
  116. 'PackageServiceOptionsType' => '\SparkLib\UPS\Rate\PackageServiceOptionsType',
  117. 'DryIceType' => '\SparkLib\UPS\Rate\DryIceType',
  118. 'DryIceWeightType' => '\SparkLib\UPS\Rate\DryIceWeightType',
  119. 'ShipperDeclaredValueType' => '\SparkLib\UPS\Rate\ShipperDeclaredValueType',
  120. 'InsuranceType' => '\SparkLib\UPS\Rate\InsuranceType',
  121. 'InsuranceValueType' => '\SparkLib\UPS\Rate\InsuranceValueType',
  122. 'PackageWeightType' => '\SparkLib\UPS\Rate\PackageWeightType',
  123. 'UOMCodeDescriptionType' => '\SparkLib\UPS\Rate\UOMCodeDescriptionType',
  124. 'CodeDescriptionType' => '\SparkLib\UPS\Rate\CodeDescriptionType',
  125. 'ShipmentRatingOptionsType' => '\SparkLib\UPS\Rate\ShipmentRatingOptionsType',
  126. 'ScheduleType' => '\SparkLib\UPS\Rate\ScheduleType',
  127. 'ShipFromType' => '\SparkLib\UPS\Rate\ShipFromType',
  128. 'ShipToType' => '\SparkLib\UPS\Rate\ShipToType',
  129. 'ShipmentType' => '\SparkLib\UPS\Rate\ShipmentType',
  130. 'AlternateDeliveryAddressType' => '\SparkLib\UPS\Rate\AlternateDeliveryAddressType',
  131. 'ADRType' => '\SparkLib\UPS\Rate\ADRType',
  132. 'IndicationType' => '\SparkLib\UPS\Rate\IndicationType',
  133. 'ShipmentChargesType' => '\SparkLib\UPS\Rate\ShipmentChargesType',
  134. 'ShipmentServiceOptionsType' => '\SparkLib\UPS\Rate\ShipmentServiceOptionsType',
  135. 'ReturnServiceType' => '\SparkLib\UPS\Rate\ReturnServiceType',
  136. 'ImportControlType' => '\SparkLib\UPS\Rate\ImportControlType',
  137. 'RestrictedArticlesType' => '\SparkLib\UPS\Rate\RestrictedArticlesType',
  138. 'PickupOptionsType' => '\SparkLib\UPS\Rate\PickupOptionsType',
  139. 'DeliveryOptionsType' => '\SparkLib\UPS\Rate\DeliveryOptionsType',
  140. 'ShipperType' => '\SparkLib\UPS\Rate\ShipperType',
  141. 'GuaranteedDeliveryType' => '\SparkLib\UPS\Rate\GuaranteedDeliveryType',
  142. 'FRSPaymentInfoType' => '\SparkLib\UPS\Rate\FRSPaymentInfoType',
  143. 'PayerAddressType' => '\SparkLib\UPS\Rate\PayerAddressType',
  144. 'InvoiceLineTotalType' => '\SparkLib\UPS\Rate\InvoiceLineTotalType');
  145. /**
  146. *
  147. * @param array $options A array of config values
  148. * @param string $wsdl The wsdl file to use
  149. * @access public
  150. */
  151. public function __construct(array $options = array(), $wsdl = 'lib/classes/SparkLib/UPS/Rate/wsdl/RateWS.wsdl')
  152. {
  153. foreach (self::$classmap as $key => $value) {
  154. if (!isset($options['classmap'][$key])) {
  155. $options['classmap'][$key] = $value;
  156. }
  157. }
  158. parent::__construct($wsdl, $options);
  159. }
  160. /**
  161. *
  162. * @param RateRequest $Body
  163. * @access public
  164. * @return RateResponse
  165. */
  166. public function ProcessRate(RateRequest $Body)
  167. {
  168. return $this->__soapCall('ProcessRate', array($Body));
  169. }
  170. }