Donate Fast Script

Donate Fast is a javascript for Donate Fast Craft Plugin for donation form.

New Features!

Tech

Donate Fast uses a number of open source projects to work properly:

Installation

Donate Fast requires jQuery to work properly.

Install the dependencies and devDependencies and start the server.

<script id="donate-fast-script" src="donate-fast.js"
            data-stripe-public-key="pk_test_uBbZUnxUMQ8BPLLMI2aSCoct"
            data-stripe-form-name="Donation"
            data-stripe-form-description="One-time donation"
            data-form-id="donate-fast-form"
            data-btn-id="donate-btn"
            data-amount-min="5"
            data-amount-input-id="amount"
            data-project-id="1"
            data-project-name="name"></script>

For production environments...

<script id="donate-fast-script" src="donate-fast.min.js"
            data-stripe-public-key="pk_test_uBbZUnxUMQ8BPLLMI2aSCoct"
            data-stripe-form-name="Donation"
            data-stripe-form-description="One-time donation"
            data-form-id="donate-fast-form"
            data-btn-id="donate-btn"
            data-amount-min="5"
            data-amount-input-id="amount"
            data-project-id="1"
            data-project-name="name"></script>

### Properties Let's take a look at available attributes to comminicate with Donate Fast JavaScript library more detailed:

data-stripe-public-key*

Required! It's your public key from stripe account. Example:

<script id="donate-fast-script" src="donate-fast.js"
    data-stripe-public-key="test-stripe-public-key">
</script>
data-form-id*

Required! It's your form in the html with method and action attributes. Anyway, you should put form id into this attribute. Example:

<form id="donate-fast-form" action="/donate-fast/donate" method="post">
    <button id="donate-btn" class="btn">Donate</button>
</form>
data-btn-id*

Required! You have to add button id as attribute to the script that you've added to the form. Example:

<form id="donate-fast-form" action="/donate-fast/donate" method="post">
    <button id="donate-btn" class="btn">Donate</button>
</form>
<script id="donate-fast-script" src="donate-fast.js"
    data-btn-id="donate-btn">
</script>
data-amount-input-id*

Required! It's field where user will type amount of money

<form id="donate-fast-form" action="/donate-fast/donate" method="post">
    <input id="amount" name="amount" type="number" min="5">
    <button id="donate-btn" class="btn">Donate</button>
</form>
<script id="donate-fast-script" src="donate-fast.js"
    data-amount-input-id="amount">
</script>
data-amount-min (optional)

Not Required. if you want to make sure user won't input less than your defined amount of money.

<script id="donate-fast-script" src="donate-fast.js"
    data-amount-min="5">
</script>

Min amount is 5 dollars.

data-project-id, data-project-name (optional)

Not Required. For you to understand what project user donates.

<script id="donate-fast-script" src="donate-fast.js"
    data-project-id="32"
    data-project-name="For poor people in Congo">
</script>
data-stripe-form-name (optional)

Not required. Name of the stripe form. Default value: 'Donation'

data-stripe-form-description (optional)

Not Required. Description of the stripe form. Default value: 'One-time donation.'

Have a problem? Have an idea?

Great! Write to us!