This file contains 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
{ | |
"public" : { | |
"env": "Sandbox", | |
"BT_MERCHANT_ID": "xxxxxxxxxxxxxxxx", | |
"BT_PUBLIC_KEY": "xxxxxxxxxxxxxxxx" | |
}, | |
"private": { | |
"BT_PRIVATE_KEY": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | |
} | |
} |
This file contains 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
// Define gateway variable | |
var gateway; | |
Meteor.startup(function () { | |
var env; | |
// Pick Braintree environment based on environment defined in Meteor settings. | |
if (Meteor.settings.public.env === 'Production') { | |
env = Braintree.Environment.Production; | |
} else { | |
env = Braintree.Environment.Sandbox; |
This file contains 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
Meteor.publish("items", function() { | |
if ( Roles.userIsInRole(this.userId, 'paid') ) { | |
return Items.find(); | |
} | |
}); |
This file contains 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.dashboard.onCreated(function() { | |
var instance = this; | |
instance.autorun(function() { | |
instance.subscribe('items'); | |
}); | |
}); | |
Template.dashboard.helpers({ | |
items: function(){ | |
return Items.find(); |
This file contains 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
<head> | |
<title>Braintree Demo</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<!-- Braintree --> | |
<script src="https://js.braintreegateway.com/v2/braintree.js"></script> | |
</head> |
This file contains 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="dashboard"> | |
<div class="template-dashboard"> | |
<div class="page-header"> | |
<h1>Dashboard</h1> | |
</div> | |
<ul class="list-group"> | |
{{#each items}} | |
<li class="list-group-item">{{ name }} <span class="label label-default">{{ rating }}</span></li> | |
{{/each}} |
This file contains 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.dashboard.onCreated(function() { | |
var instance = this; | |
instance.autorun(function() { | |
instance.subscribe('items'); | |
}); | |
}); | |
Template.dashboard.helpers({ | |
items: function(){ | |
return Items.find(); |
This file contains 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="dashboard"> | |
<div class="template-dashboard"> | |
<div class="page-header"> | |
<h1>Dashboard</h1> | |
</div> | |
{{#if showForm}} | |
<h3>Buy access to our list of items!</h3> | |
<form role="form"> |
This file contains 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.dashboard.onCreated(function() { | |
var instance = this; | |
instance.autorun(function() { | |
instance.subscribe('items'); | |
}); | |
}); | |
Template.dashboard.onRendered(function() { | |
Meteor.call('getClientToken', function(error, clientToken) { | |
if (error) { |
This file contains 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
// Define gateway variable | |
var gateway; | |
Meteor.startup(function () { | |
var env; | |
// Pick Braintree environment based on environment defined in Meteor settings. | |
if (Meteor.settings.public.env === 'Production') { | |
env = Braintree.Environment.Production; | |
} else { | |
env = Braintree.Environment.Sandbox; |
OlderNewer