Changeset 3462993
- Timestamp:
- 02/17/2026 12:42:24 AM (6 weeks ago)
- Location:
- checkout-for-paypal/trunk
- Files:
-
- 1 deleted
- 2 edited
-
cfp-old.php (deleted)
-
checkout-for-paypal.php (modified) (11 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
checkout-for-paypal/trunk/checkout-for-paypal.php
r3457517 r3462993 2 2 /* 3 3 Plugin Name: Checkout for PayPal 4 Version: 1.0.4 64 Version: 1.0.47 5 5 Plugin URI: https://noorsplugin.com/checkout-for-paypal-wordpress-plugin/ 6 6 Author: naa986 … … 19 19 class CHECKOUT_FOR_PAYPAL { 20 20 21 var $plugin_version = '1.0.4 6';21 var $plugin_version = '1.0.47'; 22 22 var $db_version = '1.0.3'; 23 23 var $plugin_url; … … 46 46 include_once('cfp-email.php'); 47 47 include_once('cfp-api.php'); 48 include_once('cfp-old.php');49 48 if(is_admin()){ 50 49 include_once('addons/checkout-for-paypal-addons-menu.php'); … … 62 61 add_filter('manage_coforpaypal_order_posts_columns', 'checkout_for_paypal_order_columns'); 63 62 add_action('manage_coforpaypal_order_posts_custom_column', 'checkout_for_paypal_custom_column', 10, 2); 64 /* start of older integration */65 add_action('wp_ajax_coforpaypal_ajax_process_order', 'checkout_for_paypal_ajax_process_order');66 add_action('wp_ajax_nopriv_coforpaypal_ajax_process_order', 'checkout_for_paypal_ajax_process_order');67 add_action('checkout_for_paypal_process_order', 'checkout_for_paypal_process_order_handler');68 /* end of older integration */69 63 add_shortcode('checkout_for_paypal', 'checkout_for_paypal_button_handler'); 70 64 } … … 128 122 } 129 123 } 130 $options = checkout_for_paypal_get_option();131 $disable_orders_api_v2_notice = get_option('checkout_for_paypal_disable_orders_api_v2_notice');132 if(!isset($disable_orders_api_v2_notice) || empty($disable_orders_api_v2_notice)){133 if(isset($options['app_client_id']) && !empty($options['app_client_id'])){134 if(!isset($options['app_secret_key']) || empty($options['app_secret_key'])){135 $message .= '<div class="error"><p>' . __('Checkout for PayPal is not using the latest API. To automatically use this API, the plugin requires your Client ID and Secret Key in the settings. Once you have updated the settings, click a PayPal button on your site to ensure everything is working.', 'checkout-for-paypal').'</p></div>';136 }137 }138 }139 124 if(empty($message)){ 140 125 return; … … 184 169 185 170 function load_scripts(){ 171 if(!is_checkout_for_paypal_configured()){ 172 return; 173 } 186 174 $options = checkout_for_paypal_get_option(); 187 175 $client_id = ''; … … 395 383 update_option('checkout_for_paypal_buyer_country', sanitize_text_field($_POST['buyer_country'])); 396 384 } 397 $disable_orders_api_v2_notice = (isset($_POST['disable_orders_api_v2_notice']) && $_POST['disable_orders_api_v2_notice'] == '1') ? '1' : '';398 update_option('checkout_for_paypal_disable_orders_api_v2_notice', $disable_orders_api_v2_notice);399 385 $paypal_options = array(); 400 386 $paypal_options['test_mode'] = $test_mode; … … 445 431 if(!isset($buyer_country) || empty($buyer_country)){ 446 432 $buyer_country = ''; 447 }448 $disable_orders_api_v2_notice = get_option('checkout_for_paypal_disable_orders_api_v2_notice');449 if(!isset($disable_orders_api_v2_notice) || empty($disable_orders_api_v2_notice)){450 $disable_orders_api_v2_notice = '';451 433 } 452 434 $locale_doc_url = "https://noorsplugin.com/paypal-checkout-locale/"; … … 552 534 <td><input name="buyer_country" type="text" id="buyer_country" value="<?php echo esc_attr($buyer_country); ?>" class="regular-text"> 553 535 <p class="description"><?php _e('The country to determine which funding sources are eligible for a given buyer (optional). Example:', 'checkout-for-paypal');?> <strong>US</strong>. <?php _e('This feature is only available in the sandbox to test the checkout experience as a buyer from a particular country.', 'checkout-for-paypal');?></p></td> 554 </tr> 555 556 <tr valign="top"> 557 <th scope="row"><?php _e('Disable Orders API v2 Notice', 'checkout-for-paypal');?></th> 558 <td> <fieldset><legend class="screen-reader-text"><span>Disable Orders API v2 Notice</span></legend><label for="disable_orders_api_v2_notice"> 559 <input name="disable_orders_api_v2_notice" type="checkbox" id="disable_orders_api_v2_notice" <?php if ($disable_orders_api_v2_notice == '1') echo ' checked="checked"'; ?> value="1"> 560 <?php _e("Check this option if you want to disable the orders API v2 update notice. By default, the notice is shown as long as the setup is incomplete.", 'checkout-for-paypal');?></label> 561 </fieldset></td> 562 </tr> 563 536 </tr> 564 537 </tbody> 565 538 … … 852 825 853 826 function checkout_for_paypal_button_handler($atts) { 827 if(!is_checkout_for_paypal_configured()){ 828 return __('You need to configure checkout options in the settings', 'checkout-for-paypal'); 829 } 854 830 $atts = array_map('sanitize_text_field', $atts); 855 831 $id = uniqid(); 856 832 $atts['id'] = $id; 857 833 $options = checkout_for_paypal_get_option(); 858 //check older integration859 if(isset($options['app_client_id']) && !empty($options['app_client_id'])){860 if(!isset($options['app_secret_key']) || empty($options['app_secret_key'])){861 $button_code = '';862 $button_code = apply_filters('checkout_for_paypal_button', $button_code, $atts);863 if(!empty($button_code)){864 return $button_code;865 }866 return checkout_for_paypal_old_button_handler($atts);867 }868 }869 //870 834 $button_code = ''; 871 835 $description = ''; … … 1247 1211 return $log_reset; 1248 1212 } 1213 1214 function is_checkout_for_paypal_configured(){ 1215 $options = checkout_for_paypal_get_option(); 1216 $configured = true; 1217 if(isset($options['test_mode']) && !empty($options['test_mode'])){ 1218 if(!isset($options['app_sandbox_client_id']) || empty($options['app_sandbox_client_id'])){ 1219 $configured = false; 1220 } 1221 if(!isset($options['app_sandbox_secret_key']) || empty($options['app_sandbox_secret_key'])){ 1222 $configured = false; 1223 } 1224 } 1225 else{ 1226 if(!isset($options['app_client_id']) || empty($options['app_client_id'])){ 1227 $configured = false; 1228 } 1229 if(!isset($options['app_secret_key']) || empty($options['app_secret_key'])){ 1230 $configured = false; 1231 } 1232 } 1233 if(!isset($options['currency_code']) || empty($options['currency_code'])){ 1234 $configured = false; 1235 } 1236 return $configured; 1237 } -
checkout-for-paypal/trunk/readme.txt
r3457517 r3462993 5 5 Requires at least: 5.5 6 6 Tested up to: 6.9 7 Stable tag: 1.0.4 67 Stable tag: 1.0.47 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 97 97 == Changelog == 98 98 99 = 1.0.47 = 100 * Removed older integration. 101 99 102 = 1.0.46 = 100 103 * Changes to URL parameters.
Note: See TracChangeset
for help on using the changeset viewer.