WordPress.org

Plugin Directory

Changeset 1714115


Ignore:
Timestamp:
08/16/17 13:36:25 (5 weeks ago)
Author:
bor0
Message:

Update trunk to 1.4.3

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

Legend:

Unmodified
Added
Removed
  • woocommerce-gateway-paypal-express-checkout/trunk/assets/js/wc-gateway-ppec-generate-cart.js

    r1673238 r1714115  
    22;(function( $, window, document ) { 
    33    'use strict'; 
     4 
     5    var button_enabled = true; 
     6 
     7    var toggle_button_availability = function( available ) { 
     8        if ( available ) { 
     9            button_enabled = true; 
     10            $( '#woo_pp_ec_button_product' ).css( { 
     11                'cursor': '', 
     12                '-webkit-filter': '', // Safari 6.0 - 9.0 
     13                'filter': '', 
     14            } ); 
     15        } else { 
     16            button_enabled = false; 
     17            $( '#woo_pp_ec_button_product' ).css( { 
     18                'cursor': 'not-allowed', 
     19                '-webkit-filter': 'grayscale( 100% )', // Safari 6.0 - 9.0 
     20                'filter': 'grayscale( 100% )', 
     21            } ); 
     22        } 
     23    } 
    424 
    525    var get_attributes = function() { 
     
    2848    }; 
    2949 
    30     $( '#woo_pp_ec_button' ).click( function( event ) { 
     50    // It's a variations form, button availability should depend on its events 
     51    if ( $( '.variations_form' ).length ) { 
     52        toggle_button_availability( false ); 
     53 
     54        $( '.variations_form' ) 
     55        .on( 'show_variation', function( event, form, purchasable ) { 
     56            toggle_button_availability( purchasable ); 
     57        } ) 
     58        .on( 'hide_variation', function() { 
     59            toggle_button_availability( false ); 
     60        } ); 
     61    } 
     62 
     63    $( '#woo_pp_ec_button_product' ).click( function( event ) { 
    3164        event.preventDefault(); 
     65 
     66        if ( ! button_enabled ) { 
     67            return; 
     68        } 
     69 
     70        toggle_button_availability( false ); 
    3271 
    3372        var data = { 
  • woocommerce-gateway-paypal-express-checkout/trunk/includes/class-wc-gateway-ppec-admin-handler.php

    r1699076 r1714115  
    169169                } else { 
    170170                    update_post_meta( $order_id, '_paypal_status', ! empty( $trans_details['PAYMENTSTATUS'] ) ? $trans_details['PAYMENTSTATUS'] : 'completed' ); 
     171 
     172                    if ( ! empty( $result['TRANSACTIONID'] ) ) { 
     173                        update_post_meta( $order_id, '_transaction_id', $result['TRANSACTIONID'] ); 
     174                    } 
     175 
    171176                    $order->add_order_note( sprintf( __( 'PayPal Express Checkout charge complete (Charge ID: %s)', 'woocommerce-gateway-paypal-express-checkout' ), $trans_id ) ); 
    172177                } 
  • woocommerce-gateway-paypal-express-checkout/trunk/includes/class-wc-gateway-ppec-cart-handler.php

    r1687057 r1714115  
    133133        <div class="wcppec-checkout-buttons woo_pp_cart_buttons_div"> 
    134134 
    135             <a href="<?php echo esc_url( add_query_arg( array( 'startcheckout' => 'true' ), wc_get_page_permalink( 'cart' ) ) ); ?>" id="woo_pp_ec_button" class="wcppec-checkout-buttons__button"> 
     135            <a href="<?php echo esc_url( add_query_arg( array( 'startcheckout' => 'true' ), wc_get_page_permalink( 'cart' ) ) ); ?>" id="woo_pp_ec_button_product" class="wcppec-checkout-buttons__button"> 
    136136                <img src="<?php echo esc_url( $express_checkout_img_url ); ?>" alt="<?php _e( 'Check out with PayPal', 'woocommerce-gateway-paypal-express-checkout' ); ?>" style="width: auto; height: auto;"> 
    137137            </a> 
  • woocommerce-gateway-paypal-express-checkout/trunk/includes/class-wc-gateway-ppec-checkout-handler.php

    r1699076 r1714115  
    230230 
    231231            <?php if ( ! empty( $checkout_details->payer_details->phone_number ) ) : ?> 
    232                 <li><strong><?php _e( 'Tel:', 'woocommerce-gateway-paypal-express-checkout' ) ?></strong> <?php echo esc_html( $checkout_details->payer_details->phone_number ); ?></li> 
     232                <li><strong><?php _e( 'Phone:', 'woocommerce-gateway-paypal-express-checkout' ) ?></strong> <?php echo esc_html( $checkout_details->payer_details->phone_number ); ?></li> 
     233            <?php elseif ( 'yes' === wc_gateway_ppec()->settings->require_phone_number ) : ?> 
     234                <li><?php $fields = WC()->checkout->get_checkout_fields( 'billing' ); woocommerce_form_field( 'billing_phone', $fields['billing_phone'], WC()->checkout->get_value( 'billing_phone' ) ); ?></li> 
    233235            <?php endif; ?> 
    234236        </ul> 
     
    322324        if ( empty( $checkout_details->payer_details ) ) { 
    323325            return array(); 
     326        } 
     327 
     328        $phone = ''; 
     329 
     330        if ( ! empty( $checkout_details->payer_details->phone_number ) ) { 
     331            $phone = $checkout_details->payer_details->phone_number; 
     332        } elseif ( 'yes' === wc_gateway_ppec()->settings->require_phone_number && ! empty( $_POST['billing_phone'] ) ) { 
     333            $phone = wc_clean( $_POST['billing_phone'] ); 
    324334        } 
    325335 
     
    334344            'postcode'   => $checkout_details->payer_details->billing_address ? $checkout_details->payer_details->billing_address->getZip() : '', 
    335345            'country'    => $checkout_details->payer_details->billing_address ? $checkout_details->payer_details->billing_address->getCountry() : $checkout_details->payer_details->country, 
    336             'phone'      => $checkout_details->payer_details->phone_number, 
     346            'phone'      => $phone, 
    337347            'email'      => $checkout_details->payer_details->email, 
    338348        ); 
  • woocommerce-gateway-paypal-express-checkout/trunk/includes/class-wc-gateway-ppec-client.php

    r1699076 r1714115  
    548548                // calculations and PayPal calculations. 
    549549                $diff = round( $details['total_item_amount'] - $rounded_total, $decimals ); 
    550                 if ( $diff != 0 ) { 
     550                if ( abs( $diff ) > 0.000001 ) { 
    551551                    $extra_line_item = $this->_get_extra_offset_line_item( $diff ); 
    552552 
     
    604604        } 
    605605 
    606         if ( 0 !== $lisum ) { 
     606        if ( abs( $lisum ) > 0.000001 ) { 
    607607            $details['items'][] = $this->_get_extra_offset_line_item( $details['total_item_amount'] - $lisum ); 
    608608        } 
  • woocommerce-gateway-paypal-express-checkout/trunk/includes/class-wc-gateway-ppec-ipn-handler.php

    r1673238 r1714115  
    167167     */ 
    168168    protected function payment_status_completed( $order, $posted_data ) { 
    169         $old_wc = version_compare( WC_VERSION, '3.0', '<' ); 
    170         $order_id = $old_wc ? $order->id : $order->get_id(); 
     169        $order_id = version_compare( WC_VERSION, '3.0', '<' ) ? $order->id : $order->get_id(); 
    171170 
    172171        if ( $order->has_status( array( 'processing', 'completed' ) ) ) { 
     
    185184                // Log paypal transaction fee. 
    186185                $transaction_fee = wc_clean( $posted_data['mc_fee'] ); 
    187                 if ( $old_wc ) { 
    188                     update_post_meta( $order_id, 'PayPal Transaction Fee', $transaction_fee ); 
    189                 } else { 
    190                     $order->update_meta_data( 'PayPal Transaction Fee', $transaction_fee ); 
    191                 } 
     186                update_post_meta( $order_id, 'PayPal Transaction Fee', $transaction_fee ); 
    192187            } 
    193188        } else { 
  • woocommerce-gateway-paypal-express-checkout/trunk/readme.txt

    r1699076 r1714115  
    33Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, paypal 
    44Requires at least: 4.4 
    5 Tested up to: 4.7 
    6 Stable tag: 1.4.2 
     5Tested up to: 4.8.1 
     6Stable tag: 1.4.3 
    77License: GPLv3 
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html 
     
    8686== Changelog == 
    8787 
     88= 1.4.3 = 
     89* Fix   - Refunds not working on authorize then captured transactions. 
     90* Fix   - Checkout on single product available before variations are chosen. 
     91* Fix   - Not Returning PayPal Transaction Fee. 
     92* Fix   - 10431 (Item Amount Invalid at Checkout) error with discounts. 
     93* Fix   - Phone not returned and "Require Phone Number" setting not working. 
     94 
    8895= 1.4.2 = 
    8996* Fix   - _paypal_status on Authorize transactions not updating to processing after capture. 
     
    93100= 1.4.1 = 
    94101* Fix   - Properly calculate whether Billing phone is required or not. 
    95 * Fix   - Set NOSHIPPING based on product shipping requiredness (e.g. virtual products do not need shipping, etc) 
     102* Fix   - Set NOSHIPPING based on product shipping requiredness (e.g. virtual products do not need shipping, etc). 
    96103 
    97104= 1.4.0 = 
  • woocommerce-gateway-paypal-express-checkout/trunk/woocommerce-gateway-paypal-express-checkout.php

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