sumobi/edd-purchase-rewards — pull request #2 by mirozoo (2014-06-01 11:31:51+00:00)
Title: PayPal issue

I discovered an little issue on purchases after returning from PayPal: Although the purchases/payments had been completed, no discount codes were generated (can_reward() always returned false). If I see this right, this is because edd_complete_purchase is fired via the PayPal IPN and therefore the customer's purchase session isn't available anymore.

I modified the can_reward function to use an optional $payment_id parameter to determine the purchase amount in these cases. This did the trick for me.