WooCommerce PayPal Express Checkout Payment Gateway - Version 1.4.4

Version Description

  • Fix - PayPal error (10431).
  • Fix - PHP notices.
Download this release

Release Info

Developer bor0
Plugin Icon 128x128 WooCommerce PayPal Express Checkout Payment Gateway
Version 1.4.4
Comparing to
See all releases

Code changes from version 1.4.3 to 1.4.4

includes/class-wc-gateway-ppec-client.php CHANGED
@@ -408,11 +408,14 @@ class WC_Gateway_PPEC_Client {
408
  * @return array Line item
409
  */
410
  protected function _get_extra_offset_line_item( $amount ) {
 
 
 
411
  return array(
412
  'name' => 'Line Item Amount Offset',
413
  'description' => 'Adjust cart calculation discrepancy',
414
  'quantity' => 1,
415
- 'amount' => $amount,
416
  );
417
  }
418
 
@@ -426,11 +429,14 @@ class WC_Gateway_PPEC_Client {
426
  * @return array Line item
427
  */
428
  protected function _get_extra_discount_line_item( $amount ) {
 
 
 
429
  return array(
430
  'name' => 'Discount',
431
  'description' => 'Discount Amount',
432
  'quantity' => 1,
433
- 'amount' => '-' . $amount,
434
  );
435
  }
436
 
@@ -599,8 +605,10 @@ class WC_Gateway_PPEC_Client {
599
 
600
  $lisum = 0;
601
 
602
- foreach ( $details['items'] as $li => $values ) {
603
- $lisum += $values['quantity'] * $values['amount'];
 
 
604
  }
605
 
606
  if ( abs( $lisum ) > 0.000001 ) {
408
  * @return array Line item
409
  */
410
  protected function _get_extra_offset_line_item( $amount ) {
411
+ $settings = wc_gateway_ppec()->settings;
412
+ $decimals = $settings->get_number_of_decimal_digits();
413
+
414
  return array(
415
  'name' => 'Line Item Amount Offset',
416
  'description' => 'Adjust cart calculation discrepancy',
417
  'quantity' => 1,
418
+ 'amount' => round( $amount, $decimals ),
419
  );
420
  }
421
 
429
  * @return array Line item
430
  */
431
  protected function _get_extra_discount_line_item( $amount ) {
432
+ $settings = wc_gateway_ppec()->settings;
433
+ $decimals = $settings->get_number_of_decimal_digits();
434
+
435
  return array(
436
  'name' => 'Discount',
437
  'description' => 'Discount Amount',
438
  'quantity' => 1,
439
+ 'amount' => '-' . round( $amount, $decimals ),
440
  );
441
  }
442
 
605
 
606
  $lisum = 0;
607
 
608
+ if ( ! empty( $details['items'] ) ) {
609
+ foreach ( $details['items'] as $li => $values ) {
610
+ $lisum += $values['quantity'] * $values['amount'];
611
+ }
612
  }
613
 
614
  if ( abs( $lisum ) > 0.000001 ) {
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: automattic, woothemes, akeda, dwainm, royho, allendav, slash1andy, woosteve, spraveenitpro, mikedmoore, fernashes, shellbeezy, danieldudzic, mikaey, fullysupportedphil, dsmithweb, corsonr, bor0, zandyring
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.8.1
6
- Stable tag: 1.4.3
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -85,6 +85,10 @@ https://gist.github.com/mikejolley/ad2ecc286c9ad6cefbb7065ba6dfef48
85
 
86
  == Changelog ==
87
 
 
 
 
 
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.
2
  Contributors: automattic, woothemes, akeda, dwainm, royho, allendav, slash1andy, woosteve, spraveenitpro, mikedmoore, fernashes, shellbeezy, danieldudzic, mikaey, fullysupportedphil, dsmithweb, corsonr, bor0, zandyring
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.8.2
6
+ Stable tag: 1.4.4
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
85
 
86
  == Changelog ==
87
 
88
+ = 1.4.4 =
89
+ * Fix - PayPal error (10431).
90
+ * Fix - PHP notices.
91
+
92
  = 1.4.3 =
93
  * Fix - Refunds not working on authorize then captured transactions.
94
  * Fix - Checkout on single product available before variations are chosen.
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.4.3
7
  * Author: WooCommerce
8
  * Author URI: https://woocommerce.com
9
  * Copyright: © 2017 WooCommerce / PayPal.
@@ -11,6 +11,8 @@
11
  * License URI: http://www.gnu.org/licenses/gpl-3.0.html
12
  * Text Domain: woocommerce-gateway-paypal-express-checkout
13
  * Domain Path: /languages
 
 
14
  */
15
  /**
16
  * Copyright (c) 2017 PayPal, Inc.
@@ -25,7 +27,7 @@ if ( ! defined( 'ABSPATH' ) ) {
25
  exit; // Exit if accessed directly
26
  }
27
 
28
- define( 'WC_GATEWAY_PPEC_VERSION', '1.4.3' );
29
 
30
  /**
31
  * 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.4.4
7
  * Author: WooCommerce
8
  * Author URI: https://woocommerce.com
9
  * Copyright: © 2017 WooCommerce / PayPal.
11
  * License URI: http://www.gnu.org/licenses/gpl-3.0.html
12
  * Text Domain: woocommerce-gateway-paypal-express-checkout
13
  * Domain Path: /languages
14
+ * WC tested up to: 3.2
15
+ * WC requires at least: 2.6
16
  */
17
  /**
18
  * Copyright (c) 2017 PayPal, Inc.
27
  exit; // Exit if accessed directly
28
  }
29
 
30
+ define( 'WC_GATEWAY_PPEC_VERSION', '1.4.4' );
31
 
32
  /**
33
  * Return instance of WC_Gateway_PPEC_Plugin.