Easy Digital Downloads - Version 2.9.11

Version Description

Download this release

Release Info

Developer cklosows
Plugin Icon 128x128 Easy Digital Downloads
Version 2.9.11
Comparing to
See all releases

Code changes from version 2.9.10 to 2.9.11

easy-digital-downloads.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: The easiest way to sell digital products with WordPress.
6
  * Author: Easy Digital Downloads
7
  * Author URI: https://easydigitaldownloads.com
8
- * Version: 2.9.10
9
  * Text Domain: easy-digital-downloads
10
  * Domain Path: languages
11
  *
@@ -25,7 +25,7 @@
25
  * @package EDD
26
  * @category Core
27
  * @author Pippin Williamson
28
- * @version 2.9.10
29
  */
30
 
31
  // Exit if accessed directly.
@@ -206,7 +206,7 @@ final class Easy_Digital_Downloads {
206
 
207
  // Plugin version.
208
  if ( ! defined( 'EDD_VERSION' ) ) {
209
- define( 'EDD_VERSION', '2.9.10' );
210
  }
211
 
212
  // Plugin Folder Path.
5
  * Description: The easiest way to sell digital products with WordPress.
6
  * Author: Easy Digital Downloads
7
  * Author URI: https://easydigitaldownloads.com
8
+ * Version: 2.9.11
9
  * Text Domain: easy-digital-downloads
10
  * Domain Path: languages
11
  *
25
  * @package EDD
26
  * @category Core
27
  * @author Pippin Williamson
28
+ * @version 2.9.11
29
  */
30
 
31
  // Exit if accessed directly.
206
 
207
  // Plugin version.
208
  if ( ! defined( 'EDD_VERSION' ) ) {
209
+ define( 'EDD_VERSION', '2.9.11' );
210
  }
211
 
212
  // Plugin Folder Path.
includes/gateways/paypal-standard.php CHANGED
@@ -609,6 +609,19 @@ function edd_process_paypal_web_accept_and_cart( $data, $payment_id ) {
609
 
610
  }
611
 
 
 
 
 
 
 
 
 
 
 
 
 
 
612
  if ( $payment_status == 'refunded' || $payment_status == 'reversed' ) {
613
 
614
  // Process a refund
@@ -947,13 +960,31 @@ function edd_paypal_process_pdt_on_return() {
947
  $data[ urldecode( $parsed_line[0] ) ] = urldecode( $parsed_line[1] );
948
  }
949
 
950
- if ( ! isset( $data['payment_gross'] ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
951
 
952
  edd_debug_log( 'Attempt to verify PayPal payment with PDT failed due to payment total missing' );
953
- $payment->add_note( __( 'Payment failed while validating PayPal PDT. Missing payment_gross.', 'easy-digital-downloads' ) );
954
- $payment->status = 'failed';
955
 
956
- } elseif ( (float) $data['payment_gross'] < (float) $payment->total ) {
957
 
958
  /**
959
  * Here we account for payments that are less than the expected results only. There are times that
609
 
610
  }
611
 
612
+ if( empty( $customer ) ) {
613
+
614
+ $customer = new EDD_Customer( $payment->customer_id );
615
+
616
+ }
617
+
618
+ // Record the payer email on the EDD_Customer record if it is different than the email entered on checkout
619
+ if( ! empty( $data['payer_email'] ) && ! in_array( strtolower( $data['payer_email'] ), array_map( 'strtolower', $customer->emails ) ) ) {
620
+
621
+ $customer->add_email( strtolower( $data['payer_email'] ) );
622
+
623
+ }
624
+
625
  if ( $payment_status == 'refunded' || $payment_status == 'reversed' ) {
626
 
627
  // Process a refund
960
  $data[ urldecode( $parsed_line[0] ) ] = urldecode( $parsed_line[1] );
961
  }
962
 
963
+ if ( isset( $data['mc_gross'] ) ) {
964
+
965
+ $total = $data['mc_gross'];
966
+
967
+ } else if ( isset( $data['payment_gross'] ) ) {
968
+
969
+ $total = $data['payment_gross'];
970
+
971
+ } else if ( isset( $_REQUEST['amt'] ) ) {
972
+
973
+ $total = $_REQUEST['amt'];
974
+
975
+ } else {
976
+
977
+ $total = null;
978
+
979
+ }
980
+
981
+ if ( is_null( $total ) ) {
982
 
983
  edd_debug_log( 'Attempt to verify PayPal payment with PDT failed due to payment total missing' );
984
+ $payment->add_note( __( 'Payment could not be verified while validating PayPal PDT. Missing payment total fields.', 'easy-digital-downloads' ) );
985
+ $payment->status = 'pending';
986
 
987
+ } elseif ( (float) $total < (float) $payment->total ) {
988
 
989
  /**
990
  * Here we account for payments that are less than the expected results only. There are times that
languages/easy-digital-downloads.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the Easy Digital Downloads package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Easy Digital Downloads 2.9.10\n"
6
  "Report-Msgid-Bugs-To: https://easydigitaldownloads.com/\n"
7
- "POT-Creation-Date: 2019-01-04 21:24:46+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -6575,8 +6575,8 @@ msgstr ""
6575
  #: includes/gateways/paypal-standard.php:469
6576
  #: includes/gateways/paypal-standard.php:558
6577
  #: includes/gateways/paypal-standard.php:568
6578
- #: includes/gateways/paypal-standard.php:628
6579
- #: includes/gateways/paypal-standard.php:637
6580
  msgid "IPN Error"
6581
  msgstr ""
6582
 
@@ -6755,23 +6755,23 @@ msgstr ""
6755
  msgid "Payment failed due to invalid currency in PayPal IPN."
6756
  msgstr ""
6757
 
6758
- #: includes/gateways/paypal-standard.php:628
6759
  msgid "Invalid payment amount in IPN response. IPN data: %s"
6760
  msgstr ""
6761
 
6762
- #: includes/gateways/paypal-standard.php:631
6763
  msgid "Payment failed due to invalid amount in PayPal IPN."
6764
  msgstr ""
6765
 
6766
- #: includes/gateways/paypal-standard.php:637
6767
  msgid "Invalid purchase key in IPN response. IPN data: %s"
6768
  msgstr ""
6769
 
6770
- #: includes/gateways/paypal-standard.php:639
6771
  msgid "Payment failed due to invalid purchase key in PayPal IPN."
6772
  msgstr ""
6773
 
6774
- #: includes/gateways/paypal-standard.php:645
6775
  #: tests/helpers/class-helper-payment.php:131
6776
  #: tests/helpers/class-helper-payment.php:234
6777
  #: tests/helpers/class-helper-payment.php:342
@@ -6782,97 +6782,99 @@ msgstr ""
6782
  msgid "PayPal Transaction ID: %s"
6783
  msgstr ""
6784
 
6785
- #: includes/gateways/paypal-standard.php:659
6786
  msgid "Payment made via eCheck and will clear automatically in 5-8 days"
6787
  msgstr ""
6788
 
6789
- #: includes/gateways/paypal-standard.php:666
6790
  msgid ""
6791
  "Payment requires a confirmed customer address and must be accepted manually "
6792
  "through PayPal"
6793
  msgstr ""
6794
 
6795
- #: includes/gateways/paypal-standard.php:672
6796
  msgid ""
6797
  "Payment must be accepted manually through PayPal due to international "
6798
  "account regulations"
6799
  msgstr ""
6800
 
6801
- #: includes/gateways/paypal-standard.php:678
6802
  msgid ""
6803
  "Payment received in non-shop currency and must be accepted manually through "
6804
  "PayPal"
6805
  msgstr ""
6806
 
6807
- #: includes/gateways/paypal-standard.php:685
6808
  msgid ""
6809
  "Payment is being reviewed by PayPal staff as high-risk or in possible "
6810
  "violation of government regulations"
6811
  msgstr ""
6812
 
6813
- #: includes/gateways/paypal-standard.php:691
6814
  msgid "Payment was sent to non-confirmed or non-registered email address."
6815
  msgstr ""
6816
 
6817
- #: includes/gateways/paypal-standard.php:697
6818
  msgid "PayPal account must be upgraded before this payment can be accepted"
6819
  msgstr ""
6820
 
6821
- #: includes/gateways/paypal-standard.php:703
6822
  msgid ""
6823
  "PayPal account is not verified. Verify account in order to accept this "
6824
  "payment"
6825
  msgstr ""
6826
 
6827
- #: includes/gateways/paypal-standard.php:709
6828
  msgid ""
6829
  "Payment is pending for unknown reasons. Contact PayPal support for "
6830
  "assistance"
6831
  msgstr ""
6832
 
6833
- #: includes/gateways/paypal-standard.php:762
6834
  msgid "Partial PayPal refund processed: %s"
6835
  msgstr ""
6836
 
6837
- #: includes/gateways/paypal-standard.php:767
6838
  msgid "PayPal Payment #%s Refunded for reason: %s"
6839
  msgstr ""
6840
 
6841
- #: includes/gateways/paypal-standard.php:768
6842
  msgid "PayPal Refund Transaction ID: %s"
6843
  msgstr ""
6844
 
6845
- #: includes/gateways/paypal-standard.php:953
6846
- msgid "Payment failed while validating PayPal PDT. Missing payment_gross."
 
 
6847
  msgstr ""
6848
 
6849
- #: includes/gateways/paypal-standard.php:964
6850
  msgid ""
6851
  "Payment failed while validating PayPal PDT. Amount expected: %f. Amount "
6852
  "Received: %f"
6853
  msgstr ""
6854
 
6855
- #: includes/gateways/paypal-standard.php:994
6856
  msgid "Payment failed while validating PayPal PDT."
6857
  msgstr ""
6858
 
6859
- #: includes/gateways/paypal-standard.php:1001
6860
  msgid "PayPal PDT encountered an unexpected result, payment set to pending"
6861
  msgstr ""
6862
 
6863
- #: includes/gateways/paypal-standard.php:1086
6864
  msgid "Refund Payment in PayPal"
6865
  msgstr ""
6866
 
6867
- #: includes/gateways/paypal-standard.php:1233
6868
  msgid "PayPal refund failed for unknown reason."
6869
  msgstr ""
6870
 
6871
- #: includes/gateways/paypal-standard.php:1243
6872
  msgid "PayPal refund transaction ID: %s"
6873
  msgstr ""
6874
 
6875
- #: includes/gateways/paypal-standard.php:1247
6876
  msgid "PayPal refund failed: %s"
6877
  msgstr ""
6878
 
2
  # This file is distributed under the same license as the Easy Digital Downloads package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Easy Digital Downloads 2.9.11\n"
6
  "Report-Msgid-Bugs-To: https://easydigitaldownloads.com/\n"
7
+ "POT-Creation-Date: 2019-01-06 16:30:56+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
6575
  #: includes/gateways/paypal-standard.php:469
6576
  #: includes/gateways/paypal-standard.php:558
6577
  #: includes/gateways/paypal-standard.php:568
6578
+ #: includes/gateways/paypal-standard.php:641
6579
+ #: includes/gateways/paypal-standard.php:650
6580
  msgid "IPN Error"
6581
  msgstr ""
6582
 
6755
  msgid "Payment failed due to invalid currency in PayPal IPN."
6756
  msgstr ""
6757
 
6758
+ #: includes/gateways/paypal-standard.php:641
6759
  msgid "Invalid payment amount in IPN response. IPN data: %s"
6760
  msgstr ""
6761
 
6762
+ #: includes/gateways/paypal-standard.php:644
6763
  msgid "Payment failed due to invalid amount in PayPal IPN."
6764
  msgstr ""
6765
 
6766
+ #: includes/gateways/paypal-standard.php:650
6767
  msgid "Invalid purchase key in IPN response. IPN data: %s"
6768
  msgstr ""
6769
 
6770
+ #: includes/gateways/paypal-standard.php:652
6771
  msgid "Payment failed due to invalid purchase key in PayPal IPN."
6772
  msgstr ""
6773
 
6774
+ #: includes/gateways/paypal-standard.php:658
6775
  #: tests/helpers/class-helper-payment.php:131
6776
  #: tests/helpers/class-helper-payment.php:234
6777
  #: tests/helpers/class-helper-payment.php:342
6782
  msgid "PayPal Transaction ID: %s"
6783
  msgstr ""
6784
 
6785
+ #: includes/gateways/paypal-standard.php:672
6786
  msgid "Payment made via eCheck and will clear automatically in 5-8 days"
6787
  msgstr ""
6788
 
6789
+ #: includes/gateways/paypal-standard.php:679
6790
  msgid ""
6791
  "Payment requires a confirmed customer address and must be accepted manually "
6792
  "through PayPal"
6793
  msgstr ""
6794
 
6795
+ #: includes/gateways/paypal-standard.php:685
6796
  msgid ""
6797
  "Payment must be accepted manually through PayPal due to international "
6798
  "account regulations"
6799
  msgstr ""
6800
 
6801
+ #: includes/gateways/paypal-standard.php:691
6802
  msgid ""
6803
  "Payment received in non-shop currency and must be accepted manually through "
6804
  "PayPal"
6805
  msgstr ""
6806
 
6807
+ #: includes/gateways/paypal-standard.php:698
6808
  msgid ""
6809
  "Payment is being reviewed by PayPal staff as high-risk or in possible "
6810
  "violation of government regulations"
6811
  msgstr ""
6812
 
6813
+ #: includes/gateways/paypal-standard.php:704
6814
  msgid "Payment was sent to non-confirmed or non-registered email address."
6815
  msgstr ""
6816
 
6817
+ #: includes/gateways/paypal-standard.php:710
6818
  msgid "PayPal account must be upgraded before this payment can be accepted"
6819
  msgstr ""
6820
 
6821
+ #: includes/gateways/paypal-standard.php:716
6822
  msgid ""
6823
  "PayPal account is not verified. Verify account in order to accept this "
6824
  "payment"
6825
  msgstr ""
6826
 
6827
+ #: includes/gateways/paypal-standard.php:722
6828
  msgid ""
6829
  "Payment is pending for unknown reasons. Contact PayPal support for "
6830
  "assistance"
6831
  msgstr ""
6832
 
6833
+ #: includes/gateways/paypal-standard.php:775
6834
  msgid "Partial PayPal refund processed: %s"
6835
  msgstr ""
6836
 
6837
+ #: includes/gateways/paypal-standard.php:780
6838
  msgid "PayPal Payment #%s Refunded for reason: %s"
6839
  msgstr ""
6840
 
6841
+ #: includes/gateways/paypal-standard.php:781
6842
  msgid "PayPal Refund Transaction ID: %s"
6843
  msgstr ""
6844
 
6845
+ #: includes/gateways/paypal-standard.php:984
6846
+ msgid ""
6847
+ "Payment could not be verified while validating PayPal PDT. Missing payment "
6848
+ "total fields."
6849
  msgstr ""
6850
 
6851
+ #: includes/gateways/paypal-standard.php:995
6852
  msgid ""
6853
  "Payment failed while validating PayPal PDT. Amount expected: %f. Amount "
6854
  "Received: %f"
6855
  msgstr ""
6856
 
6857
+ #: includes/gateways/paypal-standard.php:1025
6858
  msgid "Payment failed while validating PayPal PDT."
6859
  msgstr ""
6860
 
6861
+ #: includes/gateways/paypal-standard.php:1032
6862
  msgid "PayPal PDT encountered an unexpected result, payment set to pending"
6863
  msgstr ""
6864
 
6865
+ #: includes/gateways/paypal-standard.php:1117
6866
  msgid "Refund Payment in PayPal"
6867
  msgstr ""
6868
 
6869
+ #: includes/gateways/paypal-standard.php:1264
6870
  msgid "PayPal refund failed for unknown reason."
6871
  msgstr ""
6872
 
6873
+ #: includes/gateways/paypal-standard.php:1274
6874
  msgid "PayPal refund transaction ID: %s"
6875
  msgstr ""
6876
 
6877
+ #: includes/gateways/paypal-standard.php:1278
6878
  msgid "PayPal refund failed: %s"
6879
  msgstr ""
6880
 
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link: https://easydigitaldownloads.com/donate/
6
  Tags: download, downloads, e-store, eshop, digital downloads, e-commerce, wp-ecommerce, wp ecommerce, ecommerce, ebook
7
  Requires at least: 4.4
8
  Tested up to: 5.0.2
9
- Stable Tag: 2.9.10
10
  License: GNU Version 2 or Any Later Version
11
 
12
  The easiest way to sell digital products with WordPress.
@@ -189,6 +189,10 @@ Yes. Easy Digital Downloads also includes default support for Amazon Payments an
189
 
190
  == Changelog ==
191
 
 
 
 
 
192
  = 2.9.10, January 4, 2019 =
193
  * Security Fix: Avoid a possible PayPal Standard price manipulation when using PDT (Payment Data Transfer)
194
 
6
  Tags: download, downloads, e-store, eshop, digital downloads, e-commerce, wp-ecommerce, wp ecommerce, ecommerce, ebook
7
  Requires at least: 4.4
8
  Tested up to: 5.0.2
9
+ Stable Tag: 2.9.11
10
  License: GNU Version 2 or Any Later Version
11
 
12
  The easiest way to sell digital products with WordPress.
189
 
190
  == Changelog ==
191
 
192
+ = 2.9.11, January 6, 2019 =
193
+ * Fix: PayPal PDT amount validation fails for some accounts due to missing payment_gross field.
194
+ * Tweak: PayPal email address now registered to EDD_Customer during IPN processing if the email is not already registered.
195
+
196
  = 2.9.10, January 4, 2019 =
197
  * Security Fix: Avoid a possible PayPal Standard price manipulation when using PDT (Payment Data Transfer)
198