MozillaFoundation / donate-wagtail

[Legacy] - Wagtail based donation stack
Mozilla Public License 2.0
42 stars 22 forks source link

Paypal payments of $5 return error on Mofo Staging Site #1732

Closed danielfmiranda closed 4 months ago

danielfmiranda commented 1 year ago

Description

When trying to make a $5 paypal donation on the Mozilla Foundation donate staging site, the following error gets returned on the front end:

Screenshot 2023-02-01 at 11-03-55 Page title test Donate to Mozilla

The following error also gets returned in the backend logs:

Failed Braintree transaction: PayPal buyer account can't be the same as the seller account

This error only occurs on the Mozilla Foundation donate staging site, and not on the Thunderbird staging site or localhost dev sites (when using the env file found in 1password).

Braintree Env Variables

If I had to guess, the ones most likely causing this bug are BRAINTREE_MERCHANT_ACCOUNTS or BRAINTREE_MERCHANT_ACCOUNTS_PAYPAL_MICRO.

This is because when I had BRAINTREE_MERCHANT_ACCOUNTS_PAYPAL_MICRO=usd=... set to the one used in thunderbird, I was able to make a $5 donation successfully.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://donate-wagtail.mofostaging.net/en-US/
  2. Click on "Monthly" and select $5 USD
  3. Click the blue "Paypal" button, and log in using the Paypal credentials found in 1Password.
  4. Attempt to make the donation

Expected behavior

The test donation should go through, and take redirect you to the thank you page.

tbrlpld commented 1 year ago

I think the solution would be to have a separate account to make the testing PayPal donations with that is not the merchant account.

Why we did not run into this earlier and why it does not surface for one-time donation and other monthly donations is a mystery though

tbrlpld commented 1 year ago

https://developer.paypal.com/tools/sandbox/accounts/

Looks like we've been using the wrong account to make the test donations for a while.