| Server IP : 84.32.84.242 / Your IP :
216.73.216.109 [
Web Server : LiteSpeed System : Linux nl-srv-web1124.main-hosting.eu 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64 User : u964240598 ( 964240598) PHP Version : 8.4.19 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/u964240598/domains/hofam.org/public_html/churchapp/application/models/ |
Upload File : |
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
include_once './vendor/autoload.php';
class Subscription_model extends CI_Model{
public $status = "error";
public $expiry_date = 0;
public $subscribed = 1;
private $GOOGLE_JSON_FILE = "uploads/api-7904900893803879423-558785-0eca16302037.json";
public function getSubscriptionData($packageName,$productId,$token){
$client = new \Google_Client();
$client->setAuthConfig($this->GOOGLE_JSON_FILE);
$client->addScope('https://www.googleapis.com/auth/androidpublisher');
$service = new \Google_Service_AndroidPublisher($client);
try {
$this->status = "ok";
$purchase = $service->purchases_subscriptions->get($packageName, $productId, $token);
$this->expiry_date = $purchase->expiryTimeMillis;
if($this->isValidFutureDate($this->expiry_date)){
$this->subscribed = 0;
}
} catch (\Exception $e){
//var_dump($e->getMessage());
// example message: Error calling GET ....: (404) Product not found for this application.
}
}
private function isValidFutureDate($date){
if(($date/1000) > time()){
return true;
}else{
return false;
}
}
}
Anon7 - 2022
AnonSec Team
