Takes an object to submit an automated ACLU donation form.
JavaScript
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
data
test
.gitignore
.prettierrc.json
.snyk
.travis.yml
LICENSE
README.md
constants.js
index.js
package.json

README.md

donate-to-aclu Travis status

Takes an object to submit an automated ACLU donation form.

Security

  • no database at all
  • open source
  • as many validation checks as I can make before submitting to ACLU

Required Fields

Field Format Example
firstname string Casey
lastname string Doe
address string 123 Rainbow Lane
zipcode string 12345
cc_number str/num no spaces, just numbers
cc_exp xx/xx Month/Year
cc_code xxx number or string
amount xx.xx ACLU only takes donations of $5 or more. Code strips all but numbers, period, comma; parseFloat; round down to 2 cent digits

Optional Fields

Field Format Default
fullname string Casey Doe (can be used in place of firstname and lastname)
email string crhallberg+acluapi@gmail.com
city string (determined by zipcode if absent)
state string (determined by zipcode if absent)
country_code str/num 840 (US) - ISO_3166-1 country code
get_updates boolean false
share_info boolean false

Example

const aclu = require('donate-to-aclu');

const fields = { /* ... */ };

if (aclu.validate(fields)) {
  aclu.submit(fields);
}

Powered By