initial commit

This commit is contained in:
equippedcoding-master
2025-09-17 09:37:06 -05:00
parent 86108ca47e
commit e2c98790b2
55389 changed files with 6206730 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /v1/apps/index.php [L]
</IfModule>

View File

@@ -0,0 +1,24 @@
<?php
// require __DIR__ . "/vendor/autoload.php";
$dir = dirname( __DIR__, 3 );
$path = $dir . "/admin/core/api/php/includes/init.php";
require $path;
$router = new AppfactoryStudio\Core\Router();
// https://www15.cradle2careertx.org/portal/api/apps/appconnect
$router->get('/appconnect',[AppfactoryStudio\Plugins\AppsConnection::class, 'applogin']);
$router->post('/appconnect',[AppfactoryStudio\Plugins\AppsConnection::class, 'applogin']);
echo $router->UrlResolve("/v1/apps", $_SERVER['REQUEST_URI'], strtolower($_SERVER['REQUEST_METHOD']));
// https://www.appfactory.studio/portal/api/membership/internal/get_membership

View File

@@ -0,0 +1,113 @@
########## BEGIN RECOMMENDED RULES (COMMENT OUT OR UNCOMMENT AS NEEDED) ##########
### htaccess (https://github.com/delight-im/htaccess)
### Copyright (c) delight.im (https://www.delight.im/)
### Licensed under the MIT License (https://opensource.org/licenses/MIT)
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization"
Header set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
<IfModule mod_autoindex.c>
# Turn off directory listings for folders without default documents
Options -Indexes
</IfModule>
<IfModule mod_negotiation.c>
# Disable 'MultiViews' implicit filename pattern matches
Options -MultiViews
</IfModule>
# Serve "text/plain" and "text/html" documents as UTF-8 by default
AddDefaultCharset utf-8
# Disable "ETag" headers so that browsers rely on the "Cache-Control" and "Expires" headers
FileETag None
<ifModule mod_headers.c>
# Enable HTTP Strict Transport Security (HSTS) with a duration of six months (Uncomment 1 line below)
# Header set Strict-Transport-Security max-age=15778800
</ifModule>
<ifModule mod_rewrite.c>
# Force 'www' (i.e. prefix the "bare" domain and all subdomains with 'www' through permanent redirects) (Uncomment 6 lines below)
# RewriteCond %{HTTP_HOST} !^$
# RewriteCond %{HTTP_HOST} !^www\. [NC]
# RewriteCond %{HTTPS}s ^on(s)|
# # RewriteCond %{REQUEST_SCHEME} ^http(s)|
# # RewriteCond %{SERVER_PORT}s ^443(s)|
# RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Force HTTPS (Uncomment 4 lines below)
# RewriteCond %{HTTPS} off
# # RewriteCond %{REQUEST_SCHEME} http
# # RewriteCond %{SERVER_PORT} !443
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
# Prevent access to non-minified CSS and JS (Uncomment 3 lines below)
# <FilesMatch "(?<!.min)\.(css|js)$">
# Require all denied
# </FilesMatch>
# Show a custom error document for "404 Not Found" errors (Uncomment 1 line below)
# ErrorDocument 404 /notFound.html
# Announce contact information for security issues (Uncomment 2 lines below)
# Header set X-Vulnerability-Disclosure "https://www.example.com/security"
# Header set X-Security-Contact "security@example.com"
########## END RECOMMENDED RULES ##########
########## BEGIN CUSTOM RULES (YOUR OWN RULES GO HERE) ##########
# Add your rules here ...
########## END CUSTOM RULES ##########
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /v1/core/index.php [L]
</IfModule>
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
# Prevent clickjacking (forbids framing by third-party sites)
Header set X-Frame-Options sameorigin
# Prevent content sniffing (MIME sniffing)
Header set X-Content-Type-Options nosniff
# Attempt to enable XSS filters in browsers, if available, and block reflected XSS
Header set X-XSS-Protection "1; mode=block"
# Cache media files for a month
<FilesMatch "\.(js|css|jpg|jpeg|png|svg|webp|gif|ico|ogg|mp4|webm)$">
Header set Cache-Control max-age=2629800
</FilesMatch>
# Remove response headers that provide no value but leak information
Header always unset X-Powered-By
Header unset Server
# Disable "ETag" headers so that browsers rely on the "Cache-Control" and "Expires" headers
Header unset ETag
</IfModule>

View File

@@ -0,0 +1,35 @@
<?php
// require __DIR__ . "/vendor/autoload.php";
$dir = dirname( __DIR__, 3 );
require $dir . "/admin/core/api/php/includes/init.php";
$router = new AppfactoryStudio\Core\Router();
// membership
$router->get('/membership/',[AppfactoryStudio\Plugins\Membership::class, 'index']);
$router->get('/membership/test_form1',[AppfactoryStudio\Plugins\Membership::class, 'test_form1']);
$router->post('/membership/store',[AppfactoryStudio\Plugins\Membership::class, 'store']);
$router->post('/membership/internal/get_membership',[AppfactoryStudio\Plugins\Membership::class, 'get_membership']);
$router->get('/membership/internal/get_membership',[AppfactoryStudio\Plugins\Membership::class, 'get_membership']);
//
$router->post('/member_update',[AppfactoryStudio\Plugins\Membership::class, 'member_update']);
$router->post('/member_get_config',[AppfactoryStudio\Plugins\Membership::class, 'member_get_config']);
$router->post('/init_application_manager',[AppfactoryStudio\Plugins\AppCore::class, 'init_application_manager']);
$router->get('/initialize_client_sdk',[AppfactoryStudio\Plugins\AppCore::class, 'initialize_client_sdk']);
$router->post('/send_email',[AppfactoryStudio\Plugins\AppCore::class, 'send_email']);
echo $router->UrlResolve("/v1/core", $_SERVER['REQUEST_URI'], strtolower($_SERVER['REQUEST_METHOD']));
// https://www.appfactory.studio/portal/api/membership/internal/get_membership

View File

@@ -0,0 +1,9 @@
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /v1/data/index.php [L]
</IfModule>

View File

@@ -0,0 +1,21 @@
<?php
// require __DIR__ . "/vendor/autoload.php";
$dir = dirname( __DIR__, 3 );
$path = $dir . "/admin/core/api/php/includes/init.php";
require $path;
$router = new AppfactoryStudio\Core\Router();
// https://www15.cradle2careertx.org/portal/api/apps/appconnect
$router->get('/downloads',[AppfactoryStudio\Plugins\AppsConnection::class, 'data_downloads']);
echo $router->UrlResolve("/v1/data", $_SERVER['REQUEST_URI'], strtolower($_SERVER['REQUEST_METHOD']));
// https://www.appfactory.studio/portal/api/membership/internal/get_membership

View File

@@ -0,0 +1,9 @@
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /v1/dev/index.php [L]
</IfModule>

View File

@@ -0,0 +1,13 @@
<?php
// require __DIR__ . "/vendor/autoload.php";
$dir = dirname( __DIR__, 3 );
require $dir . "/admin/core/api/php/includes/init.php";
$router = new AppfactoryStudio\Core\Router();
echo $router->UrlResolve("/v1/dev", $_SERVER['REQUEST_URI'], strtolower($_SERVER['REQUEST_METHOD']));
// https://www.appfactory.studio/portal/api/membership/internal/get_membership

6
api-sandbox/v1/index.php Normal file
View File

@@ -0,0 +1,6 @@
<?php
echo "error";

View File

@@ -0,0 +1,123 @@
########## BEGIN RECOMMENDED RULES (COMMENT OUT OR UNCOMMENT AS NEEDED) ##########
### htaccess (https://github.com/delight-im/htaccess)
### Copyright (c) delight.im (https://www.delight.im/)
### Licensed under the MIT License (https://opensource.org/licenses/MIT)
<ifModule mod_headers.c>
# Prevent clickjacking (forbids framing by third-party sites)
Header set X-Frame-Options sameorigin
# Prevent content sniffing (MIME sniffing)
Header set X-Content-Type-Options nosniff
# Attempt to enable XSS filters in browsers, if available, and block reflected XSS
Header set X-XSS-Protection "1; mode=block"
# Cache media files for a month
<FilesMatch "\.(js|css|jpg|jpeg|png|svg|webp|gif|ico|ogg|mp4|webm)$">
Header set Cache-Control max-age=2629800
</FilesMatch>
# Remove response headers that provide no value but leak information
Header unset X-Powered-By
# Disable "ETag" headers so that browsers rely on the "Cache-Control" and "Expires" headers
Header unset ETag
</ifModule>
<IfModule mod_autoindex.c>
# Turn off directory listings for folders without default documents
Options -Indexes
</IfModule>
<IfModule mod_negotiation.c>
# Disable 'MultiViews' implicit filename pattern matches
Options -MultiViews
</IfModule>
# Serve "text/plain" and "text/html" documents as UTF-8 by default
AddDefaultCharset utf-8
# Disable "ETag" headers so that browsers rely on the "Cache-Control" and "Expires" headers
FileETag None
<ifModule mod_headers.c>
# Enable HTTP Strict Transport Security (HSTS) with a duration of six months (Uncomment 1 line below)
# Header set Strict-Transport-Security max-age=15778800
</ifModule>
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /v1/payments/index.php [L]
# Force 'www' (i.e. prefix the "bare" domain and all subdomains with 'www' through permanent redirects) (Uncomment 6 lines below)
# RewriteCond %{HTTP_HOST} !^$
# RewriteCond %{HTTP_HOST} !^www\. [NC]
# RewriteCond %{HTTPS}s ^on(s)|
# # RewriteCond %{REQUEST_SCHEME} ^http(s)|
# # RewriteCond %{SERVER_PORT}s ^443(s)|
# RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Force HTTPS (Uncomment 4 lines below)
# RewriteCond %{HTTPS} off
# # RewriteCond %{REQUEST_SCHEME} http
# # RewriteCond %{SERVER_PORT} !443
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
# Prevent access to non-minified CSS and JS (Uncomment 3 lines below)
# <FilesMatch "(?<!.min)\.(css|js)$">
# Require all denied
# </FilesMatch>
# Show a custom error document for "404 Not Found" errors (Uncomment 1 line below)
# ErrorDocument 404 /notFound.html
# Announce contact information for security issues (Uncomment 2 lines below)
# Header set X-Vulnerability-Disclosure "https://www.example.com/security"
# Header set X-Security-Contact "security@example.com"
########## END RECOMMENDED RULES ##########
########## BEGIN CUSTOM RULES (YOUR OWN RULES GO HERE) ##########
# Add your rules here ...
########## END CUSTOM RULES ##########
#<ifModule mod_rewrite.c>
# RewriteEngine On
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# RewriteBase /
# RewriteRule ^index\.php$ - [L]
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule . /v1/payments/index.php [L]
#</IfModule>
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization"
Header set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
Header set timing-allow-origin "*"
# content-security-policy:

View File

@@ -0,0 +1,129 @@
<?php
$dir = dirname( __DIR__, 3 );
require_once $dir . "/admin/core/api/php/includes/init.php";
require_once dirname( __DIR__, 3 ) . "/admin/core/api/php/includes/functions.php";
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface as RequestHandler;
use Slim\Factory\AppFactory;
require_once dirname( __DIR__, 3 ) . "/admin/core/api/php/includes/libs/slim/vendor/autoload.php";
class JsonBodyParserMiddleware implements MiddlewareInterface
{
public function process(Request $request, RequestHandler $handler): Response
{
$contentType = $request->getHeaderLine('Content-Type');
if (strstr($contentType, 'application/json')) {
$contents = json_decode(file_get_contents('php://input'), true);
if (json_last_error() === JSON_ERROR_NONE) {
$request = $request->withParsedBody($contents);
}
}
return $handler->handle($request);
}
}
$app = AppFactory::create();
$app->addErrorMiddleware(true, true, true);
$app->add(new JsonBodyParserMiddleware());
$app->post('/v1/payments/initialize_direct_payments', function (Request $request, Response $response, $args) {
ApiCheck($request, $response, $args, function($headerCall,$options) use ($request, $response, $args){
$pay = new \AppfactoryStudio\Plugins\Payments();
$pay->initialize_direct_payments($options,function($obj) use ($request, $response, $args){
$response->getBody()->write(json_encode($obj ));
});
});
sleep(2);
return $response;
});
$app->post('/v1/payments/paypal/orders', function (Request $request, Response $response, $args) {
ApiCheck($request, $response, $args, function($headerCall,$options) use ($request, $response, $args){
$pay = new \AppfactoryStudio\Plugins\Payments();
$pay->apicall_paypal_orders($options,function($obj) use ($request, $response, $args){
$response->getBody()->write(json_encode($obj ));
});
});
sleep(2);
return $response;
});
$app->post('/v1/payments/paypal/orders/{order}/capture', function (Request $request, Response $response, $args) {
ApiCheck($request, $response, $args, function($headerCall,$options) use ($request, $response, $args){
// $pay = new \AppfactoryStudio\Plugins\Payments();
// $pay->apicall_paypal_orders($options,function($obj) use ($request, $response, $args){
// $response->getBody()->write(json_encode($obj ));
// });
$response->getBody()->write(json_encode($args ));
});
sleep(2);
return $response;
});
// Catch-all route to serve a 404 Not Found page if none of the routes match
// NOTE: make sure this route is defined last
// $app->map(['GET', 'POST', 'PUT', 'DELETE', 'PATCH'], '/{routes:.+}', function($req, $res) {
// $handler = $this->notFoundHandler; // handle using the default Slim page not found handler
// return $handler($req, $res);
// });
$app->run();
// $router = new AppfactoryStudio\Core\Router();
// $router->get('/direct_payment',[AppfactoryStudio\Plugins\Payments::class, 'get_direct_payment']);
// $router->get('/',[AppfactoryStudio\Plugins\Payments::class, 'init_home']);
// // $router->get('/direct_payments',[AppfactoryStudio\Plugins\Payments::class, 'api_direct_payment']);
// $router->post('/direct_payments',[AppfactoryStudio\Plugins\Payments::class, 'api_direct_payment']);
// $router->post('/save_handler',[AppfactoryStudio\Plugins\Payments::class, 'api_direct_payment_save_handler']);
// $router->post('/check_membership_purchase',[AppfactoryStudio\Plugins\Payments::class, 'check_membership_purchase']);
// $router->post('/stripe_create_subscription',[AppfactoryStudio\Plugins\Payments::class, 'apicall_stripe_create_subscription']);
// $router->post('/stripe_create_customer',[AppfactoryStudio\Plugins\Payments::class, 'apicall_stripe_create_customer']);
// $router->post('/stripe_check_charge',[AppfactoryStudio\Plugins\Payments::class, 'apicall_stripe_check_charge']);
// $router->post('/paypal',[AppfactoryStudio\Plugins\Payments::class, 'apicall_paypal']);
// https://api.appfactory.studio/v1/pay/direct_payment
// https://api-sandbox.appfactory.studio/v1/pay/direct_payment
// echo $router->UrlResolve("/v1/payments", $_SERVER['REQUEST_URI'], strtolower($_SERVER['REQUEST_METHOD']));

View File

@@ -0,0 +1,123 @@
########## BEGIN RECOMMENDED RULES (COMMENT OUT OR UNCOMMENT AS NEEDED) ##########
### htaccess (https://github.com/delight-im/htaccess)
### Copyright (c) delight.im (https://www.delight.im/)
### Licensed under the MIT License (https://opensource.org/licenses/MIT)
<ifModule mod_headers.c>
# Prevent clickjacking (forbids framing by third-party sites)
Header set X-Frame-Options sameorigin
# Prevent content sniffing (MIME sniffing)
Header set X-Content-Type-Options nosniff
# Attempt to enable XSS filters in browsers, if available, and block reflected XSS
Header set X-XSS-Protection "1; mode=block"
# Cache media files for a month
<FilesMatch "\.(js|css|jpg|jpeg|png|svg|webp|gif|ico|ogg|mp4|webm)$">
Header set Cache-Control max-age=2629800
</FilesMatch>
# Remove response headers that provide no value but leak information
Header unset X-Powered-By
# Disable "ETag" headers so that browsers rely on the "Cache-Control" and "Expires" headers
Header unset ETag
</ifModule>
<IfModule mod_autoindex.c>
# Turn off directory listings for folders without default documents
Options -Indexes
</IfModule>
<IfModule mod_negotiation.c>
# Disable 'MultiViews' implicit filename pattern matches
Options -MultiViews
</IfModule>
# Serve "text/plain" and "text/html" documents as UTF-8 by default
AddDefaultCharset utf-8
# Disable "ETag" headers so that browsers rely on the "Cache-Control" and "Expires" headers
FileETag None
<ifModule mod_headers.c>
# Enable HTTP Strict Transport Security (HSTS) with a duration of six months (Uncomment 1 line below)
# Header set Strict-Transport-Security max-age=15778800
</ifModule>
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /v1/webhooks/index.php [L]
# Force 'www' (i.e. prefix the "bare" domain and all subdomains with 'www' through permanent redirects) (Uncomment 6 lines below)
# RewriteCond %{HTTP_HOST} !^$
# RewriteCond %{HTTP_HOST} !^www\. [NC]
# RewriteCond %{HTTPS}s ^on(s)|
# # RewriteCond %{REQUEST_SCHEME} ^http(s)|
# # RewriteCond %{SERVER_PORT}s ^443(s)|
# RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Force HTTPS (Uncomment 4 lines below)
# RewriteCond %{HTTPS} off
# # RewriteCond %{REQUEST_SCHEME} http
# # RewriteCond %{SERVER_PORT} !443
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
# Prevent access to non-minified CSS and JS (Uncomment 3 lines below)
# <FilesMatch "(?<!.min)\.(css|js)$">
# Require all denied
# </FilesMatch>
# Show a custom error document for "404 Not Found" errors (Uncomment 1 line below)
# ErrorDocument 404 /notFound.html
# Announce contact information for security issues (Uncomment 2 lines below)
# Header set X-Vulnerability-Disclosure "https://www.example.com/security"
# Header set X-Security-Contact "security@example.com"
########## END RECOMMENDED RULES ##########
########## BEGIN CUSTOM RULES (YOUR OWN RULES GO HERE) ##########
# Add your rules here ...
########## END CUSTOM RULES ##########
#<ifModule mod_rewrite.c>
# RewriteEngine On
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# RewriteBase /
# RewriteRule ^index\.php$ - [L]
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule . /v1/payments/index.php [L]
#</IfModule>
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization"
Header set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
Header set timing-allow-origin "*"
# content-security-policy:

View File

@@ -0,0 +1,17 @@
<?php
$dir = dirname( __DIR__, 3 );
require $dir . "/admin/core/api/php/includes/init.php";
$router = new AppfactoryStudio\Core\Router();
$router->post('/stripe',[AppfactoryStudio\Plugins\Payments::class, 'webhook_stripe']);
$router->post('/paypal',[AppfactoryStudio\Plugins\Payments::class, 'webhook_paypal']);
// https://api.appfactory.studio/v1/webhooks/stripe
// https://api-sandbox.appfactory.studio/v1/webhooks/stripe
echo $router->UrlResolve("/v1/webhooks", $_SERVER['REQUEST_URI'], strtolower($_SERVER['REQUEST_METHOD']));