WooCommerce PayPal Powered by Braintree Payment Gateway - Version 1.2.6

Version Description

  • Fix - Issue where buyer unable to change subscription payment method with free-trial (order total is 0).
Download this release

Release Info

Developer akeda
Plugin Icon 128x128 WooCommerce PayPal Powered by Braintree Payment Gateway
Version 1.2.6
Comparing to
See all releases

Code changes from version 1.2.5 to 1.2.6

assets/js/checkout.js CHANGED
@@ -237,4 +237,7 @@ jQuery( document ).ready( function( $ ) {
237
 
238
  setInterval( checkSetup, 250 );
239
 
 
 
 
240
  } );
237
 
238
  setInterval( checkSetup, 250 );
239
 
240
+ $( document.body ).on( 'checkout_error', function() {
241
+ $( '#paypalbraintree_nonce' ).remove();
242
+ });
243
  } );
classes/class-wc-gateway-paypal-braintree-subscription.php CHANGED
@@ -34,13 +34,21 @@ abstract class WC_Gateway_Paypal_Braintree_Subscription extends WC_Gateway_Paypa
34
  }
35
 
36
  /**
37
- * Check if order contains subscriptions.
38
  *
39
  * @param int $order_id
40
  * @return bool
41
  */
42
  protected function order_contains_subscription( $order_id ) {
43
- return function_exists( 'wcs_order_contains_subscription' ) && ( wcs_order_contains_subscription( $order_id ) || wcs_order_contains_renewal( $order_id ) );
 
 
 
 
 
 
 
 
44
  }
45
 
46
  /**
@@ -170,7 +178,7 @@ abstract class WC_Gateway_Paypal_Braintree_Subscription extends WC_Gateway_Paypa
170
  // We have a customer id now, so let's do the sale and store the payment method in the vault.
171
  $result = $gateway->transaction()->sale( $sale_args );
172
  if ( ! $result->success ) {
173
- $notice = sprintf( __( 'Error: PayPal Powered by Braintree was unable to complete the transaction. Please try again later or use another means of payment. Reason: %s', 'woocommerce-gateway-paypal-braintree' ), $error_message );
174
  wc_add_notice( $notice, 'error' );
175
  $this->log( __FUNCTION__, "Error: Unable to complete transaction. Reason: {$result->message}" );
176
  return false;
34
  }
35
 
36
  /**
37
+ * Check if order contains subscriptions, is renewal order, or subscription.
38
  *
39
  * @param int $order_id
40
  * @return bool
41
  */
42
  protected function order_contains_subscription( $order_id ) {
43
+ if ( ! function_exists( 'wcs_order_contains_subscription' ) ) {
44
+ return false;
45
+ }
46
+
47
+ return (
48
+ wcs_order_contains_subscription( $order_id )
49
+ || wcs_order_contains_renewal( $order_id )
50
+ || wcs_is_subscription( $order_id )
51
+ );
52
  }
53
 
54
  /**
178
  // We have a customer id now, so let's do the sale and store the payment method in the vault.
179
  $result = $gateway->transaction()->sale( $sale_args );
180
  if ( ! $result->success ) {
181
+ $notice = sprintf( __( 'Error: PayPal Powered by Braintree was unable to complete the transaction. Please try again later or use another means of payment. Reason: %s', 'woocommerce-gateway-paypal-braintree' ), $result->message );
182
  wc_add_notice( $notice, 'error' );
183
  $this->log( __FUNCTION__, "Error: Unable to complete transaction. Reason: {$result->message}" );
184
  return false;
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: automattic, akeda, allendav, royho, slash1andy, woosteve, spraveen
3
  Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, paypal, braintree
4
  Requires at least: 4.4
5
  Tested up to: 4.6.1
6
- Stable tag: 1.2.5
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -110,6 +110,9 @@ New feature requests and bugs reports can be made in the plugin forum.
110
 
111
  == Changelog ==
112
 
 
 
 
113
  = 1.2.5 =
114
  * Fix - Prevent void on unsettled transaction when refunding partially.
115
  * Tweak - Add filter wc_gateway_paypal_braintree_sale_args to filter arguments passed to sale call.
3
  Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, paypal, braintree
4
  Requires at least: 4.4
5
  Tested up to: 4.6.1
6
+ Stable tag: 1.2.6
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
110
 
111
  == Changelog ==
112
 
113
+ = 1.2.6 =
114
+ * Fix - Issue where buyer unable to change subscription payment method with free-trial (order total is 0).
115
+
116
  = 1.2.5 =
117
  * Fix - Prevent void on unsettled transaction when refunding partially.
118
  * Tweak - Add filter wc_gateway_paypal_braintree_sale_args to filter arguments passed to sale call.
woocommerce-gateway-paypal-powered-by-braintree.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Receive payments using Paypal Powered by Braintree. A server with cURL, SSL support, and a valid SSL certificate is required (for security reasons) for this gateway to function. Requires PHP 5.4+
6
  * Author: WooThemes
7
  * Author URI: http://woothemes.com/
8
- * Version: 1.2.5
9
  *
10
  * Copyright (c) 2016 WooThemes
11
  *
5
  * Description: Receive payments using Paypal Powered by Braintree. A server with cURL, SSL support, and a valid SSL certificate is required (for security reasons) for this gateway to function. Requires PHP 5.4+
6
  * Author: WooThemes
7
  * Author URI: http://woothemes.com/
8
+ * Version: 1.2.6
9
  *
10
  * Copyright (c) 2016 WooThemes
11
  *