Last active
August 29, 2015 14:05
-
-
Save chadokruse/d412e0f7d35a3cd86121 to your computer and use it in GitHub Desktop.
Meteor + Dwolla :: Client-side example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template name="dwolla"> | |
<div id="js-dwolla"></div> | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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