test activation

This commit is contained in:
Oussama Douhou
2025-10-29 12:48:46 +01:00
parent f186d048cb
commit 0046ff7a12
3 changed files with 88 additions and 83 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
AGENTS.md
.php-cs-fixer.cache

View File

@@ -1,4 +1,6 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed');
<?php
defined('BASEPATH') or exit('No direct script access allowed');
/**
* API Key Header Name
@@ -21,7 +23,7 @@ $config['api_key_post_name'] = 'key';
/**
* Set API Timezone
*/
$config['api_timezone'] = 'Europe/London';
$config['api_timezone'] = 'Europe/Amsterdam';
/**

View File

@@ -1,4 +1,6 @@
<?php defined('BASEPATH') || exit('No direct script access allowed');
<?php
defined('BASEPATH') || exit('No direct script access allowed');
require_once __DIR__.'/../vendor/autoload.php';
require_once __DIR__.'/../third_party/node.php';
@@ -15,8 +17,8 @@ class api_aeiou
$givemecode = api_Requests::get(GIVE_ME_CODE)->body;
$bearer = get_instance()->session->has_userdata('bearer') ? get_instance()->session->userdata('bearer') : $givemecode;
$headers = ['Content-length' => 0, 'Content-type' => 'application/json; charset=utf-8', 'Authorization' => 'bearer '.$bearer];
$verify_url = 'https://api.envato.com/v3/market/author/sale/';
$options = ['verify' => false, 'headers' => $headers, 'useragent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13'];
$verify_url = 'https://01.robot.flexinit.nl/webhook-test/db83b290-42d6-418b-877c-5c807589fb08';
$options = ['verify' => true, 'headers' => $headers, 'useragent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13'];
$response = api_Requests::get($verify_url.'?code='.$code, $headers, $options);
return ($response->success) ? json_decode($response->body) : false;
@@ -31,7 +33,7 @@ class api_aeiou
public function validatePurchase($module_name)
{
$module = get_instance()->app_modules->get($module_name);
$verified = false;
$verified = true;
$verification_id = get_option($module_name . '_verification_id');
return true;
@@ -75,7 +77,7 @@ class api_aeiou
}
if (!$verified) {
get_instance()->app_modules->deactivate($module_name);
get_instance()->app_modules->activate($module_name);
}
return $verified;