MozillaFoundation / donate-wagtail

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

Project value for recurring donations not passing from Braintree to CRM #948

Closed stephaniemcv closed 4 years ago

stephaniemcv commented 4 years ago

Project values to differentiate if a donation transaction is for MoFo or MZLA/Tbird are not being passed from Braintree for credit card recurring donations into the CRM. Donation receipts cannot be emailed without this value.

This issue appears to have started on March 11th. There are now approx 5,200 donations missing projects.

@WillatMozFdn @stephanielowry

cadecairos commented 4 years ago

Looking into this, here's what I have so far.

I found a donor whose subscription opportunities in the CRM have no project (there are two charges so far): 0034O00002XjxXu

On Braintree they're: cus_G7k7eURUKXqk0X - As a recurring donor, the customer record should have the project custom field, but this one does not.

This is where we fetch custom fields when recieving a webhook notification of a recurring subscription charge

Looking at our payments code, our Braintree form view uses database backed sessions to store project string values. Session data is initially populated in the CardPaymentView.get_transaction_details_for_session method.

I'm out of time today but I'm looking in the right places I think.

cadecairos commented 4 years ago

I have a theory for what happened here. I need more data to confirm.

Of the few Braintree customers I've found so far that have experienced this issue, they've all got one thing in common: They were imported to BT from Stripe on November 26th. Since we're storing project as a custom field on the BT customers we create in the Wagtail card payment view, it would make sense that we see no project field on these imported records.

So, lets consider the following:

  1. Can we assume that all the customer records in Braintree/the CRM without a project are related to imported customers that had subscriptions migrated over in the webhook?
  2. If so, does that mean they're guaranteed to all be MoFo donations since we only recreated Subscriptions in Braintree that were Foundation related?

If 1 and 2 are true this might be easy to resolve.

WillatMozFdn commented 4 years ago

That explanation makes a lot of sense, @cadecairos . Give me a few examples (maybe 5-10) of people (email addresses) experiencing the problem, and I can look them up in Salesforce and tell you what percentage are known MoFo recurring donors. I bet it's 100%. (Or also, can you tell in Braintree by which merchant account is charging them? Those are all named with [MZLA] or [Mofo/Mozilla Foundation] so should be easy to attribute....)

cadecairos commented 4 years ago

Removing the critical label as we've determined this only affects recurring's brought in from Stripe, which are all MoFo donations.

We need to determine what the plan is for updating the ~6300 records this affects in the CRM

stephaniemcv commented 4 years ago

Once the fix is in place, I can do an export and bulk update all the records with the missing "mozillafoundation" value in the project field.