Skip to content

Instantly share code, notes, and snippets.

View johndellavecchia's full-sized avatar

John Della Vecchia johndellavecchia

View GitHub Profile
@johndellavecchia
johndellavecchia / mandrill-send.js
Last active December 2, 2016 14:12
Mandrill API send with multiple attachment file input
// uses FileReader, which is not supported on older browsers
// define the files
var files = $('#fileInputID')[0].files, count = files.length;
// file input validation, only if we actually have files
if (count)
{
// create an array for the final attachment object values
@johndellavecchia
johndellavecchia / Stripe-Checkout-PHP.md
Last active June 15, 2018 10:09
Stripe Checkout v2 PHP donation example

Stripe Checkout with Variable Donation Amount

This example uses techniques to implement a donation page with Stripe Checkout and PHP. It includes a variable amount input, quick-add amount buttons, basic form validation, ajax card charge, error handling on the response, UI for processing during submission, and ARIA accessibility enhancements.

ExpressionEngine Notes

If you use ExpressionEngine, make sure to include CSRF in your form and ajax post:

Add a hidden input to the form: