WordPress.org

Plugin Directory

Changeset 1687057


Ignore:
Timestamp:
06/28/17 15:55:26 (5 months ago)
Author:
bor0
Message:

Update trunk to 1.4.1

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

Legend:

Unmodified
Added
Removed
  • woocommerce-gateway-paypal-express-checkout/trunk/includes/class-wc-gateway-ppec-cart-handler.php

    r1673238 r1687057  
    210210 
    211211        if ( is_cart() ) { 
    212             wp_enqueue_script( 'paypal-checkout-js', 'https://www.paypalobjects.com/api/checkout.js', array(), '1.0', true ); 
     212            wp_enqueue_script( 'paypal-checkout-js', 'https://www.paypalobjects.com/api/checkout.js', array(), null, true ); 
    213213            wp_enqueue_script( 'wc-gateway-ppec-frontend-in-context-checkout', wc_gateway_ppec()->plugin_url . 'assets/js/wc-gateway-ppec-frontend-in-context-checkout.js', array( 'jquery' ), wc_gateway_ppec()->version, true ); 
    214214            wp_localize_script( 'wc-gateway-ppec-frontend-in-context-checkout', 'wc_ppec_context', 
  • woocommerce-gateway-paypal-express-checkout/trunk/includes/class-wc-gateway-ppec-checkout-handler.php

    r1673238 r1687057  
    146146 
    147147        if ( array_key_exists( 'billing_phone', $billing_fields ) ) { 
    148             $billing_fields['billing_phone']['required'] = 'no' !== $require_phone_number; 
     148            $billing_fields['billing_phone']['required'] = 'yes' === $require_phone_number; 
    149149        }; 
    150150 
     
    293293        } catch ( PayPal_API_Exception $e ) { 
    294294            wc_add_notice( $e->getMessage(), 'error' ); 
     295            return; 
     296        } 
     297 
     298        if ( ! WC_Gateway_PPEC_Plugin::needs_shipping() ) { 
    295299            return; 
    296300        } 
  • woocommerce-gateway-paypal-express-checkout/trunk/includes/class-wc-gateway-ppec-client.php

    r1673238 r1687057  
    304304                'PAYMENTREQUEST_0_TAXAMT'       => $details['order_tax'], 
    305305                'PAYMENTREQUEST_0_SHIPDISCAMT'  => $details['ship_discount_amount'], 
    306                 'NOSHIPPING'                    => 0, 
     306                'NOSHIPPING'                    => WC_Gateway_PPEC_Plugin::needs_shipping() ? 0 : 1, 
    307307            ) 
    308308        ); 
     
    841841                'order_key' => $order_key, 
    842842            ) ), 
    843             'NOSHIPPING'                     => 0, 
    844         ); 
    845  
    846         if ( ! empty( $details['shipping_address'] ) ) { 
     843            'NOSHIPPING'                     => WC_Gateway_PPEC_Plugin::needs_shipping() ? 0 : 1, 
     844        ); 
     845 
     846        if ( WC_Gateway_PPEC_Plugin::needs_shipping() && ! empty( $details['shipping_address'] ) ) { 
    847847            $params = array_merge( 
    848848                $params, 
  • woocommerce-gateway-paypal-express-checkout/trunk/includes/class-wc-gateway-ppec-plugin.php

    r1646963 r1687057  
    373373        return array_merge( $plugin_links, $links ); 
    374374    } 
     375 
     376    /** 
     377     * Check if shipping is needed for PayPal. 
     378     * 
     379     * @since 1.4.1 
     380     * @version 1.4.1 
     381     * 
     382     * @return bool 
     383     */ 
     384    public static function needs_shipping() { 
     385        // In case there are no shipping methods defined, we still return true (see #249) 
     386        if ( ! wc_shipping_enabled() || 0 === wc_get_shipping_method_count( true ) ) { 
     387            return true; 
     388        } 
     389 
     390        // Otherwise go through all items and see if they require shipping (e.g. virtual items will not, see #286) 
     391        return WC()->cart->needs_shipping(); 
     392    } 
    375393} 
  • woocommerce-gateway-paypal-express-checkout/trunk/readme.txt

    r1673238 r1687057  
    44Requires at least: 4.4 
    55Tested up to: 4.7 
    6 Stable tag: 1.4.0 
     6Stable tag: 1.4.1 
    77License: GPLv3 
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html 
     
    8585 
    8686== Changelog == 
     87 
     88= 1.4.1 = 
     89* Fix   - Properly calculate whether Billing phone is required or not. 
     90* Fix   - Set NOSHIPPING based on product shipping requiredness (e.g. virtual products do not need shipping, etc) 
    8791 
    8892= 1.4.0 = 
  • woocommerce-gateway-paypal-express-checkout/trunk/woocommerce-gateway-paypal-express-checkout.php

    r1673238 r1687057  
    44 * Plugin URI: https://woocommerce.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). 
    6  * Version: 1.4.0 
     6 * Version: 1.4.1 
    77 * Author: WooCommerce 
    88 * Author URI: https://woocommerce.com 
     
    2626} 
    2727 
    28 define( 'WC_GATEWAY_PPEC_VERSION', '1.4.0' ); 
     28define( 'WC_GATEWAY_PPEC_VERSION', '1.4.1' ); 
    2929 
    3030/** 
Note: See TracChangeset for help on using the changeset viewer.