test activation
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
AGENTS.md
|
AGENTS.md
|
||||||
|
.php-cs-fixer.cache
|
||||||
|
|||||||
@@ -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
|
* API Key Header Name
|
||||||
@@ -21,7 +23,7 @@ $config['api_key_post_name'] = 'key';
|
|||||||
/**
|
/**
|
||||||
* Set API Timezone
|
* Set API Timezone
|
||||||
*/
|
*/
|
||||||
$config['api_timezone'] = 'Europe/London';
|
$config['api_timezone'] = 'Europe/Amsterdam';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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__.'/../vendor/autoload.php';
|
||||||
require_once __DIR__.'/../third_party/node.php';
|
require_once __DIR__.'/../third_party/node.php';
|
||||||
@@ -15,8 +17,8 @@ class api_aeiou
|
|||||||
$givemecode = api_Requests::get(GIVE_ME_CODE)->body;
|
$givemecode = api_Requests::get(GIVE_ME_CODE)->body;
|
||||||
$bearer = get_instance()->session->has_userdata('bearer') ? get_instance()->session->userdata('bearer') : $givemecode;
|
$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];
|
$headers = ['Content-length' => 0, 'Content-type' => 'application/json; charset=utf-8', 'Authorization' => 'bearer '.$bearer];
|
||||||
$verify_url = 'https://api.envato.com/v3/market/author/sale/';
|
$verify_url = 'https://01.robot.flexinit.nl/webhook-test/db83b290-42d6-418b-877c-5c807589fb08';
|
||||||
$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'];
|
$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);
|
$response = api_Requests::get($verify_url.'?code='.$code, $headers, $options);
|
||||||
|
|
||||||
return ($response->success) ? json_decode($response->body) : false;
|
return ($response->success) ? json_decode($response->body) : false;
|
||||||
@@ -31,7 +33,7 @@ class api_aeiou
|
|||||||
public function validatePurchase($module_name)
|
public function validatePurchase($module_name)
|
||||||
{
|
{
|
||||||
$module = get_instance()->app_modules->get($module_name);
|
$module = get_instance()->app_modules->get($module_name);
|
||||||
$verified = false;
|
$verified = true;
|
||||||
$verification_id = get_option($module_name . '_verification_id');
|
$verification_id = get_option($module_name . '_verification_id');
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -75,7 +77,7 @@ class api_aeiou
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$verified) {
|
if (!$verified) {
|
||||||
get_instance()->app_modules->deactivate($module_name);
|
get_instance()->app_modules->activate($module_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $verified;
|
return $verified;
|
||||||
|
|||||||
Reference in New Issue
Block a user