How to Use the Shortcode

The most basic example to use is simply:

[stripe_donate]

To test the donation process simple pass: mode=”test”

[stripe_donate mode="test"]

 

All Parameters Explained

Here is a breakdown of all the attributes you can pass through the shortcode.


 

id=””

You can specify an id to distinguish between multiple buttons on a single page. This also gives you a custom CSS wrapper element of id=”hg-stripe-donate-form-{$id}” that can be used to customize the look. Please make your IDS with no spaces. For example: id=”undervideobutton”


 

image=”https://url-to-image.jpg”

You can change the Stripe Checkout image icon on a per donation box basis. The default pulls from your settings in ‘Settings -> Stripe Donation’ If nothing is set it will not show anything, this can also be accomplished with image=”false”


 

layout=”user-amount”

Used to specify the layout used. The default is ‘user-amount’ which allows the users to specify their amount. Other options include: ‘exact’ and the filename for your custom file in your theme. If you specify layout=”donate-wide” It will look in your them folder for a file called donate-wide.php and use that as it’s template. More information about custom layouts can be found here.


 

checkout_label=”Donate {{amount}}”

This is the button at the bottom of the Stripe Popup that normally says  ‘Buy Now $5’ The default is ‘Donate {{amount}}’ where the {{amount}} is replaced with the actually value being donated. You can use that same {{amount}} in your text to include it.


 

button_label=”Donate”

This is the button that appears on your site to initiate the click to the Stripe Popup. Default: ‘Donate’


 

remember=”false”

Specify whether to include the option to “Remember Me” for future purchases (true or false). The default is false. It has been my experience with users that they don’t understand this and it seems a bit “scary” to be remembered, so since this is just a donation plugin I have set this to false by default.


 

zipcode=”false”

Specify whether Checkout should validate the billing ZIP code (true or false). The default is false.


 

amount=”500″

Value in pennies of the default donation amount. If using the basic template this will set the default amount in the text field to this value. The user will be able to change the amount. If using the layout=”exact” attribute this value will need to be set in order to have an exact amount to donate. The default is empty.


 

amount_element=”#hg-stripe-donate-amount-{$button_id}”

This attribute is used when created custom layouts. It specifies the element in the document to use to find our donation value.


 

user_check=”false”

If this is set to ‘true’ it will attempt to get the email address of the logged in user.


 

ssl=”true”

By default the plugin will post to an HTTPS version of your site to make the AJAX donation. You can set this to ‘false’ if for some crazy reason you don’t want that to happen. In test mode it will not automatically post to HTTPS however.