MozillaFoundation / donate-wagtail

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

Pass additional information to Braintree custom fields #28

Closed solarissmoke closed 4 years ago

solarissmoke commented 5 years ago

There is a requirement to pass some additional information about transactions to Braintree in the form of custom fields.

Information required

Notes

Braintree custom fields must be set up in the Braintree dashboard before we can pass data to those fields - this means that some decisions need to be made about which fields to set up.

Braintree doesn't appear to restrict the length of data stored in a given field, so it should be possible for example to dump JSON into a single custom field. Whether to do this (vs separating data into multiple fields) depends largely on the use case - e.g., do you need the ability to filter payments based on a field using the Braintree API.

WillatMozFdn commented 5 years ago

It would be SUPREMELY helpful if we can filter a transaction in Braintree based on whether it's Thunderbird-restricted, or Mozilla Foundation unrestricted. (All of our transactions will be one of those two types.)

solarissmoke commented 5 years ago

It would be SUPREMELY helpful if we can filter a transaction in Braintree based on whether it's Thunderbird-restricted, or Mozilla Foundation unrestricted.

Is this something that varies at the campaign level? i.e., any given campaign will belong to one of these categories? If so then yeah, easy to pass the data to Braintree - we just need to add a field on the campaign to let us track this.

WillatMozFdn commented 5 years ago

@solarissmoke yes, indeed -- any given campaign, or landing page, or whatever will always be one of the two. To put it another way -- those fundraising asks (Thunderbird vs. Mozilla) are never combined (and in the data model, everything goes into the system with "Project" [field name is Project__c on the Opportunity object] equal to either "mozillafoundation" or "thunderbird".)

solarissmoke commented 5 years ago

Hi @alanmoo , other than the project described by Will above, is there anything else you would like to pass to Braintree?

alanmoo commented 5 years ago

A campaign ID string would be incredibly useful, so we can quickly see how much money has come in from a specific campaign. That does lead to the question of "how is that defined" though. We could pull the URL slug, but I'm wondering if it might make sense to add an extra string to the page model so that we can have multiple pages for the same campaign, should we want the flexibility for a base A/B functionality before we build it directly into the platform.

Other than that, it may be useful to pass along the query params as JSON.

alanmoo commented 4 years ago

We can reopen a new issue if there are more specific asks.