Skip to content

Instantly share code, notes, and snippets.

@chadokruse
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chadokruse/d412e0f7d35a3cd86121 to your computer and use it in GitHub Desktop.
Save chadokruse/d412e0f7d35a3cd86121 to your computer and use it in GitHub Desktop.
Meteor + Dwolla :: Client-side example
<template name="dwolla">
<div id="js-dwolla"></div>
</template>
Template.dwolla.rendered = function() {
//Define where to insert the script
var insertID = document.getElementById('js-dwolla');
//Define the script itself
var script = document.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.src = 'https://www.dwolla.com/scripts/button.min.js';
script.className = 'dwolla_button';
script.setAttribute('data-key', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
script.setAttribute('data-redirect', 'https://www.example.com/thanks');
script.setAttribute('data-label', 'Contribute using Dwolla');
script.setAttribute('data-name', 'Kyn - Series Awesome');
script.setAttribute('data-description', 'undefined');
script.setAttribute('data-amount', '2500');
script.setAttribute('data-type', 'freetype');
//Generate the script
insertID.appendChild(script);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment