7/10/2012

Donation Buttons Gadget

I spent some time today to put two popular payment processing services' -- Google Wallet/Checkout and PayPal -- donation buttons together: this will hopefully capture a wider stream of donation by providing more convenience to my readers.

The gadget validates the donation amount (with friendly responses to errors) before submitting them to respective services. It also tracks button clicks with Google analytics event tracking (with the two payment services differentiated by labels).

The HTML/Javascript source code is hosted at https://gist.github.com/3082002. The gadget looks like the one here in the sidebar. You can copy and paste it into your blog or website (the instruction is given in comments). Before you can accept Google checkout donation from the gadget, you also need to uncheck "My company will only post digitally signed carts." at your Google merchant account's settings>integration setup page.
The donation gadget should look like this.
If you like it, you can always buy me a coffee. Leave me a comment if you have a question or suggestion.

(Check out the error messages by typing in "abc", "0.5", and "999" in the donation gadget before you go. Let me know if you have better ideas for the messages.)