Changeset 2783969
- Timestamp:
- 09/13/2022 12:14:20 PM (4 years ago)
- Location:
- affiliate-power/trunk
- Files:
-
- 3 edited
-
affiliate-power.php (modified) (1 diff)
-
apis/ds24_api.php (modified) (14 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
affiliate-power/trunk/affiliate-power.php
r2689542 r2783969 6 6 AUTHOR: Jonas Breuer 7 7 AUTHOR URI: https://www.j-breuer.de 8 VERSION: 2.3. 08 VERSION: 2.3.1 9 9 Text Domain: affiliate-power 10 10 Min WP Version: 4.6 11 Max WP Version: 5.9.111 Max WP Version: 6.0 12 12 */ 13 13 if (!defined('ABSPATH')) die; //no direct access 14 14 15 define('AFFILIATE_POWER_VERSION', '2.3. 0');15 define('AFFILIATE_POWER_VERSION', '2.3.1'); 16 16 17 17 define('AFFILIATE_POWER_DIR', dirname(__FILE__).'/'); 18 define('AFFILIATE_POWER_API_URL', 'https:// www.affiliatepowerplugin.com/ap-api/api.php');18 define('AFFILIATE_POWER_API_URL', 'https://ap-api.banana-content.de/api.php'); 19 19 20 20 Affiliate_Power::prepare(); -
affiliate-power/trunk/apis/ds24_api.php
r1369957 r2783969 1 1 <?php 2 if (!defined('ABSPATH')) die; //no direct access3 4 2 /** 5 3 * Digistore24 REST Api Connector 6 4 * @author Christian Neise 7 * @link https://doc.digistore24.com/api- de/5 * @link https://doc.digistore24.com/api-en/ 8 6 * 9 7 * A php class providing a connection to the Digistore24 REST api server. … … 12 10 * Even if the Digistore24 api is extended, you still can use this connector. 13 11 * 14 * © 20 15 Digistore24 GmbH, alle Rechte vorbehalten12 * © 2022 Digistore24 Inc., all rights reserved 15 13 */ 16 14 17 15 /* 18 16 19 Copyright (c) 20 15 Digistore24 GmbH17 Copyright (c) 2022 20 18 21 19 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and … … 39 37 define( 'DS_ERR_UNKNOWN', 0 ); 40 38 define( 'DS_ERR_NOT_CONNECTED', 1 ); 41 define( 'DS_ERR_BAD_API_ CALL',2 );39 define( 'DS_ERR_BAD_API_KEY', 2 ); 42 40 define( 'DS_ERR_BAD_FUNCTION_PARAMS', 3 ); 43 41 define( 'DS_ERR_NOT_FOUND', 4 ); … … 46 44 define( 'DS_ERR_BAD_HTTP_CODE', 7 ); 47 45 define( 'DS_ERR_PERMISSION_DENIED', 8 ); 46 define( 'DS_ERR_BAD_API_CALL', 9 ); 48 47 49 48 … … 65 64 * use the api function ping() 66 65 * 67 * See api reference at https://doc .digistore24.com/api-en/66 * See api reference at https://docs.digistore24.com/api-en/ 68 67 * 69 68 * @param string $api_key Your api key from you Digistore24 account, e.g. 123-iKWIrTsUTbCyrFuotOdV8yO20nfMI5bbrZhDCUAG … … 119 118 $tokens = explode( '_', $language ); 120 119 121 $language = $tokens[0]; 122 123 $is_language_valid = in_array( $language, $this->_validLangs() ); 124 125 if ($is_language_valid) 120 $language = strtolower(trim($tokens[0])); 121 122 if ($language) 126 123 { 127 124 $this->language = $language; … … 171 168 */ 172 169 public function setBaseUrl( $url='https://www.digistore24.com' ){ 173 $this->base_url = $url; 174 } 175 170 $this->base_url = rtrim( $url, '/' ); 171 } 172 173 // 174 // private section ///////////////////////////////////////////////////////////////////////////////////////////// 175 // 176 176 private $api_key = ''; 177 177 private $language = ''; … … 220 220 $base_url = $this->base_url; 221 221 222 return "$base_url/api/call/ $key/json/";222 return "$base_url/api/call/"; 223 223 } 224 224 … … 257 257 258 258 259 private function _http_request( $url, $params, $settings =array() )259 private function _http_request( $url, $params, $settings=array() ) 260 260 { 261 261 $this->last_url = $url; … … 264 264 $querystring = http_build_query( $params, '', '&' ); 265 265 266 $headers = array (266 $headers = [ 267 267 'Content-type: application/x-www-form-urlencoded; charset=utf-8', 268 268 'Accept-Charset: utf-8', 269 ); 269 'Accept: application/json', 270 'X-DS-API-KEY: ' . $this->api_key, 271 ]; 270 272 271 273 if (!function_exists('curl_init')) { … … 319 321 if ($must_report) { 320 322 323 $api_key_disp = 'XXXX-XXXXXXXXXXXXXXXXX'; 324 if ($this->api_key) 325 { 326 $parts = explode( '-', $this->api_key ); 327 if (count($parts) >= 2) 328 { 329 $api_key_disp = $parts[0] . '-XXXXXXXXXXXXXXXXX'; 330 } 331 } 332 321 333 ob_start(); 322 echo "<pre>URL: $url\n Query: $querystring\nParams: ";334 echo "<pre>URL: $url\nApi key: $api_key_disp\nQuery: $querystring\nParams: "; 323 335 print_r( $params ); 324 336 echo "\nResponse:</pre>$contents"; … … 379 391 } 380 392 381 private function _validLangs() {382 return array_keys( $this->_errorMsgList() );383 }384 385 393 private function _errorMsgList() 386 394 { … … 389 397 DS_ERR_UNKNOWN => 'Unbekannter Fehler!', 390 398 DS_ERR_NOT_CONNECTED => 'Nicht zum Digistore24-Server verbunden.', 391 DS_ERR_BAD_API_CALL => 'Die Verbindungsparameter sind ungültig.', 399 DS_ERR_BAD_API_KEY => 'Die Verbindungsparameter sind ungültig.', 400 DS_ERR_BAD_API_CALL => 'Ungültiger Funktionsaufruf.', 392 401 DS_ERR_BAD_FUNCTION_PARAMS => 'Ungültige Parameter bei Funktionsaufruf %s.', 393 402 DS_ERR_BAD_SERVER_RESPONSE => 'Der Digistore24-Server hat eine ungültige Antwort geliefert. (Technische Information: %s)', … … 398 407 DS_ERR_UNKNOWN => 'Unknown error!', 399 408 DS_ERR_NOT_CONNECTED => 'Not connected to the Digistore24 server.', 400 DS_ERR_BAD_API_CALL => 'Invalid connection parameters.', 409 DS_ERR_BAD_API_KEY => 'Invalid connection parameters.', 410 DS_ERR_BAD_API_CALL => 'Invalid function call.', 401 411 DS_ERR_BAD_FUNCTION_PARAMS => 'Invalid parameters for function call %s.', 402 412 DS_ERR_BAD_SERVER_RESPONSE => 'The Digistore24 server delivered an invalid response. (Technical information: %s)', -
affiliate-power/trunk/readme.txt
r2689542 r2783969 4 4 Tags: affiliate marketing, tracking, sales, financeads, awin 5 5 Requires at least: 4.6 6 Tested up to: 5.9.16 Tested up to: 6.0 7 7 Requires PHP: 5.6 8 8 Stable tag: trunk
Note: See TracChangeset
for help on using the changeset viewer.