Changeset 3830656
- Timestamp:
- 11/28/2026 12:28:37 AM (66 minutes ago)
- Location:
- icdsoft-reseller-store/trunk
- Files:
-
- 2 deleted
- 26 edited
-
README.md (deleted)
-
assets/js/widget.js (modified) (10 diffs)
-
icd-hosting.php (modified) (3 diffs)
-
includes/admin/class-icd-hosting-admin-settings.php (modified) (4 diffs)
-
includes/class-icd-hosting-ajax.php (modified) (2 diffs)
-
includes/class-icd-hosting-config.php (modified) (1 diff)
-
includes/class-icd-hosting-install.php (modified) (1 diff)
-
includes/icd-hosting-core-functions.php (modified) (1 diff)
-
includes/libraries/stripe/stripe-php/lib/Util/AutoPagingIterator.php (deleted)
-
includes/services/ApiClient.php (modified) (9 diffs)
-
includes/services/CurlClient.php (modified) (2 diffs)
-
includes/services/OrderHelper.php (modified) (7 diffs)
-
includes/services/Payment.php (modified) (1 diff)
-
includes/services/Translate.php (modified) (3 diffs)
-
includes/services/helpers.php (modified) (1 diff)
-
includes/services/processors/Payment2CheckOut.php (modified) (2 diffs)
-
includes/services/processors/PaymentAuthorizeNet.php (modified) (1 diff)
-
includes/services/processors/PaymentEpay.php (modified) (1 diff)
-
includes/services/processors/PaymentPayDollar.php (modified) (4 diffs)
-
includes/services/processors/PaymentPayPal.php (modified) (6 diffs)
-
includes/services/processors/PaymentPayU.php (modified) (1 diff)
-
includes/services/processors/PaymentSkrill.php (modified) (1 diff)
-
includes/shortcodes/class-icd-hosting-shortcode-plan-info.php (modified) (3 diffs)
-
includes/shortcodes/class-icd-hosting-shortcode-postback.php (modified) (3 diffs)
-
includes/shortcodes/class-icd-hosting-shortcode-request.php (modified) (1 diff)
-
lang/language/en.php (modified) (4 diffs)
-
readme.txt (modified) (3 diffs)
-
templates/payment.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
icdsoft-reseller-store/trunk/assets/js/widget.js
r3819731 r3830656 162 162 var domain_parts = DomainSearchForm.domainParts(); 163 163 var tld = domain_parts && domain_parts[2] ? domain_parts[2] : ''; 164 var domain_ group = (plandata['product_type'] != 'undefined' && plandata['product_type'] == 'server') ? 'extra:domain' : 'bonus:domain';164 var domain_qty = HostingOrderForm.domainPeriod(plandata, qty); 165 165 166 166 if (plandata['bonus:domain'] || plandata['extra:domain']) { … … 168 168 $('#hosting-order-form .hosting-new-domain[value=' + new_domain + ']').prop('checked', true); 169 169 $('#hosting-order-form .domain-search-controls').css('display', new_domain == '1' ? '' : 'none'); 170 if (new_domain == '1' && $('#domain-search-tlds input[value="' + tld + '"]').data('icann') == '1' && validPath(plandata, domain_group + '.' + tld + '.order.' + qty + '.price')) {170 if (new_domain == '1' && $('#domain-search-tlds input[value="' + tld + '"]').data('icann') == '1' && HostingOrderForm.domainItem(plandata, tld, domain_qty)) { 171 171 $('#order-domain-icann').show().find(':input').prop('required', true); 172 172 } else { … … 189 189 if (new_domain == 1 && domain_parts && domain_parts[1]) { 190 190 domain_total = Widget.tr('domain_search.not_offered'); 191 if (validPath(plandata, domain_group + '.' + tld.replace(/\./, '\\.') + '.order.' + qty + '.price')) { 192 domain_price = parseFloat(plandata[domain_group][tld].order[qty].price); 191 var domain_item = HostingOrderForm.domainItem(plandata, tld, domain_qty); 192 if (domain_item) { 193 domain_price = parseFloat(domain_item.order[domain_qty].price); 193 194 domain_total = HostingOrderForm.priceFormat(domain_price); 194 195 } 195 196 $('#hosting-price-domain').html(domain_total).show(); 196 197 $('#domain-search-tlds :input:checked').each(function () { 197 var domain_total = '-', tld = $(this).val() ;198 199 if ( validPath(plandata, domain_group + '.' + tld.replace(/\./, '\\.') + '.order.' + qty + '.price'))200 domain_total = HostingOrderForm.priceFormat(parseFloat( plandata[domain_group][tld].order[qty].price));198 var domain_total = '-', tld = $(this).val(), item = HostingOrderForm.domainItem(plandata, tld, domain_qty); 199 200 if (item) 201 domain_total = HostingOrderForm.priceFormat(parseFloat(item.order[domain_qty].price)); 201 202 202 203 $('#domain-search-result .domain-price-' + tld.replace(/\./, '\\.')).html(domain_total); … … 215 216 216 217 $('#hosting-order-form #payment-information').css('display', plan_price + domain_price > 0 ? '' : 'none'); 218 }, 219 // Years of a domain ordered with the plan: monthly plans count in months, domains in years (as the API does) 220 domainPeriod: function (plandata, period) { 221 period = parseInt(period, 10) || 1; 222 if (plandata && plandata.periodicity == 'MO') 223 return period <= 12 ? 1 : Math.ceil(period / 12); 224 225 return period; 226 }, 227 // The plan's bonus:domain item when it has a price for those years, otherwise extra:domain, as the API and RCP choose 228 domainItem: function (plandata, tld, years) { 229 var groups = ['bonus:domain', 'extra:domain']; 230 for (var i = 0; i < groups.length; i++) { 231 var item = plandata && plandata[groups[i]] ? plandata[groups[i]][tld] : null; 232 if (item && item.order && item.order[years] && typeof item.order[years].price !== 'undefined') 233 return item; 234 } 235 236 return null; 217 237 }, 218 238 rebuildPeriods: function (e) { … … 425 445 } 426 446 447 var not_offered_tld = ''; 427 448 if (DomainSearchForm.parts[2]) { 428 $('input[value="' + DomainSearchForm.parts[2] + '"]', '#domain-search-tlds').prop('checked', 1); 449 var typed_tld = $('input[value="' + DomainSearchForm.parts[2] + '"]', '#domain-search-tlds'); 450 if (typed_tld.length) 451 typed_tld.prop('checked', 1); 452 else // not offered: the ticked extensions are searched for the same name, with a notice 453 not_offered_tld = DomainSearchForm.parts[2]; 429 454 } 430 455 … … 489 514 }); 490 515 516 // after the requests: each one clears the messages when it starts 517 DomainSearchForm.tldNotOffered(not_offered_tld); 518 491 519 // Widget.spi('button'); 492 520 $.when.apply(null, DomainSearchForm.search_requests) … … 501 529 else if (selected[0]) 502 530 DomainSearchForm.showExtraAttributes(selected[0].attributes['data-tld'].value); 531 532 // selecting a domain above clears the messages too 533 DomainSearchForm.tldNotOffered(not_offered_tld); 503 534 }) 504 535 //.always(function () { … … 508 539 509 540 return false; 541 }, 542 tldNotOffered: function (tld) { 543 if (tld) 544 Widget.msg('warning', String(Widget.tr('domain_search.tld_not_offered')).replace('%tld%', tld)); 510 545 }, 511 546 abortSearch: function () { … … 569 604 return 570 605 } 606 // PayPal's script didn't load (blocked or offline): say so and leave the form as it is 607 if (typeof window.paypal === 'undefined' || !window.paypal || typeof window.paypal.Buttons !== 'function') { 608 Widget.msg('error', Widget.tr('error.paypal_unavailable')); 609 return; 610 } 571 611 $('#complete-order').hide(); 572 612 $(element_id).empty(); 573 paypal.Buttons({613 var rendering = window.paypal.Buttons({ 574 614 async createOrder(data, actions) { 575 615 Widget.spi(); … … 626 666 } 627 667 }).render(element_id); 668 if (rendering && typeof rendering.catch === 'function') { 669 rendering.catch(function () { 670 Widget.msg('error', Widget.tr('error.paypal_unavailable')); 671 }); 672 } 628 673 container.show(); 629 674 }, -
icdsoft-reseller-store/trunk/icd-hosting.php
r3819731 r3830656 4 4 * Plugin URI: https://www.icdsoft.com/reseller 5 5 * Description: This plugin allows you to add hosting order forms on your website, accept hosting service orders and payments from your customers, and then have these orders opened on servers hosted by ICDSoft. 6 * Version: 2. 8.26 * Version: 2.9.0 7 7 * Author: ICDSoft Hosting 8 8 * Author URI: https://icdsoft.com … … 37 37 * @var string 38 38 */ 39 public $version = '2. 8.2';39 public $version = '2.9.0'; 40 40 41 41 /** … … 124 124 define( 'ICD_HOSTING_PLUGIN_NAME', 'icd_hosting' ); 125 125 126 define( 'WIDGET_VERSION', '4.6 1' );126 define( 'WIDGET_VERSION', '4.68' ); 127 127 } 128 128 -
icdsoft-reseller-store/trunk/includes/admin/class-icd-hosting-admin-settings.php
r3697050 r3830656 77 77 // Clear cache when settings are updated 78 78 add_action( 'update_option_' . self::OPTION_NAME, array( $this, 'clear_storage_cache' ), 10, 2 ); 79 add_action( 'admin_post_icd_hosting_clear_cache', array( $this, 'clear_cache_request' ) ); 79 80 80 81 self::$options['registration_form_send'] = get_transient( ICD_Hosting_Admin_Settings::REGISTER_FORM_SEND ); … … 252 253 <div class="wrap"> 253 254 <h2><?php esc_html__( 'WP Hosting Settings', 'icd-hosting') ?></h2> 255 <?php if ( ! empty( $_GET['cache-cleared'] ) ) : ?> 256 <div class="notice notice-success is-dismissible"><p><?php esc_html_e( 'The cache has been cleared.', 'icd-hosting' ); ?></p></div> 257 <?php endif; ?> 254 258 <form method="post" action="options.php"> 255 259 <?php … … 259 263 ?> 260 264 </form> 265 <h2><?php esc_html_e( 'Cache', 'icd-hosting' ); ?></h2> 266 <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>"> 267 <input type="hidden" name="action" value="icd_hosting_clear_cache"> 268 <?php wp_nonce_field( 'icd_hosting_clear_cache' ); ?> 269 <p><?php esc_html_e( 'Plans, prices and other store data are kept for a while to make the pages faster. Clear the cache to show changes made in the Reseller Control Panel right away.', 'icd-hosting' ); ?></p> 270 <?php submit_button( __( 'Clear cache', 'icd-hosting' ), 'secondary', 'icd-hosting-clear-cache', false ); ?> 271 </form> 261 272 </div> 262 273 <?php … … 582 593 583 594 /** 595 * The settings page's "Clear cache" button 596 */ 597 public function clear_cache_request() { 598 if ( ! current_user_can( 'manage_options' ) ) { 599 wp_die( esc_html__( 'Sorry, you are not allowed to do that.', 'icd-hosting' ), '', array( 'response' => 403 ) ); 600 } 601 check_admin_referer( 'icd_hosting_clear_cache' ); 602 603 icd_hosting_clear_storage_cache(); 604 605 wp_safe_redirect( admin_url( 'admin.php?page=icd-hosting-settings&cache-cleared=1' ) ); 606 exit; 607 } 608 609 /** 584 610 * Clear storage cache when settings are updated 585 611 * -
icdsoft-reseller-store/trunk/includes/class-icd-hosting-ajax.php
r3781665 r3830656 163 163 ), true ); 164 164 } 165 } else if ( $total > 0 ) { 166 // no payment method to choose from: the payment page says so, instead of a thank-you as if paid 167 $create_order_result['redirect_to'] = icd_hosting_url( 'payment', array( 'order_id' => $order_id ), true ); 165 168 } else { 166 169 $create_order_result['redirect_to'] = icd_hosting_url( 'thankyou', array( 'order_id' => $order_id ), true ); … … 317 320 ), true ); 318 321 } 322 } else if ( $total > 0 ) { 323 // no payment method to choose from: the payment page says so, instead of a thank-you as if paid 324 $create_order_result['redirect_to'] = icd_hosting_url( 'payment', array( 'order_id' => $order_id ), true ); 319 325 } else { 320 326 $create_order_result['redirect_to'] = icd_hosting_url( 'thankyou', array( 'order_id' => $order_id ), true ); -
icdsoft-reseller-store/trunk/includes/class-icd-hosting-config.php
r3697050 r3830656 39 39 'key' => ! empty( self::$options['api_key'] ) ? self::$options['api_key'] : self::DEMO_STORE_KEY, 40 40 'sec' => ! empty( self::$options['api_sec'] ) ? self::$options['api_sec'] : self::DEMO_STORE_SEC, 41 'demo' => empty( self::$options['api_key'] ), 41 42 'cache' => true 42 43 ), -
icdsoft-reseller-store/trunk/includes/class-icd-hosting-install.php
r3754341 r3830656 18 18 if ( ! defined( 'IFRAME_REQUEST' ) && get_option( 'icd_hosting_version' ) !== ICD_Hosting()->version ) { 19 19 self::install(); 20 } 21 22 self::purge_api_cache_once(); 23 } 24 25 /** 26 * Empty the API cache the first time this release runs: cache files are named differently now, so 27 * the earlier ones would never be read or expire. 28 */ 29 public static function purge_api_cache_once() { 30 if ( ! get_option( 'icd_hosting_api_cache_purged' ) ) { 31 self::purge_api_cache(); 32 update_option( 'icd_hosting_api_cache_purged', time() ); 33 } 34 } 35 36 /** 37 * Empty storage/cache, keeping the files that close it to web requests 38 */ 39 public static function purge_api_cache() { 40 $dir = ICD_HOSTING_PLUGIN_PATH . 'storage/cache'; 41 if ( ! is_dir( $dir ) ) { 42 return; 43 } 44 45 foreach ( scandir( $dir ) as $file ) { 46 if ( strpos( $file, '.' ) !== 0 && $file !== 'index.php' && is_file( $dir . '/' . $file ) ) { 47 @unlink( $dir . '/' . $file ); 48 } 20 49 } 21 50 } -
icdsoft-reseller-store/trunk/includes/icd-hosting-core-functions.php
r3697050 r3830656 439 439 $cleared_count = 0; 440 440 foreach ( $cache_files as $cache_file ) { 441 if ( is_file( $cache_file ) ) { 441 // index.php keeps the folder from being listed, see icd_hosting_deny_web_access() 442 if ( is_file( $cache_file ) && basename( $cache_file ) !== 'index.php' ) { 442 443 if ( @unlink( $cache_file ) ) { 443 444 $cleared_count++; -
icdsoft-reseller-store/trunk/includes/services/ApiClient.php
r3721474 r3830656 11 11 12 12 /** 13 * The only commands written to the disk cache: their answers hold public store and catalog data. 14 * Every other answer stays in memory for the request, whatever ttl the API gives. 15 */ 16 const CACHEABLE_COMMANDS = array( 'store', 'catalog', 'order-data', 'tlds', 'countries', 'signupCountries' ); 17 18 /** 19 * Commands that place orders or record payments. While the plugin runs on the public demo key they 20 * would reach the demo store, so they are answered with an error instead. 21 */ 22 const DEMO_BLOCKED_COMMANDS = array( 'order-create', 'order-update', 'payment-request-create', 'payment-add', 'payment-process-webhook' ); 23 24 /** 13 25 * API Authentication Key 14 26 * … … 30 42 */ 31 43 protected $extra_params = array(); 44 45 /** 46 * Whether the store key is the public demo key, used before the plugin is set up 47 * 48 * @var bool 49 */ 50 protected $demo = false; 32 51 33 52 /** … … 44 63 45 64 $this->apiKey = $settings['key']; 65 $this->demo = ! empty( $settings['demo'] ); 46 66 47 67 if ( ! empty( $settings['sec'] ) ) { … … 58 78 if (!is_dir($cache_path) or !is_writable($cache_path)) { 59 79 $cache_path = ''; 80 } else { 81 icd_hosting_deny_web_access( ICD_HOSTING_PLUGIN_PATH . 'storage' ); 60 82 } 61 83 $this->cacheDir = $cache_path; … … 86 108 */ 87 109 public function isCachable( $cmd, $params = array() ) { 110 if ( ! in_array( $cmd, self::CACHEABLE_COMMANDS, true ) ) { 111 return false; 112 } 113 88 114 if ( $this->hasValidResponse( $cmd, $params ) and $this->responses[ $this->cmdHash( $cmd, $params ) ]['ttl'] > 0 and $this->cacheDir ) { 89 115 return true; … … 106 132 107 133 return $cmd . '_' . md5( http_build_query( $params ) ); 134 } 135 136 /** 137 * Cache file path: one file per store key and command parameters, the same for every visitor. 138 * The fields that change with each request or visitor are left out of the name. 139 * 140 * @param string $cmd 141 * @param array $params 142 * 143 * @return string 144 */ 145 protected function getCacheFilePath( $cmd, $params ) { 146 $params = array_diff_key( $params, array_flip( array( 'auth_token', 'wp_widget_version', 'widget_version', 'user_ip', 'nonce', 'ts', 'signature' ) ) ); 147 148 return $this->cacheDir . '/' . ( empty( $cmd ) ? 'UNKNOWN' : $cmd ) . '_' . md5( $this->apiKey . '?' . http_build_query( $params ) ); 108 149 } 109 150 … … 137 178 */ 138 179 public function commands( $commands, $method = 'POST' ) { 139 if ( in_array( $method, $this->supportedHttpMethods ) ) { 140 $this->httpMethod = $method; 141 } 142 143 $result = parent::executeMulti( $commands ); 180 // always POST, for the reason get() gives 181 $this->httpMethod = 'POST'; 182 foreach ( $commands as $k => $details ) { 183 unset( $commands[ $k ]['method'] ); 184 } 185 186 $blocked = array(); 187 foreach ( $commands as $k => $details ) { 188 if ( $this->blockedOnDemo( $details['command'] ) ) { 189 $blocked[ $k ] = $this->notConfigured(); 190 unset( $commands[ $k ] ); 191 } 192 } 193 194 $result = $blocked + ( $commands ? parent::executeMulti( $commands ) : array() ); 144 195 foreach ( $result as $k => $v ) { 145 196 $result[ $k ] = $v = $this->normalizeResponse( $v ); … … 205 256 */ 206 257 protected function execute( $cmd = '', $params = array() ) { 258 if ( $this->blockedOnDemo( $cmd ) ) { 259 return $this->notConfigured(); 260 } 261 207 262 $result = $this->normalizeResponse( parent::execute( $cmd, $params ) ); 208 263 if ( ! empty( $result['messages'] ) ) { … … 211 266 212 267 return $result; 268 } 269 270 /** 271 * Whether the command must not be sent because the plugin runs on the demo key 272 * 273 * @param string $cmd 274 * 275 * @return bool 276 */ 277 protected function blockedOnDemo( $cmd ) { 278 return $this->demo && in_array( $cmd, self::DEMO_BLOCKED_COMMANDS, true ); 279 } 280 281 /** 282 * The answer to a command blocked on the demo key 283 * 284 * @return array 285 */ 286 protected function notConfigured() { 287 return array( 288 'status' => false, 289 'messages' => $this->mapMessages( array( array( 'type' => 'error', 'code' => 'store_not_configured' ) ) ), 290 ); 213 291 } 214 292 -
icdsoft-reseller-store/trunk/includes/services/CurlClient.php
r3697050 r3830656 228 228 229 229 if ( $this->logFile ) { 230 $log = 'curl -X GET ' . escapeshellarg( $url ) . ' -k -g'; 230 $log_params = icd_hosting_mask_secrets( $params ); 231 $log = 'curl -X GET ' . escapeshellarg( $this->httpMethod === 'POST' ? $url : $url . ( strpos( $url, '?' ) !== false ? '&' : '?' ) . http_build_query( $log_params ) ) . ' -k -g'; 231 232 if ( $this->httpMethod == 'POST' ) { 232 $json = defined( 'JSON_PRETTY_PRINT' ) ? json_encode( $ params, JSON_PRETTY_PRINT ) : json_encode( $params );233 $json = defined( 'JSON_PRETTY_PRINT' ) ? json_encode( $log_params, JSON_PRETTY_PRINT ) : json_encode( $log_params ); 233 234 $log = 'curl -X POST ' . escapeshellarg( $url ) . " -H 'Content-Type: application/json' -k -g -d \\\n" . escapeshellarg( $json ); 234 235 } … … 396 397 */ 397 398 protected function saveToCache( $cmd, $params, $response, $TTL = 3600 ) { 399 if ( isset( $response['ttl'] ) && is_numeric( $response['ttl'] ) ) { 400 $TTL = (int) $response['ttl']; 401 } 402 403 if ( (int) $TTL <= 0 ) { 404 return; 405 } 406 398 407 $cache = $this->getCacheFilePath( $cmd, $params ); 399 408 file_put_contents( $cache, json_encode( $response ) ); 400 if ( (int) $TTL > 0 ) { 401 touch( $cache, time() + $TTL ); 409 touch( $cache, time() + $TTL ); 410 411 // one visit in five tidies up, so expired files don't pile up 412 if ( wp_rand( 1, 5 ) == 1 ) { 413 $this->clearExpiredCache(); 414 } 415 } 416 417 /** 418 * Delete expired cache files. Dot files and index.php keep the folder closed to web requests. 419 */ 420 protected function clearExpiredCache() { 421 if ( ! $this->cacheDir || ! is_dir( $this->cacheDir ) ) { 422 return; 423 } 424 425 foreach ( scandir( $this->cacheDir ) as $file ) { 426 $path = $this->cacheDir . '/' . $file; 427 if ( strpos( $file, '.' ) !== 0 && $file !== 'index.php' && is_file( $path ) && filemtime( $path ) < time() ) { 428 @unlink( $path ); 429 } 402 430 } 403 431 } -
icdsoft-reseller-store/trunk/includes/services/OrderHelper.php
r3754341 r3830656 389 389 390 390 $hosting_dto = OrderDTO::getHostingItem(); 391 $plan_item = $catalog_by_location[ $input['location'] ][ $input['plan'] ]; 391 392 392 393 if ( ! empty( $input['new_domain'] ) ) { 393 $domain_dto = OrderDTO::getDomainItem(); 394 $sld_tld = icd_hosting_sld_tld( $input['domain'] ); 395 396 if ( strpos( $input['plan'], 'multivps' ) !== false ) { 397 if ( ! $sld_tld or empty( $catalog_by_location[ $input['location'] ][ $input['plan'] ]['extra:domain'][ $sld_tld['tld'] ]['order'][ $input['period'] ] ) ) { 398 icd_hosting_error( 'error.tld_not_supported' ); 399 } 400 } else if ( ! $sld_tld or empty( $catalog_by_location[ $input['location'] ][ $input['plan'] ]['bonus:domain'][ $sld_tld['tld'] ]['order'][ $input['period'] ] ) ) { 394 $domain_dto = OrderDTO::getDomainItem(); 395 $sld_tld = icd_hosting_sld_tld( $input['domain'] ); 396 $domain_period = self::domainPeriod( $plan_item, $input['period'] ); 397 $domain_item = $sld_tld ? self::domainItem( $plan_item, $sld_tld['tld'], $domain_period ) : null; 398 399 if ( ! $domain_item ) { 401 400 icd_hosting_error( 'error.tld_not_supported' ); 402 401 } … … 442 441 443 442 // Fill hosting product props 444 $plan_item = $catalog_by_location[ $input['location'] ][ $input['plan'] ];445 443 $hosting_dto['hosting.hostname'] = icd_hosting_valid_domain( $input['domain'] ); 446 444 $hosting_dto['action'] = 'order'; … … 462 460 463 461 if ( isset( $domain_dto ) ) { 464 if ( strpos( $input['plan'], 'multivps' ) !== false ) {465 $domain_item = $catalog_by_location[ $input['location'] ][ $input['plan'] ]['extra:domain'][ $sld_tld['tld'] ];466 } else {467 $domain_item = $catalog_by_location[ $input['location'] ][ $input['plan'] ]['bonus:domain'][ $sld_tld['tld'] ];468 }469 462 $domain_dto['domain.tld'] = $sld_tld['tld']; 470 463 $domain_dto['domain.sld'] = $sld_tld['sld']; 471 464 $domain_dto['action'] = 'order'; 472 $domain_dto['period'] = $input['period']; 473 if ( $plan_item['periodicity'] == 'MO' ) { 474 $domain_dto['period'] = $domain_dto['period'] <= 12 ? 1 : intdiv( $domain_dto['period'], 12 ); 475 } 465 $domain_dto['period'] = $domain_period; 476 466 $domain_dto['catalog_id'] = $domain_item['catalog_id']; 477 467 $domain_dto['type'] = $domain_dto['product_type'] = $domain_item['product_type']; … … 480 470 ': ' . $sld_tld['sld'] . '.' . $sld_tld['tld']; 481 471 482 $domain_dto['price'] = $domain_item['order'][ $ input['period']]['price'];472 $domain_dto['price'] = $domain_item['order'][ $domain_period ]['price']; 483 473 484 474 if ( ! empty( $input['domain_extra_attributes'] ) ) { … … 500 490 501 491 /** 492 * Years of a domain ordered with a plan. Monthly plans count their period in months, domains count in years: the 493 * same rule as the API and the RCP billing form. 494 * 495 * @param array $plan_item 496 * @param int $period the plan's period 497 * 498 * @return int 499 */ 500 public static function domainPeriod( $plan_item, $period ) { 501 $period = (int) $period; 502 if ( isset( $plan_item['periodicity'] ) && $plan_item['periodicity'] == 'MO' ) { 503 return $period <= 12 ? 1 : (int) ceil( $period / 12 ); 504 } 505 506 return $period; 507 } 508 509 /** 510 * The catalog item of a domain ordered with a plan: the plan's bonus:domain when it has a price for that period, 511 * otherwise extra:domain, as the RCP order forms choose. Whether it's free is up to the catalog price. 512 * 513 * @param array $plan_item 514 * @param string $tld 515 * @param int $years 516 * 517 * @return array|null 518 */ 519 public static function domainItem( $plan_item, $tld, $years ) { 520 foreach ( array( 'bonus:domain', 'extra:domain' ) as $group ) { 521 if ( isset( $plan_item[ $group ][ $tld ]['order'][ $years ]['price'] ) ) { 522 return $plan_item[ $group ][ $tld ]; 523 } 524 } 525 526 return null; 527 } 528 529 /** 502 530 * Get order details 503 531 * … … 538 566 539 567 /** 568 * Whether a value is an order request's OR- identity, the one request emails carry 569 * 570 * @param mixed $request_id 571 * 572 * @return bool 573 */ 574 public static function validRequestId( $request_id ) { 575 return is_string( $request_id ) && preg_match( '/^OR-[A-Z0-9]+$/i', $request_id ) === 1; 576 } 577 578 /** 540 579 * Get order request details 541 580 * … … 546 585 */ 547 586 public static function getRequestDetails( $request_id ) { 548 if ( ! preg_match( '/^(OR-[A-Z0-9]+|[0-9]{1,16})$/i',$request_id ) ) {587 if ( ! self::validRequestId( $request_id ) ) { 549 588 icd_hosting_error( 'invalid.request_id:' . $request_id ); 550 589 } -
icdsoft-reseller-store/trunk/includes/services/Payment.php
r2595510 r3830656 55 55 $processor = reset( $this->processors ); 56 56 57 return $processor ['processor_id'];57 return $processor ? $processor['processor_id'] : null; 58 58 } 59 59 -
icdsoft-reseller-store/trunk/includes/services/Translate.php
r2502442 r3830656 53 53 54 54 /** 55 * Language files already read, by path 56 * 57 * @var array 58 */ 59 private static $files = array(); 60 61 /** 55 62 * Default language 56 63 */ … … 275 282 } 276 283 277 self::$custom_labels[ $language ] = array_merge( self::$custom_labels[ $language ], require_once( self::$custom_lang_path . "/{$language}.php" ) );284 self::$custom_labels[ $language ] = array_merge( self::$custom_labels[ $language ], self::loadFile( self::$custom_lang_path . "/{$language}.php" ) ); 278 285 279 286 return; 280 287 } 288 } 289 290 /** 291 * A language file's texts. Not require_once: a second call in the same request, as when a shortcode is rendered 292 * twice, would get true instead of the texts. 293 * 294 * @param string $file 295 * 296 * @return array 297 */ 298 private static function loadFile( $file ) { 299 if ( ! isset( self::$files[ $file ] ) ) { 300 self::$files[ $file ] = require $file; 301 } 302 303 return self::$files[ $file ]; 281 304 } 282 305 … … 294 317 295 318 if ( is_file( self::$lang_path . "/{$language}.php" ) ) { 296 self::$labels[ $language ] = array_merge( self::$labels[ $language ], require_once( self::$lang_path . "/{$language}.php" ) );319 self::$labels[ $language ] = array_merge( self::$labels[ $language ], self::loadFile( self::$lang_path . "/{$language}.php" ) ); 297 320 298 321 return; 299 322 } 300 323 if ( is_file( self::$lang_path . '/' . self::DEFAULT_LANG . '.php' ) ) { 301 self::$labels[ $language ] = array_merge( self::$labels[ $language ], require_once( self::$lang_path . '/' . self::DEFAULT_LANG . '.php' ) );324 self::$labels[ $language ] = array_merge( self::$labels[ $language ], self::loadFile( self::$lang_path . '/' . self::DEFAULT_LANG . '.php' ) ); 302 325 303 326 return; -
icdsoft-reseller-store/trunk/includes/services/helpers.php
r3697050 r3830656 442 442 443 443 /** 444 * Replace credentials with "_masked_" before data is logged or mailed. The same key list as the 445 * widget's mask_secrets(). auth_token keeps its first 16 characters, the hint the API stores for the 446 * key, so a log line still tells which key was used without holding a usable one. 447 * 448 * @param mixed $data 449 * 450 * @return mixed 451 */ 452 function icd_hosting_mask_secrets( $data ) { 453 if ( ! is_array( $data ) ) { 454 return $data; 455 } 456 457 $keys = array( 458 'auth_token', 'password', 'pass', 'secret', 'secret_key', 'client_secret', 'private_key', 459 'api_key', 'apikey', 'token', 'access_token', 'refresh_token', 'client_token', 'authorization', 460 // domain transfer authorization code 461 'epp', 462 // WorldPay's callback password, sent back in its payment response 463 'callbackpw', 464 ); 465 466 foreach ( $data as $key => $value ) { 467 $name = strtolower( (string) $key ); 468 469 if ( in_array( $name, $keys, true ) ) { 470 $data[ $key ] = $name == 'auth_token' && is_string( $value ) && strlen( $value ) >= 32 ? substr( $value, 0, 16 ) : '_masked_'; 471 } elseif ( is_array( $value ) ) { 472 $data[ $key ] = icd_hosting_mask_secrets( $value ); 473 } 474 } 475 476 return $data; 477 } 478 479 /** 480 * Close a folder to web requests: an Apache deny rule, and an empty index.php in it and its 481 * subfolders against directory listings. nginx ignores .htaccess, so nothing secret may be kept there. 482 * 483 * @param string $dir 484 */ 485 function icd_hosting_deny_web_access( $dir ) { 486 if ( ! is_dir( $dir ) ) { 487 return; 488 } 489 490 if ( ! file_exists( $dir . '/.htaccess' ) ) { 491 // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_file_put_contents 492 file_put_contents( $dir . '/.htaccess', "<IfModule mod_authz_core.c>\n\tRequire all denied\n</IfModule>\n<IfModule !mod_authz_core.c>\n\tOrder deny,allow\n\tDeny from all\n</IfModule>\n" ); 493 } 494 495 icd_hosting_protect_directory_listing( $dir ); 496 } 497 498 /** 444 499 * @param $array 445 500 * @param $key -
icdsoft-reseller-store/trunk/includes/services/processors/Payment2CheckOut.php
r2986374 r3830656 243 243 $hash = strtoupper( md5( $this->secret . $this->merchantId . $input['order_number'] . $input['total'] ) ); 244 244 245 if ( $hash == $input['key']) {245 if ( is_string( $input['key'] ) && hash_equals( $hash, $input['key'] ) ) { 246 246 return array( 247 247 'payment_processor_id' => $this->config['processor_id'], … … 262 262 $hash = strtoupper( md5( $input['sale_id'] . $this->merchantId . $input['invoice_id'] . $this->secret ) ); 263 263 264 if ( $hash == $input['md5_hash']) {264 if ( is_string( $input['md5_hash'] ) && hash_equals( $hash, $input['md5_hash'] ) ) { 265 265 return array( 266 266 'payment_processor_id' => $this->config['processor_id'], -
icdsoft-reseller-store/trunk/includes/services/processors/PaymentAuthorizeNet.php
r3525448 r3830656 128 128 $sig = hash_hmac('sha512', $textToHash, hex2bin($this->secret)); 129 129 130 if ( $input['x_SHA2_Hash'] == strtoupper($sig)) {130 if (isset($input['x_SHA2_Hash']) and is_string($input['x_SHA2_Hash']) and hash_equals(strtoupper($sig), $input['x_SHA2_Hash'])) { 131 131 return array( 132 132 'payment_processor_id' => $this->config['processor_id'], -
icdsoft-reseller-store/trunk/includes/services/processors/PaymentEpay.php
r2502442 r3830656 157 157 $CHECKSUM = $input['checksum']; 158 158 $CHECKSUM_CALC = $this->hmac( 'sha1', $ENCODED, $this->secret ); 159 if ( $CHECKSUM_CALC == $CHECKSUM) {159 if ( is_string( $CHECKSUM ) && hash_equals( $CHECKSUM_CALC, $CHECKSUM ) ) { 160 160 $data = base64_decode( $ENCODED ); 161 161 $lines_arr = explode( "\n", $data ); -
icdsoft-reseller-store/trunk/includes/services/processors/PaymentPayDollar.php
r2110032 r3830656 56 56 } 57 57 58 returnarray(58 $data = array( 59 59 'url' => $this->url, 60 60 'type' => 'online', … … 77 77 ) 78 78 ); 79 80 // once AsiaPay turns Secure Hash on for the merchant, it refuses a form without one 81 if ( $this->secureHashSecret() !== '' ) { 82 $params = &$data['params']; 83 $params['amount'] = number_format( $params['amount'], 2, '.', '' ); 84 $params['secureHash'] = sha1( implode( '|', array( 85 $params['merchantId'], $params['orderRef'], $params['currCode'], $params['amount'], $params['payType'], $this->secureHashSecret() 86 ) ) ); 87 } 88 89 return $data; 90 } 91 92 /** 93 * The store's Secure Hash Secret, or '' when it has none 94 * 95 * @return string 96 */ 97 protected function secureHashSecret() { 98 return isset( $this->config['options']['secure_hash_secret'] ) && is_string( $this->config['options']['secure_hash_secret'] ) ? trim( $this->config['options']['secure_hash_secret'] ) : ''; 99 } 100 101 /** 102 * Whether a datafeed carries a Secure Hash made with the store's secret. While a secret is being 103 * replaced, PayDollar sends one hash per secret, comma separated. 104 * 105 * @param array $input 106 * 107 * @return bool 108 */ 109 protected function validSecureHash( $input ) { 110 if ( empty( $input['secureHash'] ) || ! is_string( $input['secureHash'] ) ) { 111 return false; 112 } 113 114 $signed = array(); 115 foreach ( array( 'src', 'prc', 'successcode', 'Ref', 'PayRef', 'Cur', 'Amt', 'payerAuth' ) as $field ) { 116 $signed[] = isset( $input[ $field ] ) && is_scalar( $input[ $field ] ) ? $input[ $field ] : ''; 117 } 118 $expected = sha1( implode( '|', $signed ) . '|' . $this->secureHashSecret() ); 119 120 foreach ( explode( ',', $input['secureHash'] ) as $hash ) { 121 if ( hash_equals( $expected, strtolower( trim( $hash ) ) ) ) { 122 return true; 123 } 124 } 125 126 return false; 79 127 } 80 128 … … 88 136 public function validPayment( $input ) { 89 137 if ( isset( $input['successcode'] ) and isset( $input['PayRef'] ) and isset( $input['Ref'] ) ) { 138 $verified = $this->secureHashSecret() !== ''; 139 if ( $verified && ! $this->validSecureHash( $input ) ) { 140 return; 141 } 142 90 143 $this->postback_response = 'OK'; 91 144 92 returnarray(145 $payment = array( 93 146 'payment_processor_id' => $this->config['processor_id'], 94 147 'order_id' => null, … … 102 155 'ipn' => $input, 103 156 ); 157 158 // without a Secure Hash Secret the reseller confirms the payment in the PayDollar account, 159 // see ICD_Hosting_Shortcode_Postback::report_unverified_payment() 160 if ( ! $verified && $payment['payment_type'] == 'incoming' ) { 161 $payment['hold'] = 'unverified'; 162 } 163 164 return $payment; 104 165 } 105 166 } -
icdsoft-reseller-store/trunk/includes/services/processors/PaymentPayPal.php
r2986374 r3830656 4 4 5 5 use ICD\Hosting\ICD_Hosting; 6 use ICD\Hosting\Services\OrderHelper; 6 7 7 8 /** … … 211 212 } 212 213 214 // only payments to this store's PayPal account 215 $receivers = array(); 216 foreach (array('business', 'receiver_email', 'receiver_id') as $field) { 217 if (!empty($input[$field]) and is_string($input[$field])) 218 $receivers[] = strtolower(trim($input[$field])); 219 } 220 221 if (!in_array(strtolower(trim($this->merchantId)), $receivers, true)) 222 return; 223 213 224 if ($this->validPayment($input)) { 214 225 if (preg_match('/^\d{1,14}$/', $input['invoice'])) { … … 218 229 $payment_request_id = ''; 219 230 $order_id = $input['invoice']; 231 } 232 233 // a payment request is paid in its own currency and in full; the tolerance covers 234 // paymentData()'s item rounding 235 if ($payment_request_id and $this->paymentType($input) == 'incoming') { 236 $request = $this->paymentRequestDetails($payment_request_id); 237 if ( 238 !isset($input['mc_currency']) or strcasecmp($input['mc_currency'], $request['currency']) != 0 or 239 $input['mc_gross'] < $request['amount'] - max(0.1, $request['amount'] * 0.01) 240 ) { 241 return; 242 } 220 243 } 221 244 … … 424 447 425 448 /** 449 * The payment request an IPN pays 450 * 451 * @param string $payment_request_id 452 * 453 * @return array 454 * @throws \ICD\Hosting\Services\AppException 455 */ 456 protected function paymentRequestDetails($payment_request_id) { 457 return OrderHelper::getPaymentRequestDetails($payment_request_id); 458 } 459 460 /** 426 461 * Get payment type based on IPN payment status 427 462 * … … 432 467 public function paymentType($ipn) { 433 468 if (in_array($ipn['payment_status'], ['Denied', 'Expired', 'Failed', 'Refunded', 'Reversed', 'Voided'])) 434 return in_array( $ipn['reason_code'], ['chargeback', 'guarantee', 'buyer-complaint']) ? 'chargeback' : 'refund';469 return in_array(icd_hosting_array_get($ipn, 'reason_code'), ['chargeback', 'guarantee', 'buyer-complaint']) ? 'chargeback' : 'refund'; 435 470 436 471 if ($ipn['payment_status'] == 'Completed' and isset($ipn['txn_type']) and $ipn['txn_type'] == 'adjustment' and $ipn['mc_gross'] < 0) … … 469 504 $shell = "curl -X $method " . escapeshellarg("{$this->api['url']}$cmd") . " \ 470 505 -H 'Content-Type: application/json' \ 471 -H 'Authorization: Basic {$this->api['auth']}' \506 -H 'Authorization: Basic _masked_' \ 472 507 -d " . escapeshellarg(json_encode($data)); 473 508 } else { 474 509 $shell = "curl -X $method " . escapeshellarg("{$this->api['url']}$cmd") . " \ 475 510 -H 'Content-Type: application/json' \ 476 -H 'Authorization: Basic {$this->api['auth']}'";511 -H 'Authorization: Basic _masked_'"; 477 512 } 478 513 -
icdsoft-reseller-store/trunk/includes/services/processors/PaymentPayU.php
r2110032 r3830656 115 115 $transaction_state = $input['state_pol']; 116 116 117 if ( strtoupper( $input['sign'] ) == strtoupper( $signature) && ! empty( $input['reference_pol'] ) && ! empty( $input['value'] ) ) {117 if ( is_string( $input['sign'] ) && hash_equals( strtoupper( $signature ), strtoupper( $input['sign'] ) ) && ! empty( $input['reference_pol'] ) && ! empty( $input['value'] ) ) { 118 118 119 119 return array_merge( -
icdsoft-reseller-store/trunk/includes/services/processors/PaymentSkrill.php
r2110032 r3830656 117 117 $md5 = strtoupper( md5( $input['merchant_id'] . $input['transaction_id'] . $secretMD5 . $input['mb_amount'] . $input['mb_currency'] . $input['status'] ) ); 118 118 119 if ( $input['md5sig'] == $md5) {119 if ( isset( $input['md5sig'] ) && is_string( $input['md5sig'] ) && hash_equals( $md5, $input['md5sig'] ) ) { 120 120 echo "OK"; 121 121 -
icdsoft-reseller-store/trunk/includes/shortcodes/class-icd-hosting-shortcode-plan-info.php
r2676950 r3830656 23 23 24 24 if ( empty( $plan ) ) { 25 self::not_offered( isset( $atts['plan'] ) ? $atts['plan'] : '', $location, $order_data, $atts ); 26 25 27 return false; 26 28 } … … 41 43 42 44 if ( empty( $viewdata['price'] ) ) { 45 self::not_offered( $plan, $location, $order_data, $atts ); 46 43 47 return false; 44 48 } … … 51 55 } 52 56 } 57 58 /** 59 * A plan the store doesn't sell at that location shows nothing to visitors. The page's editors get a note, so a 60 * wrong or retired plan name doesn't go unnoticed. 61 * 62 * @param string $plan plan from the shortcode, '' when it names none 63 * @param string $location data center key 64 * @param array $order_data order form data, for the data center's name 65 * @param array $atts shortcode attributes, for the location as typed 66 */ 67 protected static function not_offered( $plan, $location, $order_data, $atts ) { 68 if ( ! current_user_can( 'edit_post', get_the_ID() ) ) { 69 return; 70 } 71 72 if ( isset( $order_data['datacenters'][ $location ]['name'] ) ) { 73 $location = $order_data['datacenters'][ $location ]['name']; 74 } elseif ( isset( $atts['location'] ) ) { 75 $location = $atts['location']; 76 } 77 78 if ( $plan === '' ) { 79 /* translators: %s: data center */ 80 $note = sprintf( __( '[plan_info]: no plans are offered at the location "%s". Only the editors of this page see this note.', 'icd-hosting' ), $location ); 81 } else { 82 /* translators: 1: plan name from the shortcode, 2: data center */ 83 $note = sprintf( __( '[plan_info]: the plan "%1$s" is not offered at the location "%2$s". Only the editors of this page see this note.', 'icd-hosting' ), $plan, $location ); 84 } 85 echo '<p class="icd-hosting-not-offered">' . esc_html( $note ) . '</p>'; 86 } 53 87 } -
icdsoft-reseller-store/trunk/includes/shortcodes/class-icd-hosting-shortcode-postback.php
r3187671 r3830656 14 14 try { 15 15 $input = $_POST; 16 $debug = wp_json_encode( $input, JSON_PRETTY_PRINT );16 $debug = wp_json_encode( icd_hosting_mask_secrets( $input ), JSON_PRETTY_PRINT ); 17 17 $settings = ICD_Hosting::instance()->getApp()->settings; 18 18 … … 30 30 $redirect_params = []; 31 31 32 if ( $payment['payment_type'] != 'error' ) { 32 if ( ! empty( $payment['hold'] ) ) { 33 self::report_unverified_payment( $payment, $settings ); 34 } else if ( $payment['payment_type'] != 'error' ) { 33 35 $result = ICD_Hosting::instance()->order_service->addPayment( $payment ); 34 $debug .= "\n" . wp_json_encode( $payment, JSON_PRETTY_PRINT ) . "\n" . wp_json_encode( $result, JSON_PRETTY_PRINT );36 $debug .= "\n" . wp_json_encode( icd_hosting_mask_secrets( $payment ), JSON_PRETTY_PRINT ) . "\n" . wp_json_encode( $result, JSON_PRETTY_PRINT ); 35 37 if ( empty( $result['status'] ) ) { 36 38 icd_hosting_error( 'error.adding_payment' ); … … 77 79 } 78 80 } 81 82 /** 83 * A payment to confirm by hand (PayDollar without a Secure Hash Secret) is not recorded: the 84 * reseller gets its details to find in the processor's account. At most 20 mails go out a day. 85 * 86 * @param array $payment detectPayment()'s result 87 * @param array $settings 88 */ 89 public static function report_unverified_payment( $payment, $settings ) { 90 if ( ! empty( $settings['ipn_log'] ) ) { 91 icd_hosting_custom_log( $settings['ipn_log'], 'not recorded, to check by hand: ' . wp_json_encode( icd_hosting_mask_secrets( $payment ) ) ); 92 } 93 94 $day = 'icd_hosting_unverified_mails_' . gmdate( 'Ymd' ); 95 $sent = (int) get_transient( $day ); 96 if ( $sent >= 20 ) { 97 return; 98 } 99 set_transient( $day, $sent + 1, DAY_IN_SECONDS ); 100 101 $to = ! empty( $settings['notification_email'] ) ? $settings['notification_email'] : get_option( 'admin_email' ); 102 $ipn = isset( $payment['ipn'] ) && is_array( $payment['ipn'] ) ? $payment['ipn'] : array(); 103 104 wp_mail( 105 $to, 106 sprintf( '[WORDPRESS_PAYMENT] %s payment to check', $payment['payment_method'] ), 107 implode( "\n", array( 108 sprintf( '%s reported a payment that this site cannot verify, so it was not recorded.', $payment['payment_method'] ), 109 'Find it in your ' . $payment['payment_method'] . ' account. If it is there, record it for the order in the Reseller Control Panel.', 110 '', 111 'Payment request: ' . $payment['payment_request_id'], 112 'Payment reference: ' . $payment['transaction_id'], 113 'Amount: ' . $payment['total'] . ( isset( $ipn['Cur'] ) && is_scalar( $ipn['Cur'] ) ? ' (currency code ' . $ipn['Cur'] . ')' : '' ), 114 '', 115 'To have PayDollar payments recorded automatically, ask PayDollar to turn on Secure Hash for your account and enter the Secure Hash Secret in your store\'s PayDollar settings in the Reseller Control Panel.', 116 ) ) 117 ); 118 } 79 119 } -
icdsoft-reseller-store/trunk/includes/shortcodes/class-icd-hosting-shortcode-request.php
r3721474 r3830656 20 20 $options = get_option( ICD_Hosting_Config::OPTION_NAME ); 21 21 22 if ( ! preg_match( '/^(OR-[A-Z0-9]+|[0-9]{1,16})$/i',$id ) ) {22 if ( ! OrderHelper::validRequestId( $id ) ) { 23 23 icd_hosting_error( 'invalid.request_id' ); 24 24 } -
icdsoft-reseller-store/trunk/lang/language/en.php
r3781665 r3830656 7 7 'hostname_is_already_hosted' => 'The selected domain is already hosted with us', 8 8 'system_error' => 'An unexpected error has occurred', 9 'store_not_configured' => 'This store is not set up yet, so orders cannot be placed.', 9 10 'domain_not_available' => 'Domain name not available', 10 11 'invalid_signature' => 'Invalid API Security Key', … … 128 129 'invalid' => 'Invalid domain', 129 130 'not_offered' => 'Registration not offered', 131 'tld_not_offered' => 'Domains ending in .%tld% are not offered. Here are the results for the other extensions.', 130 132 'choose_search_tlds' => 'Please select search TLDs', 131 133 'check_all' => 'Check all' … … 229 231 'payment_details' => 'Enter payment details', 230 232 'payment_info_text' => 'There is an outstanding amount of <b>%outstanding%</b> required for the completion of your order.', 233 'no_payment_methods' => 'No payment methods are available at the moment. Please contact us to complete your order.', 231 234 'thankyou_info_text' => 'Our team will process it as soon as possible. You will be contacted if needed.', 232 235 … … 492 495 'generic' => 'Application error', 493 496 'payment_failed' => 'We were unable to process your payment. Please try again.', 497 'paypal_unavailable' => 'PayPal could not be loaded. Please reload the page or choose another payment method.', 498 'paypal_order_create_failed' => 'The PayPal payment could not be started. Please try again or choose another payment method.', 494 499 'product_not_found' => 'The selected product cannot be found.', 495 500 'failed_to_retrieve_order_data' => 'Failed to retrieve order data.', -
icdsoft-reseller-store/trunk/readme.txt
r3825488 r3830656 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 2. 8.27 Stable tag: 2.9.0 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 80 80 [plan_info plan="Product Name" location="Data Center"] 81 81 82 The plan_info shortcode can be used to display the main features of a given hosting product. **plan** can take one of the following values - economy, business, business-plus, economy-sureapp, business-sureapp, firstclass, firstclass-startup, firstclass-ultimate, multivps, multivps-pro. **location** can take one of the following values - eu, us, hk. 83 84 ***Example:*** The following shortcode will display a table with the characteristics of the Economy plan at the Europe data center 85 86 [plan_info plan="economy" location="eu"] 82 The plan_info shortcode can be used to display the main features of a given hosting product. **plan** can take one of the following values: 83 84 * Shared hosting - launch, core, advanced, professional 85 * VPS - firstclass-startup, firstclass, firstclass-x2, firstclass-ultimate, firstclass-ultimate-x2, firstclass-ultimate-x3 86 * SmartVPS - multivps-40, multivps-100, multivps-150, multivps-200 87 88 **location** can take one of the following values - eu, us, hk. 89 90 A plan is shown only at the locations where your online store sells it. Online stores created earlier may still sell older plans (for example economy, business or multivps), which can be used the same way. If the plan or location is not sold, visitors see nothing, and the editors of the page see a note about it. 91 92 ***Example:*** The following shortcode will display a table with the characteristics of the Core plan at the Europe data center 93 94 [plan_info plan="core" location="eu"] 87 95 88 96 **Plan compare block** … … 118 126 119 127 == Changelog == 128 = 2.9.0 = 129 * Security hardening of the API cache and the storage folder 130 * Payment methods added to the online store show on the Payment page right away 131 * New "Clear cache" button on the Settings page, to show plan and price changes right away 132 * A new domain ordered with a monthly plan is registered for 1 year for up to 12 months, and for whole years above that, as in the Reseller Control Panel 133 * The price of a new domain ordered with a plan comes from the plan's domain prices in the catalog, so the order form shows the amount charged (VPS and SmartVPS plans) 134 * An order with an amount due and no payment method to choose from opens the Payment page, which says that no payment methods are available 135 * Show a message when PayPal cannot be loaded on the Payment page 136 * Domain Check says when the typed extension is not offered, and shows the results for the other extensions 137 * plan_info: the page's editors see a note when the plan or location is not sold by the store; the readme lists the current plans 138 * PayDollar: payment notifications are confirmed with the Secure Hash when the online store has a Secure Hash secret; otherwise the payment details are emailed to the site to be recorded in the Reseller Control Panel 139 * Orders and payments are not sent while the plugin uses the demo store key 140 * Fix the "Terms of Use" page error in the block editor 141 * Fix the demo store's details staying after a new store key is saved 142 * Do not fail when no payment processors are configured 143 120 144 = 2.8.2 = 121 145 * "Use my already registered domain name" keeps domains with extensions outside the built-in list (e.g. .top) instead of searching the extension as a name -
icdsoft-reseller-store/trunk/templates/payment.php
r3339755 r3830656 65 65 </div> 66 66 </form> 67 <?php else: ?> 68 <div class="alert alert-warning" role="alert"><?php echo esc_html( icd_hosting_tr( 'no_payment_methods' ) ); ?></div> 67 69 <?php endif; ?> 68 70 <?php if (!empty($payment_assets['js'])): ?>
Note:
See TracChangeset
for help on using the changeset viewer.