A simple donation form powered by Stripe that allows users to make one-time and monthly donations
- Customers can donate one time or monthly
- Card information passes directly from the client browser to Stripe and not through your own webserver, reducing extra security obligations
- Accessible and semantic markup that is ready to style and integrate into your theme or website
- Action hooks to capture info about the customer and the transaction for automated emails, integrations with third-party apps, etc.
- Options for which fields to include as well as which ones to require
- Options for preset donation amounts, no preset amounts, custom amounts, etc.
- Toggle for Stripe test mode so you can see it working in Stripe before going live
- Currency options and internationalization support
The form can be included with either a shortcode:
[simple-donations-stripe-form]
Or a function call:
<?php SimpleDonationsStripe::form(); ?>
Function call with options to override global settings:
<?php
SimpleDonationsStripe::form( [
'success_message' => 'Foo',
'require_phone' => false,
] );
?>
This project includes configurations for running a local dev server with WordPress
and MySQL via Docker. The following steps will create
and boot up the dev server with a WordPress site accessible at localhost:8080
.
-
Install Docker.
-
Make sure you're in the root of the project directory and run
docker-compose up -d
or
docker-compose up
if you don't want it to run in the background.
-
Install JS and PHP dependencies by running
npm install; npm run composer-setup
. -
Set up the fresh WordPress installation with
npm run wp-setup
. -
Build assets by running
gulp
; -
Now you can access the site at at http://localhost:8080. WordPress admin username/password are
admin
/admin
If you ever need to access the WordPress server or MySQL server in Docker, use
docker exec -it <container-name> bash
where the <container-name>
is the name of the Docker container. These default
to stripe_donation_form_wp
and stripe_donation_form_db
for the WordPress and MySQL
containers respectively.
In order to get currency formatting to work on the test server, one must manually choose locales to install. It doesn't come with any. First, log into the WordPress container with docker exec -it stripe_donation_form_wp bash
. Once inside, run dpkg-reconfigure locales
and follow the prompts to choose appropriate locales.
To package and ship the plugin, make sure to build the static assets with the --production
flag, and then run gulp zip
, and it will create a zip file of the plugin folder under dist
.
Get the production version at the plugin's wordpress.org page _____
If you want to contribute a translation:
- Use the
.pot
file (plugin/languages/simple-donations-stripe.pot
) and a tool like Poedit or Loco Translate to make translations - Save the resulting .po and .mo files in the
plugin/languages
directory - Create a pull request for the translation