Plugin Directory

Changeset 3462993


Ignore:
Timestamp:
02/17/2026 12:42:24 AM (6 weeks ago)
Author:
naa986
Message:

.v1.0.47 commit

Location:
checkout-for-paypal/trunk
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • checkout-for-paypal/trunk/checkout-for-paypal.php

    r3457517 r3462993  
    22/*
    33  Plugin Name: Checkout for PayPal
    4   Version: 1.0.46
     4  Version: 1.0.47
    55  Plugin URI: https://noorsplugin.com/checkout-for-paypal-wordpress-plugin/ 
    66  Author: naa986
     
    1919    class CHECKOUT_FOR_PAYPAL {
    2020
    21         var $plugin_version = '1.0.46';
     21        var $plugin_version = '1.0.47';
    2222        var $db_version = '1.0.3';
    2323        var $plugin_url;
     
    4646            include_once('cfp-email.php');
    4747            include_once('cfp-api.php');
    48             include_once('cfp-old.php');
    4948            if(is_admin()){
    5049                include_once('addons/checkout-for-paypal-addons-menu.php');
     
    6261            add_filter('manage_coforpaypal_order_posts_columns', 'checkout_for_paypal_order_columns');
    6362            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 */
    6963            add_shortcode('checkout_for_paypal', 'checkout_for_paypal_button_handler');
    7064        }
     
    128122                }
    129123            }
    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             }
    139124            if(empty($message)){
    140125                return;
     
    184169
    185170        function load_scripts(){
     171            if(!is_checkout_for_paypal_configured()){
     172                return;
     173            }
    186174            $options = checkout_for_paypal_get_option();
    187175            $client_id = '';
     
    395383                    update_option('checkout_for_paypal_buyer_country', sanitize_text_field($_POST['buyer_country']));
    396384                }
    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);
    399385                $paypal_options = array();
    400386                $paypal_options['test_mode'] = $test_mode;
     
    445431            if(!isset($buyer_country) || empty($buyer_country)){
    446432                $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 = '';
    451433            }
    452434            $locale_doc_url = "https://noorsplugin.com/paypal-checkout-locale/";
     
    552534                                            <td><input name="buyer_country" type="text" id="buyer_country" value="<?php echo esc_attr($buyer_country); ?>" class="regular-text">
    553535                                                <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>
    564537                                    </tbody>
    565538
     
    852825
    853826function 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    }
    854830    $atts = array_map('sanitize_text_field', $atts);
    855831    $id = uniqid();
    856832    $atts['id'] = $id;
    857833    $options = checkout_for_paypal_get_option();
    858     //check older integration
    859     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     //
    870834    $button_code = '';
    871835    $description = '';
     
    12471211    return $log_reset;
    12481212}
     1213
     1214function 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  
    55Requires at least: 5.5
    66Tested up to: 6.9
    7 Stable tag: 1.0.46
     7Stable tag: 1.0.47
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    9797== Changelog ==
    9898
     99= 1.0.47 =
     100* Removed older integration.
     101
    99102= 1.0.46 =
    100103* Changes to URL parameters.
Note: See TracChangeset for help on using the changeset viewer.