Version Description
- 2018-05-08 =
- Add - Hook to make billing address not required
woocommerce_paypal_express_checkout_address_not_required
(bool). - Fix - Duplicate checkout settings when PP Credit option is enabled.
- Fix - Impossible to open API credentials after saving Settings.
- Fix - Prevent filtering if PPEC is not enabled.
- Fix - Single Product checkout: Quantity being duplicated due to multiple AJAX calls.
- Fix - When returning from PayPal, place order buttons says "proceed to payment".
- Tweak - Default billing address to be required.
Download this release
Release Info
Developer | bor0 |
Plugin | WooCommerce PayPal Express Checkout Payment Gateway |
Version | 1.5.4 |
Comparing to | |
See all releases |
Code changes from version 1.5.3 to 1.5.4
- changelog.txt +9 -0
- includes/abstracts/abstract-wc-gateway-ppec.php +17 -0
- includes/class-wc-gateway-ppec-cart-handler.php +1 -0
- includes/class-wc-gateway-ppec-checkout-handler.php +14 -1
- includes/class-wc-gateway-ppec-with-paypal-credit.php +1 -6
- includes/settings/settings-ppec.php +2 -0
- readme.txt +10 -1
- woocommerce-gateway-paypal-express-checkout.php +2 -2
changelog.txt
CHANGED
@@ -1,5 +1,14 @@
|
|
1 |
*** Changelog ***
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
= 1.5.3 - 2018-03-28 =
|
4 |
* Fix - wp_enqueue_media was not correctly loaded causing weird behavior with other parts of system wanting to use it.
|
5 |
* Fix - Typo in activation hook.
|
1 |
*** Changelog ***
|
2 |
|
3 |
+
= 1.5.4 - 2018-05-08 =
|
4 |
+
* Add - Hook to make billing address not required `woocommerce_paypal_express_checkout_address_not_required` (bool).
|
5 |
+
* Fix - Duplicate checkout settings when PP Credit option is enabled.
|
6 |
+
* Fix - Impossible to open API credentials after saving Settings.
|
7 |
+
* Fix - Prevent filtering if PPEC is not enabled.
|
8 |
+
* Fix - Single Product checkout: Quantity being duplicated due to multiple AJAX calls.
|
9 |
+
* Fix - When returning from PayPal, place order buttons says "proceed to payment".
|
10 |
+
* Tweak - Default billing address to be required.
|
11 |
+
|
12 |
= 1.5.3 - 2018-03-28 =
|
13 |
* Fix - wp_enqueue_media was not correctly loaded causing weird behavior with other parts of system wanting to use it.
|
14 |
* Fix - Typo in activation hook.
|
includes/abstracts/abstract-wc-gateway-ppec.php
CHANGED
@@ -67,6 +67,23 @@ abstract class WC_Gateway_PPEC extends WC_Payment_Gateway {
|
|
67 |
} else {
|
68 |
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
69 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
}
|
71 |
|
72 |
/**
|
67 |
} else {
|
68 |
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
69 |
}
|
70 |
+
|
71 |
+
add_filter( 'woocommerce_ajax_get_endpoint', array( $this, 'pass_return_args_to_ajax' ), 10, 2 );
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Pass woo return args to AJAX endpoint when the checkout updates from the frontend
|
76 |
+
* so that the order button gets set correctly.
|
77 |
+
*
|
78 |
+
* @param string $request Optional.
|
79 |
+
* @return string
|
80 |
+
*/
|
81 |
+
public function pass_return_args_to_ajax( $request ) {
|
82 |
+
if ( isset( $_GET['woo-paypal-return'] ) ) {
|
83 |
+
$request .= '&woo-paypal-return=1';
|
84 |
+
}
|
85 |
+
|
86 |
+
return $request;
|
87 |
}
|
88 |
|
89 |
/**
|
includes/class-wc-gateway-ppec-cart-handler.php
CHANGED
@@ -74,6 +74,7 @@ class WC_Gateway_PPEC_Cart_Handler {
|
|
74 |
*/
|
75 |
if ( $product ) {
|
76 |
$qty = ! isset( $_POST['qty'] ) ? 1 : absint( $_POST['qty'] );
|
|
|
77 |
|
78 |
if ( $product->is_type( 'variable' ) ) {
|
79 |
$attributes = array_map( 'wc_clean', $_POST['attributes'] );
|
74 |
*/
|
75 |
if ( $product ) {
|
76 |
$qty = ! isset( $_POST['qty'] ) ? 1 : absint( $_POST['qty'] );
|
77 |
+
wc_empty_cart();
|
78 |
|
79 |
if ( $product->is_type( 'variable' ) ) {
|
80 |
$attributes = array_map( 'wc_clean', $_POST['attributes'] );
|
includes/class-wc-gateway-ppec-checkout-handler.php
CHANGED
@@ -114,11 +114,20 @@ class WC_Gateway_PPEC_Checkout_Handler {
|
|
114 |
* See also filter_billing_fields below.
|
115 |
*
|
116 |
* @since 1.2.1
|
|
|
117 |
* @param $fields array
|
118 |
*
|
119 |
* @return array
|
120 |
*/
|
121 |
public function filter_default_address_fields( $fields ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
if ( method_exists( WC()->cart, 'needs_shipping' ) && ! WC()->cart->needs_shipping() ) {
|
123 |
$not_required_fields = array( 'address_1', 'city', 'postcode', 'country' );
|
124 |
foreach ( $not_required_fields as $not_required_field ) {
|
@@ -146,12 +155,16 @@ class WC_Gateway_PPEC_Checkout_Handler {
|
|
146 |
* This is one of two places we need to filter fields. See also filter_default_address_fields above.
|
147 |
*
|
148 |
* @since 1.2.0
|
149 |
-
* @
|
150 |
* @param $billing_fields array
|
151 |
*
|
152 |
* @return array
|
153 |
*/
|
154 |
public function filter_billing_fields( $billing_fields ) {
|
|
|
|
|
|
|
|
|
155 |
$require_phone_number = wc_gateway_ppec()->settings->require_phone_number;
|
156 |
|
157 |
if ( array_key_exists( 'billing_phone', $billing_fields ) ) {
|
114 |
* See also filter_billing_fields below.
|
115 |
*
|
116 |
* @since 1.2.1
|
117 |
+
* @since 1.5.4 Check to make sure PPEC is even enable before continuing.
|
118 |
* @param $fields array
|
119 |
*
|
120 |
* @return array
|
121 |
*/
|
122 |
public function filter_default_address_fields( $fields ) {
|
123 |
+
if ( 'yes' !== wc_gateway_ppec()->settings->enabled ) {
|
124 |
+
return $fields;
|
125 |
+
}
|
126 |
+
|
127 |
+
if ( ! apply_filters( 'woocommerce_paypal_express_checkout_address_not_required', false ) ) {
|
128 |
+
return $fields;
|
129 |
+
}
|
130 |
+
|
131 |
if ( method_exists( WC()->cart, 'needs_shipping' ) && ! WC()->cart->needs_shipping() ) {
|
132 |
$not_required_fields = array( 'address_1', 'city', 'postcode', 'country' );
|
133 |
foreach ( $not_required_fields as $not_required_field ) {
|
155 |
* This is one of two places we need to filter fields. See also filter_default_address_fields above.
|
156 |
*
|
157 |
* @since 1.2.0
|
158 |
+
* @since 1.5.4 Check to make sure PPEC is even enable before continuing.
|
159 |
* @param $billing_fields array
|
160 |
*
|
161 |
* @return array
|
162 |
*/
|
163 |
public function filter_billing_fields( $billing_fields ) {
|
164 |
+
if ( 'yes' !== wc_gateway_ppec()->settings->enabled ) {
|
165 |
+
return $billing_fields;
|
166 |
+
}
|
167 |
+
|
168 |
$require_phone_number = wc_gateway_ppec()->settings->require_phone_number;
|
169 |
|
170 |
if ( array_key_exists( 'billing_phone', $billing_fields ) ) {
|
includes/class-wc-gateway-ppec-with-paypal-credit.php
CHANGED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
4 |
exit; // Exit if accessed directly
|
5 |
}
|
6 |
|
7 |
-
class WC_Gateway_PPEC_With_PayPal_Credit extends
|
8 |
public function __construct() {
|
9 |
$this->icon = 'https://www.paypalobjects.com/webstatic/en_US/i/buttons/ppc-acceptance-small.png';
|
10 |
|
@@ -16,11 +16,6 @@ class WC_Gateway_PPEC_With_PayPal_Credit extends WC_Gateway_PPEC {
|
|
16 |
}
|
17 |
}
|
18 |
|
19 |
-
if ( $this->is_available() ) {
|
20 |
-
$ipn_handler = new WC_Gateway_PPEC_IPN_Handler( $this );
|
21 |
-
$ipn_handler->handle();
|
22 |
-
}
|
23 |
-
|
24 |
$this->use_ppc = true;
|
25 |
}
|
26 |
}
|
4 |
exit; // Exit if accessed directly
|
5 |
}
|
6 |
|
7 |
+
class WC_Gateway_PPEC_With_PayPal_Credit extends WC_Gateway_PPEC_With_PayPal {
|
8 |
public function __construct() {
|
9 |
$this->icon = 'https://www.paypalobjects.com/webstatic/en_US/i/buttons/ppc-acceptance-small.png';
|
10 |
|
16 |
}
|
17 |
}
|
18 |
|
|
|
|
|
|
|
|
|
|
|
19 |
$this->use_ppc = true;
|
20 |
}
|
21 |
}
|
includes/settings/settings-ppec.php
CHANGED
@@ -94,12 +94,14 @@ wc_enqueue_js( "
|
|
94 |
}).change();
|
95 |
|
96 |
if ( enable_toggle ) {
|
|
|
97 |
$( document ).on( 'click', '.ppec-toggle-settings', function( e ) {
|
98 |
$( ppec_live_fields ).closest( 'tr' ).toggle( 'fast' );
|
99 |
e.preventDefault();
|
100 |
} );
|
101 |
}
|
102 |
if ( enable_sandbox_toggle ) {
|
|
|
103 |
$( document ).on( 'click', '.ppec-toggle-sandbox-settings', function( e ) {
|
104 |
$( ppec_sandbox_fields ).closest( 'tr' ).toggle( 'fast' );
|
105 |
e.preventDefault();
|
94 |
}).change();
|
95 |
|
96 |
if ( enable_toggle ) {
|
97 |
+
$( document ).off( 'click', '.ppec-toggle-settings' );
|
98 |
$( document ).on( 'click', '.ppec-toggle-settings', function( e ) {
|
99 |
$( ppec_live_fields ).closest( 'tr' ).toggle( 'fast' );
|
100 |
e.preventDefault();
|
101 |
} );
|
102 |
}
|
103 |
if ( enable_sandbox_toggle ) {
|
104 |
+
$( document ).off( 'click', '.ppec-toggle-sandbox-settings' );
|
105 |
$( document ).on( 'click', '.ppec-toggle-sandbox-settings', function( e ) {
|
106 |
$( ppec_sandbox_fields ).closest( 'tr' ).toggle( 'fast' );
|
107 |
e.preventDefault();
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: automattic, woothemes, akeda, dwainm, royho, allendav, slash1andy,
|
|
3 |
Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, paypal
|
4 |
Requires at least: 4.4
|
5 |
Tested up to: 4.9.0
|
6 |
-
Stable tag: 1.5.
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -93,6 +93,15 @@ Please use this to inform us about bugs, or make contributions via PRs.
|
|
93 |
|
94 |
== Changelog ==
|
95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
= 1.5.3 - 2018-03-28 =
|
97 |
* Fix - wp_enqueue_media was not correctly loaded causing weird behavior with other parts of system wanting to use it.
|
98 |
* Fix - Typo in activation hook.
|
3 |
Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, paypal
|
4 |
Requires at least: 4.4
|
5 |
Tested up to: 4.9.0
|
6 |
+
Stable tag: 1.5.4
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
93 |
|
94 |
== Changelog ==
|
95 |
|
96 |
+
= 1.5.4 - 2018-05-08 =
|
97 |
+
* Add - Hook to make billing address not required `woocommerce_paypal_express_checkout_address_not_required` (bool).
|
98 |
+
* Fix - Duplicate checkout settings when PP Credit option is enabled.
|
99 |
+
* Fix - Impossible to open API credentials after saving Settings.
|
100 |
+
* Fix - Prevent filtering if PPEC is not enabled.
|
101 |
+
* Fix - Single Product checkout: Quantity being duplicated due to multiple AJAX calls.
|
102 |
+
* Fix - When returning from PayPal, place order buttons says "proceed to payment".
|
103 |
+
* Tweak - Default billing address to be required.
|
104 |
+
|
105 |
= 1.5.3 - 2018-03-28 =
|
106 |
* Fix - wp_enqueue_media was not correctly loaded causing weird behavior with other parts of system wanting to use it.
|
107 |
* Fix - Typo in activation hook.
|
woocommerce-gateway-paypal-express-checkout.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: WooCommerce PayPal Express Checkout Gateway
|
4 |
* Plugin URI: https://woocommerce.com/products/woocommerce-gateway-paypal-express-checkout/
|
5 |
* Description: A payment gateway for PayPal Express Checkout (https://www.paypal.com/us/webapps/mpp/express-checkout).
|
6 |
-
* Version: 1.5.
|
7 |
* Author: WooCommerce
|
8 |
* Author URI: https://woocommerce.com
|
9 |
* Copyright: © 2018 WooCommerce / PayPal.
|
@@ -27,7 +27,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
27 |
exit; // Exit if accessed directly
|
28 |
}
|
29 |
|
30 |
-
define( 'WC_GATEWAY_PPEC_VERSION', '1.5.
|
31 |
|
32 |
/**
|
33 |
* Return instance of WC_Gateway_PPEC_Plugin.
|
3 |
* Plugin Name: WooCommerce PayPal Express Checkout Gateway
|
4 |
* Plugin URI: https://woocommerce.com/products/woocommerce-gateway-paypal-express-checkout/
|
5 |
* Description: A payment gateway for PayPal Express Checkout (https://www.paypal.com/us/webapps/mpp/express-checkout).
|
6 |
+
* Version: 1.5.4
|
7 |
* Author: WooCommerce
|
8 |
* Author URI: https://woocommerce.com
|
9 |
* Copyright: © 2018 WooCommerce / PayPal.
|
27 |
exit; // Exit if accessed directly
|
28 |
}
|
29 |
|
30 |
+
define( 'WC_GATEWAY_PPEC_VERSION', '1.5.4' );
|
31 |
|
32 |
/**
|
33 |
* Return instance of WC_Gateway_PPEC_Plugin.
|