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
var controller = { | |
action: function(){ | |
} | |
} | |
module.exports = controller; |
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
<div layout="row" layout-align="start center" class="braintree-message"> | |
<div flex="55"> | |
<p>Your credit card information will not interact with our servers.</p> | |
</div> | |
<div flex="45"> | |
<a href="https://www.braintreegateway.com/merchants/YOUR_MERCHANT_ID/verified" target="_blank"> | |
<img src="https://s3.amazonaws.com/braintree-badges/braintree-badge-wide-dark.png" width="100%" border="0" /> | |
</a> | |
</div> | |
</div> |
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
<form id="checkout" method="post" action="/checkout"> | |
<div id="payment-form"></div> | |
<input type="submit" value="Pay $10"> | |
</form> | |
<script src="https://js.braintreegateway.com/v2/braintree.js"></script> |
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
var clientToken = "TOKEN!"; | |
braintree.setup(clientToken, "dropin", { | |
container: "payment-form" | |
}); |
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
npm install express-generator -g | |
express app | |
cd app | |
npm install |
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
npm start |
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
npm install braintree --save |
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
mkdir controllers | |
mkdir controllers/test | |
cd controllers | |
touch paypal.js | |
touch test/test_paypal.js |
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
// Create the following file .bowerrc | |
{ | |
"directory" : "public/lib" | |
} | |
// Use bower to pull braintree library | |
bower install braintree-web --save |
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
var controller = { | |
getClientToken: function(callback){ | |
gateway.clientToken.generate({}, function (err, response) { | |
if(err){ | |
callback(err) | |
} | |
if(response.clientToken){ | |
callback(response.clientToken) | |
}else{ | |
callback(response) |
OlderNewer