Flatratekaufprozess eingebaut und vorbereitet

This commit is contained in:
2016-02-02 16:25:48 +01:00
parent 5e25c4ca61
commit cfb60396ea
21 changed files with 128 additions and 77 deletions

View File

@@ -17,6 +17,7 @@ angular.module('starter', ['ionic', 'ngCordova', 'starter.controllers', 'starter
$rootScope.storeinit=99;
$rootScope.flatrate=0;
$ionicPlatform.registerBackButtonAction(function(event) {

View File

@@ -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";
}
/*

View File

@@ -17,6 +17,7 @@ angular.module('starter', ['ionic', 'ngCordova', 'starter.controllers', 'starter
$rootScope.storeinit=99;
$rootScope.flatrate=0;
$ionicPlatform.registerBackButtonAction(function(event) {

View File

@@ -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";
}
/*

View File

@@ -18,7 +18,7 @@ document.getElementById(id+'Link').style.display = 'none';
<body>
<h1>Lint Report</h1>
<div class="titleSeparator"></div>
Check performed at Tue Feb 02 15:54:13 CET 2016.<br/>
Check performed at Tue Feb 02 16:22:42 CET 2016.<br/>
6 errors and 0 warnings found:<br/><br/>
<table class="overview">
<tr><td></td><td class="categoryColumn"><a href="#Correctness">Correctness</a>