awesomemotive / easy-digital-downloads

Sell digital downloads through WordPress
https://easydigitaldownloads.com
GNU General Public License v2.0
868 stars 472 forks source link

Initial purchase doubles edd_earnings_total in options table #1757

Closed amdrew closed 10 years ago

amdrew commented 10 years ago

On the very first purchase, it seems edd_earnings_total in the options table is doubling the amount. Subsequent purchases are fine

Test on multiple installs, 1 fresh. EDD 1.8.5.

Download purchased was setup with a price of $100.00.

1st purchase, total changes to 200 edd_earnings_total = 200

2nd purchase edd_earnings_total = 300

3rd purchase edd_earnings_total = 400

Reports within the admin all seem to show correct. Reports will show $300 for today, exported PDF shows $300 etc

pippinsplugins commented 10 years ago

I believe this got reported a few months ago though was deemed as invalid at the time. Maybe it has always been here.

amdrew commented 10 years ago

I think thats the case, only just noticed it as I don't venture much into the options table

pippinsplugins commented 10 years ago

Confirmed.

pippinsplugins commented 10 years ago

If performing a purchase, we need to skip the very last payment in the database, since it calls edd_increase_total_earnings() on completion, which results in duplicated earnings for the very first purchase