Permalink
Browse files

added GetPromotionRuls

git-svn-id: http://svn.php.net/repository/pear/packages/Services_Ebay/trunk@176128 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent d6e3de7 commit adcd76efc75ad25636d303bd72566c1fedfa58b6 Stephan Schmidt committed Dec 31, 2004
Showing with 72 additions and 1 deletion.
  1. +47 −0 Ebay/Call/GetPromotionRules.php
  2. +0 −1 docs/todo.txt
  3. +25 −0 examples/example_GetPromotionRules.php
@@ -0,0 +1,47 @@
+<?PHP
+/**
+ * Get promotion rules
+ *
+ * $Id$
+ *
+ * @package Services_Ebay
+ * @author Stephan Schmidt <schst@php.net>
+ * @link http://developer.ebay.com/DevZone/docs/API_Doc/Functions/GetPromotionRules/GetPromotionRulesLogic.htm
+ */
+class Services_Ebay_Call_GetPromotionRules extends Services_Ebay_Call
+{
+ /**
+ * verb of the API call
+ *
+ * @var string
+ */
+ protected $verb = 'GetPromotionRules';
+
+ /**
+ * parameter map that is used, when scalar parameters are passed
+ *
+ * @var array
+ */
+ protected $paramMap = array(
+ 'PromotionMethod',
+ 'ItemId',
+ 'StoreCatId'
+ );
+
+ /**
+ * make the API call
+ *
+ * @param object Services_Ebay_Session
+ * @return string
+ */
+ public function call(Services_Ebay_Session $session)
+ {
+ $this->args = array('Context' => $this->args);
+ $return = parent::call($session);
+ if (!empty($return['PromotionRules'])) {
+ return $return['PromotionRules'];
+ }
+ return array();
+ }
+}
+?>
View
@@ -20,7 +20,6 @@ Methods to implement:
- GetProductSearchPage
- GetProductSearchResults
- GetProductSellingPages
-- GetPromotionRules
- GetRecommendations
- GetSellerEvents
- ReviseCheckoutTransactionDetails
@@ -0,0 +1,25 @@
+<?PHP
+/**
+ * example that fetches an item
+ *
+ * $Id$
+ *
+ * @package Services_Ebay
+ * @subpackage Examples
+ * @author Stephan Schmidt
+ */
+error_reporting(E_ALL);
+require_once '../Ebay.php';
+require_once 'config.php';
+
+$session = Services_Ebay::getSession($devId, $appId, $certId);
+$session->setToken($token);
+
+$ebay = new Services_Ebay($session);
+
+$rules = $ebay->GetPromotionRules('UpSell', '4502066038');
+
+echo '<pre>';
+print_r($rules);
+echo '</pre>';
+?>

0 comments on commit adcd76e

Please sign in to comment.