From 42ed5cf7703afc7d663dd34f1132ba1bc1764d77 Mon Sep 17 00:00:00 2001 From: Halil Beycan <50718965+BeycanDeveloper@users.noreply.github.com> Date: Fri, 8 Mar 2024 11:26:06 +0800 Subject: [PATCH] removed integrator --- composer.json | 3 - composer.lock | 40 +--- .../cryptopay-integrator/.gitattributes | 1 - .../cryptopay-integrator/README.md | 5 - .../cryptopay-integrator/composer.json | 25 -- .../cryptopay-integrator/phpcs.xml | 34 --- .../cryptopay-integrator/src/Helpers.php | 220 ------------------ .../cryptopay-integrator/src/Hook.php | 79 ------- .../cryptopay-integrator/src/Session.php | 91 -------- .../cryptopay-integrator/src/Type.php | 11 - .../cryptopay-integrator/views/pay.php | 89 ------- vendor/composer/autoload_psr4.php | 1 - vendor/composer/autoload_real.php | 2 - vendor/composer/autoload_static.php | 16 -- vendor/composer/installed.json | 41 +--- vendor/composer/installed.php | 13 +- vendor/composer/platform_check.php | 26 --- 17 files changed, 5 insertions(+), 692 deletions(-) delete mode 100644 vendor/beycanpress/cryptopay-integrator/.gitattributes delete mode 100644 vendor/beycanpress/cryptopay-integrator/README.md delete mode 100644 vendor/beycanpress/cryptopay-integrator/composer.json delete mode 100644 vendor/beycanpress/cryptopay-integrator/phpcs.xml delete mode 100644 vendor/beycanpress/cryptopay-integrator/src/Helpers.php delete mode 100644 vendor/beycanpress/cryptopay-integrator/src/Hook.php delete mode 100644 vendor/beycanpress/cryptopay-integrator/src/Session.php delete mode 100644 vendor/beycanpress/cryptopay-integrator/src/Type.php delete mode 100644 vendor/beycanpress/cryptopay-integrator/views/pay.php delete mode 100644 vendor/composer/platform_check.php diff --git a/composer.json b/composer.json index 7bdb1e9..aedbeb1 100644 --- a/composer.json +++ b/composer.json @@ -3,8 +3,5 @@ "phpcs": "phpcs --standard=phpcs.xml .", "phpcbf": "phpcbf --standard=phpcs.xml .", "install-phpcs": "composer config --global --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true && composer global require --dev squizlabs/php_codesniffer=* slevomat/coding-standard" - }, - "require": { - "beycanpress/cryptopay-integrator": "^0.1.5" } } diff --git a/composer.lock b/composer.lock index 4034c88..ba6fe47 100644 --- a/composer.lock +++ b/composer.lock @@ -4,44 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1fe4f2337dedacb4e5c49da7935e6767", - "packages": [ - { - "name": "beycanpress/cryptopay-integrator", - "version": "0.1.5", - "source": { - "type": "git", - "url": "https://github.com/BeycanPress/cryptopay-integrator.git", - "reference": "3e09b41450580cf9591b52f9e4f73bbce0970637" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/BeycanPress/cryptopay-integrator/zipball/3e09b41450580cf9591b52f9e4f73bbce0970637", - "reference": "3e09b41450580cf9591b52f9e4f73bbce0970637", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "BeycanPress\\CryptoPay\\Integrator\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "CryptoPay and CryptoPay Lite integration wrapper", - "homepage": "https://github.com/BeycanPress/cryptopay-integrator", - "support": { - "issues": "https://github.com/BeycanPress/cryptopay-integrator/issues", - "source": "https://github.com/BeycanPress/cryptopay-integrator/tree/0.1.5" - }, - "time": "2024-03-06T14:42:16+00:00" - } - ], + "content-hash": "d751713988987e9331980363e24189ce", + "packages": [], "packages-dev": [], "aliases": [], "minimum-stability": "stable", diff --git a/vendor/beycanpress/cryptopay-integrator/.gitattributes b/vendor/beycanpress/cryptopay-integrator/.gitattributes deleted file mode 100644 index 94f480d..0000000 --- a/vendor/beycanpress/cryptopay-integrator/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text=auto eol=lf \ No newline at end of file diff --git a/vendor/beycanpress/cryptopay-integrator/README.md b/vendor/beycanpress/cryptopay-integrator/README.md deleted file mode 100644 index 057df5c..0000000 --- a/vendor/beycanpress/cryptopay-integrator/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# CryptoPay Integrator Wrapper - -```bash -composer require beycanpress/cryptopay-integrator -``` diff --git a/vendor/beycanpress/cryptopay-integrator/composer.json b/vendor/beycanpress/cryptopay-integrator/composer.json deleted file mode 100644 index d47b670..0000000 --- a/vendor/beycanpress/cryptopay-integrator/composer.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "beycanpress/cryptopay-integrator", - "version": "0.1.5", - "description": "CryptoPay and CryptoPay Lite integration wrapper", - "type": "library", - "license": "MIT", - "author": "BeycanPress", - "support": { - "issues": "https://github.com/BeycanPress/cryptopay-integrator/issues" - }, - "homepage": "https://github.com/BeycanPress/cryptopay-integrator", - "require": { - "php": ">=8.1" - }, - "scripts": { - "phpcs": "phpcs --standard=phpcs.xml .", - "phpcbf": "phpcbf --standard=phpcs.xml .", - "install-phpcs": "composer config --global --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true && composer global require --dev squizlabs/php_codesniffer=* slevomat/coding-standard" - }, - "autoload": { - "psr-4": { - "BeycanPress\\CryptoPay\\Integrator\\": "src" - } - } -} diff --git a/vendor/beycanpress/cryptopay-integrator/phpcs.xml b/vendor/beycanpress/cryptopay-integrator/phpcs.xml deleted file mode 100644 index f44524d..0000000 --- a/vendor/beycanpress/cryptopay-integrator/phpcs.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - BeycanPressStandard - - ./**/*.php - */views/* - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/beycanpress/cryptopay-integrator/src/Helpers.php b/vendor/beycanpress/cryptopay-integrator/src/Helpers.php deleted file mode 100644 index 46137bd..0000000 --- a/vendor/beycanpress/cryptopay-integrator/src/Helpers.php +++ /dev/null @@ -1,220 +0,0 @@ - ...$args - * @return void - */ - // phpcs:ignore - public static function createTransactionPage(...$args): void - { - if (is_admin()) { - if (self::exists()) { - new TransactionPage(...$args); - } - - if (self::liteExists()) { - new LiteTransactionPage(...$args); - } - } - } - - /** - * @param string $modelClass - * @return void - */ - public static function registerModel(string $modelClass): void - { - if (self::exists() && class_exists($modelClass)) { - $model = new $modelClass(); - Hook::addFilter('models', function (array $models) use ($model): array { - return array_merge($models, [ - $model->addon => $model - ]); - }); - } - } - - /** - * @param string $modelClass - * @return void - */ - public static function registerLiteModel(string $modelClass): void - { - if (self::liteExists() && class_exists($modelClass)) { - $model = new $modelClass(); - LiteHook::addFilter('models', function (array $models) use ($model): array { - return array_merge($models, [ - $model->addon => $model - ]); - }); - } - } - - /** - * @param string $method - * @param array ...$args - * @return mixed - */ - // phpcs:ignore - public static function run(string $method, ...$args): mixed - { - if (self::exists()) { - return ProHelpers::$method(...$args); - } else { - return LiteHelpers::$method(...$args); - } - } - - /** - * @param string $method - * @param array ...$args - * @return mixed - */ - // phpcs:ignore - public static function response(string $method, ...$args): mixed - { - if (self::exists()) { - return Response::$method(...$args); - } else { - return LiteResponse::$method(...$args); - } - } - - /** - * @param array $data - * @return string - * @throws \Exception - */ - public static function createSPP(array $data): string - { - if (!isset($data['addon'])) { - throw new \Exception('Addon is required'); - } - - if (!isset($data['order'])) { - throw new \Exception('Order is required'); - } - - if (!isset($data['order']['amount'])) { - throw new \Exception('Order amount is required'); - } - - if (!isset($data['order']['currency'])) { - throw new \Exception('Order currency is required'); - } - - if (!isset($data['type'])) { - throw new \Exception('CryptoPay type is required'); - } - - if (!($data['type'] instanceof Type)) { - throw new \Exception('Invalid CryptoPay type'); - } - - $token = md5(json_encode($data) . time()); - - Session::set($token, $data); - - return home_url("/?cp_spp={$token}"); - } - - /** - * @return void - */ - public static function listenSPP(): void - { - $token = isset($_GET['cp_spp']) ? sanitize_text_field($_GET['cp_spp']) : null; - - if ($token && Session::has($token)) { - extract(Session::get($token)); - if (Type::PRO === $type) { - $cryptopay = self::createProPayment($addon, (array) $order); - } else { - $cryptopay = self::createLitePayment($addon, (array) $order); - } - require dirname(__DIR__) . '/views/pay.php'; - exit; - } - } - - /** - * @param string $addon - * @param array $order - * @return string - */ - public static function createProPayment(string $addon, array $order): string - { - return (new Payment($addon))->setOrder(OrderType::fromArray($order))->html(loading:true); - } - - /** - * @param string $addon - * @param array $order - * @return string - */ - public static function createLitePayment(string $addon, array $order): string - { - return (new LitePayment($addon))->setOrder(LiteOrderType::fromArray($order))->html(loading:true); - } -} diff --git a/vendor/beycanpress/cryptopay-integrator/src/Hook.php b/vendor/beycanpress/cryptopay-integrator/src/Hook.php deleted file mode 100644 index 9f26c22..0000000 --- a/vendor/beycanpress/cryptopay-integrator/src/Hook.php +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - <?php echo esc_html__('CryptoPay Single Page Payment') ?> - - - -
-
-

- -

:

- - -

:

- - -

:

- -

- -

-
-
- -
-
- - - \ No newline at end of file diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 18bab2c..3890ddc 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -6,5 +6,4 @@ $baseDir = dirname($vendorDir); return array( - 'BeycanPress\\CryptoPay\\Integrator\\' => array($vendorDir . '/beycanpress/cryptopay-integrator/src'), ); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 2ff5b69..3d9ac47 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -22,8 +22,6 @@ public static function getLoader() return self::$loader; } - require __DIR__ . '/platform_check.php'; - spl_autoload_register(array('ComposerAutoloaderInit6be0de7c2c544c6b51cbdeae0bbe23be', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInit6be0de7c2c544c6b51cbdeae0bbe23be', 'loadClassLoader')); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 95931a7..3b56fc0 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -6,20 +6,6 @@ class ComposerStaticInit6be0de7c2c544c6b51cbdeae0bbe23be { - public static $prefixLengthsPsr4 = array ( - 'B' => - array ( - 'BeycanPress\\CryptoPay\\Integrator\\' => 33, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'BeycanPress\\CryptoPay\\Integrator\\' => - array ( - 0 => __DIR__ . '/..' . '/beycanpress/cryptopay-integrator/src', - ), - ); - public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', ); @@ -27,8 +13,6 @@ class ComposerStaticInit6be0de7c2c544c6b51cbdeae0bbe23be public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit6be0de7c2c544c6b51cbdeae0bbe23be::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit6be0de7c2c544c6b51cbdeae0bbe23be::$prefixDirsPsr4; $loader->classMap = ComposerStaticInit6be0de7c2c544c6b51cbdeae0bbe23be::$classMap; }, null, ClassLoader::class); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 930c055..87fda74 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,44 +1,5 @@ { - "packages": [ - { - "name": "beycanpress/cryptopay-integrator", - "version": "0.1.5", - "version_normalized": "0.1.5.0", - "source": { - "type": "git", - "url": "https://github.com/BeycanPress/cryptopay-integrator.git", - "reference": "3e09b41450580cf9591b52f9e4f73bbce0970637" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/BeycanPress/cryptopay-integrator/zipball/3e09b41450580cf9591b52f9e4f73bbce0970637", - "reference": "3e09b41450580cf9591b52f9e4f73bbce0970637", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "time": "2024-03-06T14:42:16+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "BeycanPress\\CryptoPay\\Integrator\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "CryptoPay and CryptoPay Lite integration wrapper", - "homepage": "https://github.com/BeycanPress/cryptopay-integrator", - "support": { - "issues": "https://github.com/BeycanPress/cryptopay-integrator/issues", - "source": "https://github.com/BeycanPress/cryptopay-integrator/tree/0.1.5" - }, - "install-path": "../beycanpress/cryptopay-integrator" - } - ], + "packages": [], "dev": true, "dev-package-names": [] } diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index f8f6de3..d8a3c23 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'd582f99a181a5b93b986d368de13d0c3997dac1f', + 'reference' => '1ebb64abc82be5e7e97016fe804e49d189b1b6de', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,20 +13,11 @@ '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'd582f99a181a5b93b986d368de13d0c3997dac1f', + 'reference' => '1ebb64abc82be5e7e97016fe804e49d189b1b6de', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), - 'beycanpress/cryptopay-integrator' => array( - 'pretty_version' => '0.1.5', - 'version' => '0.1.5.0', - 'reference' => '3e09b41450580cf9591b52f9e4f73bbce0970637', - 'type' => 'library', - 'install_path' => __DIR__ . '/../beycanpress/cryptopay-integrator', - 'aliases' => array(), - 'dev_requirement' => false, - ), ), ); diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php deleted file mode 100644 index 4c3a5d6..0000000 --- a/vendor/composer/platform_check.php +++ /dev/null @@ -1,26 +0,0 @@ -= 80100)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.'; -} - -if ($issues) { - if (!headers_sent()) { - header('HTTP/1.1 500 Internal Server Error'); - } - if (!ini_get('display_errors')) { - if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { - fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); - } elseif (!headers_sent()) { - echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; - } - } - trigger_error( - 'Composer detected issues in your platform: ' . implode(' ', $issues), - E_USER_ERROR - ); -}