Changeset 1750125
- Timestamp:
- 10/20/2017 08:04:33 PM (8 years ago)
- Location:
- pushpress-integration/trunk
- Files:
-
- 19 edited
-
inc/wp_pushpress_model.php (modified) (5 diffs)
-
inc/wp_pushpress_shortcode.php (modified) (1 diff)
-
lib/php-sdk/lib/Pushpress.php (modified) (1 diff)
-
lib/php-sdk/lib/Pushpress/ApiRequestor.php (modified) (8 diffs)
-
lib/php-sdk/lib/Pushpress/ApiResource.php (modified) (7 diffs)
-
lib/php-sdk/lib/Pushpress/Billing.php (modified) (1 diff)
-
lib/php-sdk/lib/Pushpress/Client.php (modified) (1 diff)
-
lib/php-sdk/lib/Pushpress/Contract.php (modified) (1 diff)
-
lib/php-sdk/lib/Pushpress/Customer.php (modified) (3 diffs)
-
lib/php-sdk/lib/Pushpress/Invoice.php (modified) (1 diff)
-
lib/php-sdk/lib/Pushpress/Message.php (modified) (1 diff)
-
lib/php-sdk/lib/Pushpress/Product.php (modified) (3 diffs)
-
lib/php-sdk/lib/Pushpress/Pushpress.php (modified) (2 diffs)
-
lib/php-sdk/lib/Pushpress/Token.php (modified) (1 diff)
-
lib/php-sdk/lib/Pushpress/TrackWorkout.php (modified) (1 diff)
-
lib/php-sdk/lib/Pushpress/User.php (modified) (2 diffs)
-
lib/php-sdk/lib/Pushpress/Util.php (modified) (1 diff)
-
pushpress.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pushpress-integration/trunk/inc/wp_pushpress_model.php
r1617931 r1750125 596 596 // get integration settings 597 597 $integration_settings = Pushpress_Client::settings('lead_capture'); 598 599 $integration_settings = $integration_settings->data; 598 600 /* 599 601 if (!$integration_settings = get_transient("pp_settings_lead_capture")) { … … 846 848 try { 847 849 $integration_settings = Pushpress_Client::settings('integration'); 850 $integration_settings = $integration_settings->data; 848 851 } 849 852 catch (Exception $e) { … … 854 857 try { 855 858 $integration_settings = Pushpress_Client::settings('integration'); 859 $integration_settings = $integration_settings->data; 856 860 } 857 861 catch (Exception $e) { … … 887 891 try { 888 892 $settingsObj = Pushpress_Client::settings('metrics'); 893 $settingsObj = $settingsObj->data; 889 894 } 890 895 catch (Exception $e) { … … 896 901 try { 897 902 $settingsObj = Pushpress_Client::settings('metrics'); 903 $settingsObj = $settingsObj->data; 898 904 } 899 905 catch (Exception $e) { -
pushpress-integration/trunk/inc/wp_pushpress_shortcode.php
r1608875 r1750125 185 185 186 186 if( !$client = get_transient( 'pp_client2' ) ){ 187 echo "<br><br>Getting Client from API";188 187 try { 189 188 $client = Pushpress_Client::retrieve('self'); -
pushpress-integration/trunk/lib/php-sdk/lib/Pushpress.php
r1276989 r1750125 38 38 39 39 // Pushpress API Resources 40 require(dirname(__FILE__) . '/Pushpress/Activity.php'); 41 require(dirname(__FILE__) . '/Pushpress/App.php'); 40 42 require(dirname(__FILE__) . '/Pushpress/Billing.php'); 41 43 require(dirname(__FILE__) . '/Pushpress/Calendar.php'); 44 require(dirname(__FILE__) . '/Pushpress/CalendarItemRating.php'); 45 require(dirname(__FILE__) . '/Pushpress/CalendarType.php'); 42 46 require(dirname(__FILE__) . '/Pushpress/Checkin.php'); 43 47 require(dirname(__FILE__) . '/Pushpress/Client.php'); 44 48 require(dirname(__FILE__) . '/Pushpress/Contract.php'); 45 49 require(dirname(__FILE__) . '/Pushpress/Customer.php'); 50 require(dirname(__FILE__) . '/Pushpress/Document.php'); 46 51 require(dirname(__FILE__) . '/Pushpress/Discount.php'); 47 52 require(dirname(__FILE__) . '/Pushpress/Invoice.php'); 53 require(dirname(__FILE__) . '/Pushpress/InvoiceItem.php'); 48 54 require(dirname(__FILE__) . '/Pushpress/Message.php'); 55 require(dirname(__FILE__) . '/Pushpress/MessageLog.php'); 56 require(dirname(__FILE__) . '/Pushpress/MetricsCoach.php'); 49 57 require(dirname(__FILE__) . '/Pushpress/Order.php'); 58 require(dirname(__FILE__) . '/Pushpress/Partner.php'); 59 require(dirname(__FILE__) . '/Pushpress/Payrate.php'); 60 require(dirname(__FILE__) . '/Pushpress/PayrollItem.php'); 61 require(dirname(__FILE__) . '/Pushpress/PayrollReport.php'); 50 62 require(dirname(__FILE__) . '/Pushpress/Plan.php'); 63 require(dirname(__FILE__) . '/Pushpress/PlanCalendarItemType.php'); 64 require(dirname(__FILE__) . '/Pushpress/PlanCategory.php'); 51 65 require(dirname(__FILE__) . '/Pushpress/Preorder.php'); 52 66 require(dirname(__FILE__) . '/Pushpress/Product.php'); 53 67 require(dirname(__FILE__) . '/Pushpress/ProductCategories.php'); 54 68 require(dirname(__FILE__) . '/Pushpress/Registration.php'); 69 require(dirname(__FILE__) . '/Pushpress/Report.php'); 55 70 require(dirname(__FILE__) . '/Pushpress/User.php'); 71 require(dirname(__FILE__) . '/Pushpress/SchedulerCredit.php'); 72 require(dirname(__FILE__) . '/Pushpress/SchedulerType.php'); 73 require(dirname(__FILE__) . '/Pushpress/SchedulerRate.php'); 56 74 require(dirname(__FILE__) . '/Pushpress/Subscriptions.php'); 75 require(dirname(__FILE__) . '/Pushpress/SubscriptionPayroll.php'); 57 76 require(dirname(__FILE__) . '/Pushpress/SubscriptionContract.php'); 58 77 require(dirname(__FILE__) . '/Pushpress/TaxRates.php'); 59 78 require(dirname(__FILE__) . '/Pushpress/Token.php'); 60 79 require(dirname(__FILE__) . '/Pushpress/Track.php'); 80 require(dirname(__FILE__) . '/Pushpress/TrackBenchmark.php'); 81 require(dirname(__FILE__) . '/Pushpress/TrackBenchmarkResult.php'); 61 82 require(dirname(__FILE__) . '/Pushpress/TrackWorkout.php'); 62 83 require(dirname(__FILE__) . '/Pushpress/TrackFavoriteWorkout.php'); 63 84 require(dirname(__FILE__) . '/Pushpress/TrackScoringType.php'); 64 85 require(dirname(__FILE__) . '/Pushpress/TrackWorkoutType.php'); 86 require(dirname(__FILE__) . '/Pushpress/UserImage.php'); 87 require(dirname(__FILE__) . '/Pushpress/UserTip.php'); 65 88 require(dirname(__FILE__) . '/Pushpress/Waiver.php'); 66 89 require(dirname(__FILE__) . '/Pushpress/Workout.php'); 90 require(dirname(__FILE__) . '/Pushpress/UserDocument.php'); 67 91 require(dirname(__FILE__) . '/Pushpress/UserWaiver.php'); -
pushpress-integration/trunk/lib/php-sdk/lib/Pushpress/ApiRequestor.php
r1500641 r1750125 81 81 82 82 if (!is_array($resp) || !isset($resp['error'])) 83 throw new Pushpress_ApiError(" Invalid response object from API: $rbody (HTTP response code was $rcode)", $rcode, $rbody, $resp);83 throw new Pushpress_ApiError("There was an error: $rbody", $rcode, $rbody, $resp); 84 84 $error = $resp['error']; 85 85 switch ($rcode) { … … 106 106 if (!$myApiKey) 107 107 $myApiKey = PushpressApi::$apiKey; 108 if (!$myApiKey) 109 throw new Pushpress_AuthenticationError('No API key provided. (HINT: set your API key using "PushpressApi::setApiKey(<API-KEY>)". You can generate API keys from the Pushpress web interface. See https://pushpress.com/api for details, or email support@pushpress.com if you have any questions.'); 108 109 110 111 // if (!$myApiKey) 112 // allow no api key requests 113 // throw new Pushpress_AuthenticationError('No API key provided. (HINT: set your API key using "PushpressApi::setApiKey(<API-KEY>)". You can generate API keys from the Pushpress web interface. See https://pushpress.com/api for details, or email support@pushpress.com if you have any questions.'); 110 114 111 115 … … 120 124 'publisher' => 'pushpress', 121 125 'uname' => $uname); 122 $headers = array('X-Pushpress-Client-User-Agent: ' . json_encode($ua), 123 'User-Agent: Pushpress/v1 PhpBindings/' . PushpressApi::VERSION, 124 'Authorization: Basic ' . base64_encode($myApiKey)); 126 127 $user_agent = "Pushpress/v1:" . (array_key_exists('PP-APP-ID', $_SERVER) ? $_SERVER['PP-APP-ID'] : 'Generic PhpBindings' ); 128 129 $headers = array('X-Pushpress-Client-User-Agent: ' . json_encode($ua), 130 'User-Agent: ' . $user_agent); 131 132 if (strlen($myApiKey)) { 133 $headers[] = 'Authorization: Basic ' . base64_encode($myApiKey); 134 } 135 136 125 137 if (PushpressApi::$apiVersion) 126 138 $headers[] = 'Pushpress-Version: ' . PushpressApi::$apiVersion; 127 139 128 140 $headers[] = 'X-FORWARDED-FOR: ' . $_SERVER['REMOTE_ADDR']; 141 129 142 list($rbody, $rcode) = $this->_curlRequest($meth, $absUrl, $headers, $params); 130 143 return array($rbody, $rcode, $myApiKey); … … 132 145 133 146 private function _interpretResponse($rbody, $rcode) 134 { 147 { 148 149 $rbody = str_replace("\&", "&", $rbody); 150 135 151 try { 136 152 $resp = json_decode($rbody, true); … … 138 154 throw new Pushpress_ApiError("Invalid response body from API: $rbody (HTTP response code was $rcode)", $rcode, $rbody); 139 155 } 140 156 141 157 if (!$resp) { 142 158 $resp = json_decode($rbody, true); … … 158 174 $opts[CURLOPT_HTTPGET] = 1; 159 175 if (count($params) > 0) { 160 $encoded = self::encode($params);161 $absUrl = "$absUrl?$encoded";176 $encoded = self::encode($params); 177 $absUrl = "$absUrl?$encoded"; 162 178 } 163 179 } else if ($meth == 'post') { … … 174 190 } 175 191 else if ($meth == 'delete') { 176 $opts[CURLOPT_CUSTOMREQUEST] = 'DELETE'; 192 $opts[CURLOPT_CUSTOMREQUEST] = "DELETE"; 193 $opts[CURLOPT_POSTFIELDS] = self::encode($params); 194 177 195 if (count($params) > 0) { 178 $encoded = self::encode($params);179 $absUrl = "$absUrl?$encoded";180 }196 $encoded = self::encode($params); 197 $absUrl = "$absUrl?$encoded"; 198 } 181 199 } else { 182 200 throw new Pushpress_ApiError("Unrecognized method $meth"); … … 209 227 } 210 228 229 211 230 212 231 -
pushpress-integration/trunk/lib/php-sdk/lib/Pushpress/ApiResource.php
r1571482 r1750125 9 9 throw new Pushpress_Error("You must pass an value Identifer into the retrieve function to get an object."); 10 10 } 11 11 12 $instance = new $class($id, $apiKey); 12 13 $instance->refresh($params); … … 57 58 $requestor = new Pushpress_ApiRequestor($this->_apiKey); 58 59 $url = $this->emptyUrl(); 60 // echo $url; 61 // die(); 59 62 list($response, $apiKey) = $requestor->request('get', $url, $this->_retrieveOptions); 60 63 $this->refreshFrom($response, $apiKey); … … 103 106 public function instanceUrl() 104 107 { 105 $id = $this['id']; 108 $id = $this['id']; 109 110 if (!$id) { 111 $id = $this['uuid']; 112 } 106 113 $class = get_class($this); 107 114 $id = Pushpress_ApiRequestor::utf8($id); … … 168 175 $requestor = new Pushpress_ApiRequestor($apiKey); 169 176 $url = self::_scopedLsb($class, 'classUrl', $class); 170 $url = preg_replace("/(ss)$/", "s", $url); 177 $url = preg_replace("/(ss)$/", "s", $url); 178 // echo $url; 179 // echo '<br>'; 180 // var_dump($params); 181 //die(); 171 182 list($response, $apiKey) = $requestor->request('post', $url, $params); 172 183 return Pushpress_Util::convertToPushpressObject($response, $apiKey); … … 181 192 if (count($params) > 0) { 182 193 $url = $this->instanceUrl(); 183 194 // echo "<br>URL: " . $url; 195 // echo "<br>params:<br>"; 196 // var_dump($params); 197 // die(); 198 184 199 list($response, $apiKey) = $requestor->request('post', $url, $params); 185 200 $this->refreshFrom($response, $apiKey); … … 193 208 $requestor = new Pushpress_ApiRequestor($this->_apiKey); 194 209 $params = $this->serializeParameters(); 195 210 196 211 if (count($params) > 0) { 197 212 $url = $this->instanceUrl(); 213 214 // echo 'URL ' . $url; 215 // echo 'PRARAMS:<br>';var_dump($params); 216 // die(); 217 198 218 list($response, $apiKey) = $requestor->request('put', $url, $params); 199 219 $this->refreshFrom($response, $apiKey); … … 207 227 $requestor = new Pushpress_ApiRequestor($this->_apiKey); 208 228 $url = $this->instanceUrl(); 209 229 230 //echo $url; 231 //var_dump($params); 232 //die(); 233 210 234 list($response, $apiKey) = $requestor->request('delete', $url, $params); 211 235 $this->refreshFrom($response, $apiKey); 212 236 return $this; 213 237 } 238 239 protected static function _scopedReport($class, $report_name, $params=null, $apiKey=null) 240 { 241 $requestor = new Pushpress_ApiRequestor($apiKey); 242 $url = self::_scopedLsb($class, 'classUrl', $class); 243 $url = preg_replace("/(ss)$/", "s", $url); 244 $url .= "/" . $report_name; 245 246 $p = null; 247 248 if ($params) { 249 $params = json_encode($params); 250 $p = array( 251 "params" => $params 252 ); 253 } 254 list($response, $apiKey) = $requestor->request('post', $url, $p); 255 256 return Pushpress_Util::convertToPushpressObject($response, $apiKey); 257 } 214 258 } -
pushpress-integration/trunk/lib/php-sdk/lib/Pushpress/Billing.php
r1230496 r1750125 38 38 } 39 39 40 public static function retrieveAch($params=null, $apiKey=null) { 41 42 $class = get_class(); 43 $url = self::classUrl($class); 44 $url .= "/" . $params['user_id'] . "/ach"; 45 46 $requestor = new Pushpress_ApiRequestor(); 47 list($response, $apiKey) = $requestor->request('get', $url, $params); 48 return Pushpress_Util::convertToPushpressObject($response, $apiKey); 49 } 50 51 public static function linkPlaidAch($params=null, $apiKey=null) { 52 53 $class = get_class(); 54 $url = self::classUrl($class); 55 $url .= "/ach/plaid"; 56 57 $requestor = new Pushpress_ApiRequestor(); 58 list($response, $apiKey) = $requestor->request('post', $url, $params); 59 return Pushpress_Util::convertToPushpressObject($response, $apiKey); 60 } 61 62 63 public static function verifyAch($params=null, $apiKey=null) { 64 65 $class = get_class(); 66 $url = self::classUrl($class); 67 $url .= "/ach"; 68 $requestor = new Pushpress_ApiRequestor(); 69 list($response, $apiKey) = $requestor->request('post', $url, $params); 70 return Pushpress_Util::convertToPushpressObject($response, $apiKey); 71 } 72 73 74 40 75 public static function all($params=null, $apiKey=null) 41 76 { -
pushpress-integration/trunk/lib/php-sdk/lib/Pushpress/Client.php
r1276989 r1750125 51 51 $url .= "/settings/$type"; 52 52 $requestor = new Pushpress_ApiRequestor(); 53 // $x = $requestor->request('get', $url);54 53 list($response, $apiKey) = $requestor->request('get', $url); 55 54 return Pushpress_Util::convertToPushpressObject($response, $apiKey); 56 //list($response, $apiKey) = $requestor->request('get', $url); 57 //return self::scopedConstructFrom($class, $response, $apiKey); 58 59 } 55 } 60 56 61 57 public static function referralSources() { -
pushpress-integration/trunk/lib/php-sdk/lib/Pushpress/Contract.php
r1276989 r1750125 1 1 <?php 2 2 3 class Pushpress_Contract sextends Pushpress_ApiResource3 class Pushpress_Contract extends Pushpress_ApiResource 4 4 { 5 5 -
pushpress-integration/trunk/lib/php-sdk/lib/Pushpress/Customer.php
r1276989 r1750125 75 75 return $this; 76 76 } 77 public function customers($params=null, $apiKey=null) { 78 79 $requestor = new Pushpress_ApiRequestor($this->_apiKey); 80 $url = $this->instanceUrl() . '/customers'; 81 82 list($response, $apiKey) = $requestor->request('get', $url, $params); 83 $this->refreshFrom($response, $apiKey); 84 return $this; 85 } 77 86 78 87 public function leadfunnel($params=null, $apiKey=null) { … … 90 99 $requestor = new Pushpress_ApiRequestor($this->_apiKey); 91 100 $url = $this->instanceUrl() . '/leadfunnel'; 92 list($response, $apiKey) = $requestor->request('post', $url, $params);101 list($response, $apiKey) = $requestor->request('post', $url, $params); 93 102 $this->refreshFrom($response, $apiKey); 94 103 95 return $this;104 return $this; 96 105 } 97 106 … … 115 124 return $this; 116 125 } 126 127 public function roster($params=null, $apiKey=null) { 128 $requestor = new Pushpress_ApiRequestor($this->_apiKey); 129 $url = $this->instanceUrl() . '/roster'; 130 131 list($response, $apiKey) = $requestor->request('get', $url, $params); 132 $this->refreshFrom($response, $apiKey); 133 return $this; 134 } 135 136 public function referrals($params=null, $apiKey=null) { 137 $requestor = new Pushpress_ApiRequestor($this->_apiKey); 138 $url = $this->instanceUrl() . '/referrals'; 139 140 list($response, $apiKey) = $requestor->request('get', $url, $params); 141 $this->refreshFrom($response, $apiKey); 142 return $this; 143 } 144 145 public function validate($params=null) { 146 $class = get_class(); 147 $url = self::classUrl($class); 148 $url .= "/validate"; 149 150 $requestor = new Pushpress_ApiRequestor(); 151 list($response, $apiKey) = $requestor->request('post', $url, $params); 152 return Pushpress_Util::convertToPushpressObject($response, $apiKey); 153 154 } 155 117 156 118 157 } -
pushpress-integration/trunk/lib/php-sdk/lib/Pushpress/Invoice.php
r1276989 r1750125 79 79 public function charge($params=array()) { 80 80 $url = $this->instanceUrl() . '/charge'; 81 81 82 $requestor = new Pushpress_ApiRequestor($this->_apiKey); 82 // echo $url;83 // echo '<br>';84 // var_dump($params);85 // die();83 // echo $url; 84 // echo '<br>'; 85 // var_dump($params); 86 // die(); 86 87 list($response, $apiKey) = $requestor->request('post', $url, $params); 87 88 //$this->refreshFrom(array('subscription' => $response), $apiKey, true); -
pushpress-integration/trunk/lib/php-sdk/lib/Pushpress/Message.php
r1230496 r1750125 39 39 40 40 $url = self::_scopedLsb($class, 'classUrl', $class); 41 41 42 42 43 list($response, $apiKey) = $requestor->request('post', $url, $params); -
pushpress-integration/trunk/lib/php-sdk/lib/Pushpress/Product.php
r1230496 r1750125 83 83 "position" => $image['position'] 84 84 ); 85 85 86 $requestor = new Pushpress_ApiRequestor($this->_apiKey); 86 87 … … 101 102 "inventory" => isset($option['inventory']) ? $option['inventory']: null, 102 103 "cost" => isset($option['cost']) ? $option['cost']: null, 104 "adjustment_comment" => isset($option['adjustment_comment']) ? $option['adjustment_comment']: null, 103 105 ); 106 104 107 $requestor = new Pushpress_ApiRequestor($this->_apiKey); 105 108 … … 134 137 return $response; 135 138 } 139 140 public static function getOptionById($id) { 141 $class = get_class(); 142 $url = self::classUrl($class); 143 $url .= "/options/" . $id; 144 145 $requestor = new Pushpress_ApiRequestor(); 146 147 list($response, $apiKey) = $requestor->request('get', $url, $params); 148 return self::scopedConstructFrom($class, $response, $apiKey); 149 150 } 151 136 152 137 153 } -
pushpress-integration/trunk/lib/php-sdk/lib/Pushpress/Pushpress.php
r1571482 r1750125 4 4 public static $apiKey; 5 5 public static $apiBase = 'https://api.pushpress.com'; 6 public static $apiVersion = null;6 public static $apiVersion = "v1"; 7 7 public static $verifySslCerts = false; 8 8 const VERSION = '1.0.0'; … … 49 49 self::$verifySslCerts = $verify; 50 50 } 51 52 51 53 } -
pushpress-integration/trunk/lib/php-sdk/lib/Pushpress/Token.php
r1277063 r1750125 50 50 $url .= "/pair"; 51 51 $requestor = new Pushpress_ApiRequestor(); 52 53 // echo $url; 54 // var_dump($params); 55 //die(); 52 56 53 57 list($response, $apiKey) = $requestor->request('post', $url, $params); 54 58 return self::scopedConstructFrom($class, $response, $apiKey); 55 59 } 60 61 56 62 } 57 63 -
pushpress-integration/trunk/lib/php-sdk/lib/Pushpress/TrackWorkout.php
r1277063 r1750125 59 59 return self::_scopedAll($class, $params, $apiKey); 60 60 } 61 62 public static function today($params=null, $apiKey=null) { 63 64 $requestor = new Pushpress_ApiRequestor($this->_apiKey); 65 $url = $this->instanceUrl() . '/today'; 66 67 68 list($response, $apiKey) = $requestor->request('get', $url, $params); 69 $this->refreshFrom($response, $apiKey); 70 return $this; 71 } 61 72 62 73 -
pushpress-integration/trunk/lib/php-sdk/lib/Pushpress/User.php
r1230496 r1750125 50 50 return self::_scopedAll($class, $params, $apiKey); 51 51 } 52 53 public static function ping() { 54 $class = get_class(); 55 $url = self::classUrl($class); 56 $url .= "/ping"; 57 $requestor = new Pushpress_ApiRequestor(); 58 59 list($response, $apiKey) = $requestor->request('get', $url, $params); 60 return self::scopedConstructFrom($class, $response, $apiKey); 61 62 } 52 63 53 64 public static function auth($params=null) { … … 62 73 } 63 74 64 public static function resetPin($ email=null) {75 public static function resetPin($params=null) { 65 76 $class = get_class(); 66 77 $url = self::classUrl($class); 67 68 $params['email'] = $email; 78 79 $p = array(); 80 81 if (!is_array($params)) { 82 $p['email'] = $params; 83 } 84 else { 85 $p = $params; 86 } 87 //$params['email'] = $email; 69 88 70 89 $url .= "/pinreset/"; 90 91 71 92 $requestor = new Pushpress_ApiRequestor(); 72 93 73 list($response, $apiKey) = $requestor->request('post', $url, $params); 94 list($response, $apiKey) = $requestor->request('post', $url, $p); 95 return self::scopedConstructFrom($class, $response, $apiKey); 96 } 97 98 public static function setupEmail($params=null) { 99 $class = get_class(); 100 $url = self::classUrl($class); 101 102 $p = array(); 103 104 if (!is_array($params)) { 105 $p['email'] = $params; 106 } 107 else { 108 $p = $params; 109 } 110 //$params['email'] = $email; 111 112 $url .= "/setupemail/"; 113 114 $requestor = new Pushpress_ApiRequestor(); 115 116 list($response, $apiKey) = $requestor->request('post', $url, $p); 74 117 return self::scopedConstructFrom($class, $response, $apiKey); 75 118 } -
pushpress-integration/trunk/lib/php-sdk/lib/Pushpress/Util.php
r1230496 r1750125 39 39 public static function convertToPushpressObject($resp, $apiKey) 40 40 { 41 //var_dump($resp); 41 42 $types = array( 42 'card' => 'Pushpress_Card', 43 'charge' => 'Pushpress_Charge', 43 'application' => 'Pushpress_App', 44 'billing' => 'Pushpress_Billing', 45 'calendar' => 'Pushpress_Calendar', 46 'calendar_item_rating' => 'Pushpress_CalendarItemRating', 47 'checkin' => 'Pushpress_Checkin', 48 'client' => 'Pushpress_Client', 49 'contract' => 'Pushpress_Contract', 44 50 'customer' => 'Pushpress_Customer', 51 'document' => 'Pushpress_Document', 52 'discount' => 'Pushpress_Discount', 45 53 'list' => 'Pushpress_List', 46 54 'invoice' => 'Pushpress_Invoice', 47 'invoiceitem' => 'Pushpress_InvoiceItem', 48 'event' => 'Pushpress_Event', 49 'transfer' => 'Pushpress_Transfer', 55 'invoice_item' => 'Pushpress_InvoiceItem', 56 'message' => 'Pushpress_Message', 57 'order' => 'Pushpress_Order', 58 'payrate' => 'Pushpress_PayRate', 50 59 'plan' => 'Pushpress_Plan', 51 'recipient' => 'Pushpress_Recipient', 52 'subscription' => 'Pushpress_Subscription' 60 'preorder' => 'Pushpress_Preorder', 61 'product' => 'Pushpress_Product', 62 'product_category' => 'Pushpress_ProductCategories', 63 'product_image' => 'Pushpress_ProductImages', 64 'registration' => 'Pushpress_Registration', 65 'scheduler_credit' => 'Pushpress_Scheduler_Credit', 66 'scheduler_type' => 'Pushpress_Scheduler_Type', 67 'scheduler_rate' => 'Pushpress_Scheduler_Rate', 68 'subscription_contract' => 'Pushpress_SubscriptionContracts', 69 'subscription' => 'Pushpress_Subscriptions', 70 'sub_pay' => 'Pushpress_Subscription_Payroll', 71 'tax_rate' => 'Pushpress_TaxRates', 72 'token' => 'Pushpress_Token', 73 'track' => 'Pushpress_Track', 74 'track_benchmark' => 'Pushpress_Track_Benchmark', 75 'track_benchmark_result' => 'Pushpress_Track_Benchmark_Result', 76 'track_favorite_workout' => 'Pushpress_Track_Favorite_Workout', 77 'track_score_type' => 'Pushpress_Track_Score_Type', 78 'track_workout' => 'Pushpress_Track_Workout', 79 'track_workout_type' => 'Pushpress_Track_Workout_Type', 80 'user' => 'Pushpress_User', 81 'user_tip' => 'Pushpress_UserTip', 82 'user_document' => 'Pushpress_UserDocument', 83 'user_image' => 'Pushpress_UserImage', 84 'user_waiver' => 'Pushpress_UserWaiver', 53 85 ); 54 86 if (self::isList($resp)) { -
pushpress-integration/trunk/pushpress.php
r1617941 r1750125 2 2 /** 3 3 * @package WP-PushPress 4 * @version 1.6. 24 * @version 1.6.3 5 5 */ 6 6 /* … … 9 9 Description: Easily integrate your workouts, calendar, products, membership plans, events and more with your Wordpress blog! This plugin is a free add-on for existing PushPress clients. See https://pushpress.com for more info. 10 10 Author: PushPress, Inc 11 Version: 1.6. 211 Version: 1.6.3 12 12 Author URI: https://pushpress.com 13 13 */ 14 14 define('PUSHPRESS_LOCAL', FALSE); 15 15 define('PUSHPRESS_DEV', FALSE); 16 define( 'PP_PLUGIN_VERSION', '1.6. 2');16 define( 'PP_PLUGIN_VERSION', '1.6.3'); 17 17 define( 'PUSHPRESS_ERROR_REPORT', 0 ); 18 18 define( 'PUSHPRESS_BUTTON_CLASS', 'pushpress-button-class-' . rand(0, 10000)); … … 234 234 235 235 function update_integration(){ 236 236 237 if( isset($_POST['save_pushpress_apikey_nonce']) && wp_verify_nonce($_POST['save_pushpress_apikey_nonce'], 'save_pushpress_apikey') && is_admin() ) { 237 238 … … 242 243 $recaptcha_sitekey = sanitize_text_field($_POST['recaptcha_sitekey']); 243 244 $recaptcha_secretkey = sanitize_text_field($_POST['recaptcha_secretkey']); 244 245 245 try { 246 246 PushpressApi::setApiKey( $pushpressApikey ); 247 247 PushpressApi::setHost( PUSHPRESS_HOST ); 248 248 PushpressApi::setApiVersion( PUSHPRESS_VERSION ); 249 $products = Pushpress_Product::all( array( 250 'active' => 1 251 ) ); 252 $resultIntegration = true; 249 250 $client = Pushpress_Client::retrieve('self'); 251 $resultIntegration = true; 253 252 } catch (Exception $e) { 254 253 $resultIntegration = false; -
pushpress-integration/trunk/readme.txt
r1617931 r1750125 4 4 Requires at least: 3.0.1 5 5 Tested up to: 4.6.1 6 Stable tag: 1.6. 26 Stable tag: 1.6.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 62 62 = 1.6.1 and 1.6.2 = 63 63 Debugging and small tweaks 64 65 = 1.6.3 = 66 Fixed a newly introduced error on the lead form that was not using the preferences to setup the form.
Note: See TracChangeset
for help on using the changeset viewer.