Donor Tools Java Client
donor-tools-api-java provides a Java client for the Donor Tools API
Impact Upgrade
Nonprofits often struggle with 1) constant distractions, 2) a tangled mess of data and tools that hold them back, and 3) really big ideas on the backburner. Impact Upgrade is a software and consulting company, solely focused on closing these gaps. We upgrade your impact and get you back to your mission!
Usage
Add the following Maven dependency:
<dependency>
<groupId>com.impactupgrade.integration</groupId>
<artifactId>donor-tools-api-java</artifactId>
<version>1.0.3.Final</version>
</dependency>
Code example:
import com.impactupgrade.integration.donortools.*;
...
DonorToolsClient client = new DonorToolsClient("https://[USERNAME].donortools.com", "username", "password");
// create Persona
Persona persona = new Persona();
Persona.Name name = new Persona.Name(firstName, lastName);
persona.addName(name);
Persona.Address address = new Persona.Address();
address.setStreetAddress(streetAddress);
address.setCity(city);
address.setState(state);
address.setPostalCode(zip);
persona.addAddress(address);
Persona.EmailAddress emailAddress = new Persona.EmailAddress(email);
persona.addEmailAddress(emailAddress);
personaId = donorToolsClient.create(persona);
// store the personaId for re-use
// create Donation
Donation donation = new Donation();
donation.setDonationTypeId(14); // Donor Tools built-in donation type: Online Donation
donation.setPersonaId(personaId);
donation.setSourceId(sourceId);
donation.setAmountInCents(amountInCents);
donation.setMemo("This is a test.");
// Splits allow you to split a single donation up into multiple target funds.
Donation.Split split = new Donation.Split();
split.setAmountInCents(splitAmountInCents);
split.setFundId(fundId);
donation.addSplit(split);
donorToolsClient.create(donation);
// list all Personas
List<Persona> personas = client.listPersonas();
How to Deploy a Snapshot
- Add the following to ~/.m2/settings.xml
<server>
<id>ossrh</id>
<username>USERNAME</username>
<password>PASSWORD</password>
</server>
- mvn clean deploy
How to Deploy a Release
- Add the following to ~/.m2/settings.xml
<server>
<id>ossrh</id>
<username>USERNAME</username>
<password>PASSWORD</password>
</server>
- mvn versions:set -DnewVersion=1.2.3.Final
- git add .
- git commit -m "1.2.3.Final release"
- git tag 1.2.3.Final
- mvn clean deploy -P release
- mvn versions:set -DnewVersion=1.2.4-SNAPSHOT
- git add .
- git commit -m "1.2.4-SNAPSHOT"
- git push origin master 1.2.3.Final
License
Licensed under the Apache License, Version 2.0. See LICENSE-2.0.txt for more information.