Plugin Directory

Changeset 1437984


Ignore:
Timestamp:
06/16/2016 06:12:30 PM (10 years ago)
Author:
akeda
Message:

Preparing for 1.0.4 release

Location:
woocommerce-gateway-paypal-express-checkout/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-gateway-paypal-express-checkout/trunk/includes/abstracts/abstract-wc-gateway-ppec-client-credential.php

    r1409404 r1437984  
    123123    public function configure_curl( $handle, $r, $url ) {
    124124        curl_setopt( $handle, CURLOPT_CAINFO, wc_gateway_ppec()->includes_path . 'pem/bundle.pem' );
    125         curl_setopt( $handle, CURLOPT_SSL_CIPHER_LIST, 'TLSv1' );
    126125    }
    127126}
  • woocommerce-gateway-paypal-express-checkout/trunk/includes/abstracts/abstract-wc-gateway-ppec.php

    r1428748 r1437984  
    847847    }
    848848
     849    /**
     850     * Check if this gateway is enabled.
     851     *
     852     * @return bool
     853     */
     854    public function is_available() {
     855        $settings = wc_gateway_ppec()->settings->loadSettings();
     856        if ( ! $settings->enabled ) {
     857            return false;
     858        }
     859
     860        $api_credentials = $settings->getActiveApiCredentials();
     861        if ( ! is_callable( array( $api_credentials, 'get_payer_id' ) ) ) {
     862            return false;
     863        }
     864
     865        return true;
     866    }
     867
    849868}
  • woocommerce-gateway-paypal-express-checkout/trunk/includes/class-wc-gateway-ppec-admin-handler.php

    r1386055 r1437984  
    215215     * Get admin URL for this gateway setting.
    216216     *
     217     * @deprecated
     218     *
    217219     * @return string URL
    218220     */
    219221    public function gateway_admin_url( $gateway_class ) {
    220         return add_query_arg(
    221             array(
    222                 'page'    => 'wc-settings',
    223                 'tab'     => 'checkout',
    224                 'section' => strtolower( $gateway_class ),
    225             ),
    226             admin_url( 'admin.php' )
    227         );
     222        _deprecated_function( 'WC_Gateway_PPEC_Admin_Handler::gateway_admin_url', '1.0.4', 'wc_gateway_ppec()->get_admin_setting_link' );
     223
     224        return wc_gateway_ppec()->get_admin_setting_link();
    228225    }
    229226
  • woocommerce-gateway-paypal-express-checkout/trunk/includes/class-wc-gateway-ppec-cart-handler.php

    r1428748 r1437984  
    6262        }
    6363
     64        $api_credentials = $settings->getActiveApiCredentials();
     65        if ( ! is_callable( array( $api_credentials, 'get_payer_id' ) ) ) {
     66            return;
     67        }
     68
    6469        if ( version_compare( WC()->version, '2.3', '>' ) ) {
    6570            $class = 'woo_pp_cart_buttons_div';
     
    6873        }
    6974
    70         if ( $settings->enableInContextCheckout && $settings->getActiveApiCredentials()->get_payer_id() ) {
     75        if ( $settings->enableInContextCheckout ) {
    7176            $class .= ' paypal-button-hidden';
    7277        }
     
    103108
    104109        <?php
    105         if ( $settings->enableInContextCheckout && $settings->getActiveApiCredentials()->get_payer_id() ) {
    106             $payer_id = $settings->getActiveApiCredentials()->get_payer_id();
     110        if ( $settings->enableInContextCheckout ) {
     111            $payer_id = $api_credentials->get_payer_id();
    107112            $setup_args = array(
    108113                // 'button' => array( 'woo_pp_ec_button', 'woo_pp_ppc_button' ),
     
    131136        }
    132137
     138        $settings = wc_gateway_ppec()->settings->loadSettings();
     139        if ( ! $settings->enabled ) {
     140            return;
     141        }
     142
     143        $api_credentials = $settings->getActiveApiCredentials();
     144        if ( ! is_callable( array( $api_credentials, 'get_payer_id' ) ) ) {
     145            return;
     146        }
     147
    133148        wp_enqueue_style( 'wc-gateway-ppec-frontend-cart', wc_gateway_ppec()->plugin_url . 'assets/css/wc-gateway-ppec-frontend-cart.css' );
    134149
    135         $settings = wc_gateway_ppec()->settings->loadSettings();
    136         if ( $settings->enabled && $settings->enableInContextCheckout && $settings->getActiveApiCredentials()->get_payer_id() ) {
     150        if ( $settings->enableInContextCheckout ) {
    137151            wp_enqueue_script( 'paypal-checkout-js', 'https://www.paypalobjects.com/api/checkout.js', array(), null, true );
    138152        }
    139 
    140153    }
    141154
  • woocommerce-gateway-paypal-express-checkout/trunk/includes/class-wc-gateway-ppec-checkout-handler.php

    r1386055 r1437984  
    206206    public function after_checkout_form() {
    207207        $settings = wc_gateway_ppec()->settings->loadSettings();
    208 
    209         if ( $settings->enabled && $settings->enableInContextCheckout && $settings->getActiveApiCredentials()->get_payer_id() ) {
     208        if ( ! $settings->enabled ) {
     209            return;
     210        }
     211
     212        $api_credentials = $settings->getActiveApiCredentials();
     213        if ( ! is_callable( array( $api_credentials, 'get_payer_id' ) ) ) {
     214            return;
     215        }
     216
     217        if ( $settings->enableInContextCheckout ) {
    210218            $session = WC()->session->paypal;
    211219
     
    245253        }
    246254
     255        $api_credentials = $settings->getActiveApiCredentials();
     256        if ( ! is_callable( array( $api_credentials, 'get_payer_id' ) ) ) {
     257            return;
     258        }
     259
    247260        wp_enqueue_style( 'wc-gateway-ppec-frontend-checkout', wc_gateway_ppec()->plugin_url . 'assets/css/wc-gateway-ppec-frontend-checkout.css', array(), wc_gateway_ppec()->version );
    248261
    249262        // On the checkout page, only load the JS if we plan on sending them over to PayPal.
    250         $payer_id = $settings->getActiveApiCredentials()->get_payer_id();
     263        $payer_id = $api_credentials->get_payer_id();
    251264        if ( $settings->enableInContextCheckout && ! empty( $payer_id )  ) {
    252265            $session = WC()->session->paypal;
  • woocommerce-gateway-paypal-express-checkout/trunk/includes/class-wc-gateway-ppec-ips-handler.php

    r1384111 r1437984  
    5555                'wc_ppec_ips_admin_nonce' => wp_create_nonce( 'wc_ppec_ips' ),
    5656            ),
    57             wc_gateway_ppec()->admin->gateway_admin_url( 'WC_Gateway_PPEC_With_PayPal' )
     57            wc_gateway_ppec()->get_admin_setting_link()
    5858        );
    5959    }
     
    116116
    117117        add_option( 'woo_pp_admin_error', $error_msgs );
    118         wp_safe_redirect( wc_gateway_ppec()->admin->gateway_admin_url( 'WC_Gateway_PPEC_With_PayPal' ) );
     118        wp_safe_redirect( wc_gateway_ppec()->get_admin_setting_link() );
    119119        exit;
    120120    }
  • woocommerce-gateway-paypal-express-checkout/trunk/readme.txt

    r1428748 r1437984  
    44Requires at least: 4.4
    55Tested up to: 4.4
    6 Stable tag: 1.0.3
     6Stable tag: 1.0.4
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    8181== Changelog ==
    8282
     83= 1.0.4 =
     84
     85* Fix - Wrong section slug / tab after redirected from connect.woocommerce.com
     86* Fix - Make sure to check if credentials were set in cart and checkout pages
     87* Fix - Removed configuration of chipers to use for TLS
     88
    8389= 1.0.3 =
    8490
  • woocommerce-gateway-paypal-express-checkout/trunk/woocommerce-gateway-paypal-express-checkout.php

    r1428748 r1437984  
    22/**
    33 * Plugin Name: WooCommerce PayPal Express Checkout Gateway
    4  * Plugin URI: https://woothemes.com
     4 * Plugin URI: https://www.woothemes.com/products/woocommerce-gateway-paypal-express-checkout/
    55 * Description: A payment gateway for PayPal Express Checkout ( https://www.paypal.com/us/webapps/mpp/express-checkout ). Requires WC 2.5+
    6  * Version: 1.0.3
     6 * Version: 1.0.4
    77 * Author: Automattic/WooCommerce
    88 * Author URI: https://woocommerce.com
     
    3737        require_once( 'includes/class-wc-gateway-ppec-plugin.php' );
    3838
    39         $plugin = new WC_Gateway_PPEC_Plugin( __FILE__, '1.0.3' );
     39        $plugin = new WC_Gateway_PPEC_Plugin( __FILE__, '1.0.4' );
    4040    }
    4141
Note: See TracChangeset for help on using the changeset viewer.