paypal: conslidate buy gems modals

This commit is contained in:
Tyler Renelle
2013-10-12 16:47:49 -07:00
parent 09cd132420
commit 5de0c928fe
11 changed files with 50 additions and 52 deletions

View File

@@ -42,25 +42,24 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
}
$rootScope.showStripe = function() {
var disableAds = User.user.flags.ads == 'hide' ? '' : 'Disable Ads, ';
StripeCheckout.open({
key: window.env.STRIPE_PUB_KEY,
address: false,
amount: 500,
name: "Checkout",
description: "Buy 20 Gems, " + disableAds + "Support the Developers",
panelLabel: "Checkout",
token: function(data) {
$scope.$apply(function(){
$http.post("/api/v1/user/buy-gems", data)
.success(function() {
window.location.href = "/";
}).error(function(err) {
alert(err);
});
})
}
});
StripeCheckout.open({
key: window.env.STRIPE_PUB_KEY,
address: false,
amount: 500,
name: "Checkout",
//description: "Buy 20 Gems, Disable Ads, Support the Developers",
panelLabel: "Checkout",
token: function(data) {
$scope.$apply(function(){
$http.post("/api/v1/user/buy-gems", data)
.success(function() {
window.location.href = "/";
}).error(function(err) {
alert(err);
});
})
}
});
}
}
]);