Flatratekaufprozess eingebaut und vorbereitet
This commit is contained in:
@@ -17,6 +17,7 @@ angular.module('starter', ['ionic', 'ngCordova', 'starter.controllers', 'starter
|
||||
|
||||
|
||||
$rootScope.storeinit=99;
|
||||
$rootScope.flatrate=0;
|
||||
|
||||
$ionicPlatform.registerBackButtonAction(function(event) {
|
||||
|
||||
|
||||
@@ -145,8 +145,15 @@ $scope.show = function() {
|
||||
|
||||
if((window.device && device.platform == "Android") && typeof inappbilling !== "undefined") {
|
||||
|
||||
if ($rootScope.storeinit==1){
|
||||
inappbilling.buy(successBuyHandler, errorBuyHandler, $scope.preis);
|
||||
if ($rootScope.storeinit==1 && $rootScope.flatrate==0){
|
||||
|
||||
if ($scope.preis=='rosenflatrate'){
|
||||
inappbilling.buy(successBuyOnceHandler, errorBuyHandler, $scope.preis);
|
||||
}
|
||||
else{
|
||||
inappbilling.buy(successBuyHandler, errorBuyHandler, $scope.preis);
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
var alertPopup = $ionicPopup.alert({
|
||||
@@ -198,7 +205,26 @@ $scope.show = function() {
|
||||
|
||||
|
||||
function successBuyHandler (result) {
|
||||
|
||||
if ($rootScope.flatrate==1){
|
||||
//Kein Konsum auslösem direkt zum Download
|
||||
$timeout(successConsumeHandler, 200);
|
||||
}
|
||||
else{
|
||||
//Kein Konsum auslösem
|
||||
$timeout(consumesuccessHandler, 500);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function successBuyOnceHandler (result) {
|
||||
$rootScope.flatrate=1;
|
||||
$scope.showflatrate = false;
|
||||
|
||||
$scope.rosen1preistag="kostenlos - Flaterate";
|
||||
$scope.rosen3preistag="kostenlos - Flaterate";
|
||||
$scope.rosen9preistag="kostenlos - Flaterate";
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user