<commit_before>blueRidgeApp.controller('CartCtrl',['$scope','$route','$routeParams','$location','Auth','Restangular','$cookieStore',function ProfileCtrl($scope,$location,$route,$routeParams,Auth,Restangular,$cookieStore){
    if (!Auth.isSignedIn()) {
        $location.path('/');
    }
    $scope.cart = $route;
    var safeApply = function safeApply(fn) {
        if($scope.$$phase || $scope.$root.$$phase){
            fn();
        }else{
            $scope.$apply(fn);
        }
    };    

    blueRidgeUser = Restangular.one('users',Auth.currentUser());
    $scope.user = blueRidgeUser.get();

    var blueRidgeUserSubscription = Restangular.copy(blueRidgeUser);

    var subscriber = blueRidgeUser.one('subscription').get().then(function(result){
        $scope.subscription=result.subscription;    
    });

    $scope.paymentMethodIsSet =function paymentMethodisSet (){        
        if(typeof $scope.subscription !== 'undefined' && $scope.subscription.payment){
            return true;
        }
        return false;
    };


    Restangular.one('services','cashier').get().then(function(stripe){
        $scope.stripe = stripe;
    });

    $scope.addPayment = function addPayment(token) {
        $scope.subscription={payment:token};
        $scope.$apply();
    };
<commit_msg>-n  Merge branch 'feature/stripe-part-deuce' of https://github.com/jcornelius/blueridgeapp into dev-ui<commit_after>blueRidgeApp.controller('CartCtrl',['$scope','$route','$routeParams','$location','Auth','Restangular','$cookieStore',function ProfileCtrl($scope,$location,$route,$routeParams,Auth,Restangular,$cookieStore){
    if (!Auth.isSignedIn()) {
        $location.path('/');
    }
    $scope.cart = $route;
    var safeApply = function safeApply(fn) {
        if($scope.$$phase || $scope.$root.$$phase){
            fn();
        }else{
            $scope.$apply(fn);
        }
    };


    blueRidgeUser = Restangular.one('users',Auth.currentUser());
    $scope.user = blueRidgeUser.get();
    $scope.subscription = {};
    
    var blueRidgeUserSubscription = Restangular.copy(blueRidgeUser);
    var subscriber = blueRidgeUser.one('subscription').get().then(function(result){
        $scope.subscription=result.subscription;    
    });
    $scope.paymentMethodIsSet =function paymentMethodisSet (){        
        
        if(_.isEmpty($scope.subscription.payment)){
            return false;
        }
        return true;
    };


    Restangular.one('services','cashier').get().then(function(stripe){
        $scope.stripe = stripe;
    });

    $scope.addPayment = function addPayment(token) {
        $scope.subscription={payment:token};
        $scope.$apply();
    };

{'fraction_non_alphanumeric': 0.1674123788217748, 'fraction_numerical': 0.0, 'mean_word_length': 3.1276923076923078, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2221390', 'n_tokens_mistral': 789, 'n_tokens_neox': 777, 'n_words': 97}