strangerstudios / pmpro-donations

Allow customers to set an additional donation amount at checkout with Paid Memberships Pro.
https://www.paidmembershipspro.com/add-ons/donations-add-on/
8 stars 17 forks source link

Fixing donation not being added to PPE #63

Closed dparker1005 closed 1 year ago

dparker1005 commented 1 year ago

All Submissions:

Changes proposed in this Pull Request:

In the last update, we stopped storing donation amounts in $_SESSION. This appeared to work ok (correct amount shown in PayPal Express checkout UI and in PMPro orders), but in reality, the donation amount was not actually being charged when you look at the completed transactions in PayPal. This is due to how our confirmation step works after a PayPal express session is completed.

This PR fixes that issue by pulling the donation amount that the user chose out of the PMPro order when performing the PPE confirmation step to ensure that we are "confirming" the correct amount (level cost + donation).

Resolves XXX.

How to test the changes in this Pull Request:

  1. Set up Donations Add On
  2. Set up PPE
  3. Check out for level with donation via PPE
  4. Look at completed transaction in PPE. See that before PR, amount without donation shows. With PR, correct amount shows.

Other information:

Changelog entry

Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.