diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 561097b8c..000000000 --- a/.gitignore +++ /dev/null @@ -1,54 +0,0 @@ -# Vendor folder -/vendor/ - -# DEV tools -.vscode/ -.idea/ - -# SVN -.svn/ - - -# Docker database -/utils/Docker/sql/database -docker - -# Cache files -/admin/survey/SurveyData/*.html - - -# Log files -*.log - -# dat 1ka files -*.dat - -# CSV files -*.csv - -# Map files (sass) -*.map - -# Applications -*.app -*.exe -*.war - -# Large media files -*.mp4 -*.tiff -*.avi -*.flv -*.mov -*.wmv - - -# Settings, htaccess... -/settings.php -/settings_optional.php -/.htaccess -/composer.bat -/composer.phar -/composer.lock -/.favorites.json - diff --git a/composer.json b/composer.json index d19331c14..9a4529108 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,8 @@ "phpmailer/phpmailer": "~6.0", "minishlink/web-push": "^5.2", "stripe/stripe-php": "^7.40", - "geoip2/geoip2": "~2.0" + "geoip2/geoip2": "~2.0", + "paypal/paypal-checkout-sdk": "^1.0" }, "require-dev": { "kint-php/kint": "^1.1", diff --git a/composer.lock b/composer.lock new file mode 100644 index 000000000..54c328891 --- /dev/null +++ b/composer.lock @@ -0,0 +1,2407 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "c9fc655cdb58743c38114c03e68c1cc7", + "content-hash": "a150435d7f20bef4fdda8cb6c59eb1a6", + "packages": [ + { + "name": "composer/ca-bundle", + "version": "1.2.8", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "8a7ecad675253e4654ea05505233285377405215" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/8a7ecad675253e4654ea05505233285377405215", + "reference": "8a7ecad675253e4654ea05505233285377405215", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", + "psr/log": "^1.0", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "time": "2020-08-23 12:54:47" + }, + { + "name": "fgrosse/phpasn1", + "version": "v2.1.1", + "source": { + "type": "git", + "url": "https://github.com/fgrosse/PHPASN1.git", + "reference": "7ebf2a09084a7bbdb7b879c66fdf7ad80461bbe8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fgrosse/PHPASN1/zipball/7ebf2a09084a7bbdb7b879c66fdf7ad80461bbe8", + "reference": "7ebf2a09084a7bbdb7b879c66fdf7ad80461bbe8", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~6.3", + "satooshi/php-coveralls": "~2.0" + }, + "suggest": { + "ext-gmp": "GMP is the preferred extension for big integer calculations", + "php-curl": "For loading OID information from the web if they have not bee defined statically" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "FG\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Friedrich Große", + "email": "friedrich.grosse@gmail.com", + "homepage": "https://github.com/FGrosse", + "role": "Author" + }, + { + "name": "All contributors", + "homepage": "https://github.com/FGrosse/PHPASN1/contributors" + } + ], + "description": "A PHP Framework that allows you to encode and decode arbitrary ASN.1 structures using the ITU-T X.690 Encoding Rules.", + "homepage": "https://github.com/FGrosse/PHPASN1", + "keywords": [ + "DER", + "asn.1", + "asn1", + "ber", + "binary", + "decoding", + "encoding", + "x.509", + "x.690", + "x509", + "x690" + ], + "time": "2018-12-02 01:34:34" + }, + { + "name": "geoip2/geoip2", + "version": "v2.10.0", + "source": { + "type": "git", + "url": "https://github.com/maxmind/GeoIP2-php.git", + "reference": "419557cd21d9fe039721a83490701a58c8ce784a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/419557cd21d9fe039721a83490701a58c8ce784a", + "reference": "419557cd21d9fe039721a83490701a58c8ce784a", + "shasum": "" + }, + "require": { + "ext-json": "*", + "maxmind-db/reader": "~1.5", + "maxmind/web-service-common": "~0.6", + "php": ">=5.6" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "2.*", + "phpunit/phpunit": "5.*", + "squizlabs/php_codesniffer": "3.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "GeoIp2\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Gregory J. Oschwald", + "email": "goschwald@maxmind.com", + "homepage": "https://www.maxmind.com/" + } + ], + "description": "MaxMind GeoIP2 PHP API", + "homepage": "https://github.com/maxmind/GeoIP2-php", + "keywords": [ + "IP", + "geoip", + "geoip2", + "geolocation", + "maxmind" + ], + "time": "2019-12-12 18:48:39" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.5.5", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", + "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.6.1", + "php": ">=5.5", + "symfony/polyfill-intl-idn": "^1.17.0" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.1" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2020-06-16 21:01:06" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20 10:07:11" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "239400de7a173fe9901b9ac7c06497751f00727a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", + "reference": "239400de7a173fe9901b9ac7c06497751f00727a", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "suggest": { + "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2019-07-01 23:21:34" + }, + { + "name": "maxmind-db/reader", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/maxmind/MaxMind-DB-Reader-php.git", + "reference": "942553da239f12051275f9c666538b5dd09e2908" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/942553da239f12051275f9c666538b5dd09e2908", + "reference": "942553da239f12051275f9c666538b5dd09e2908", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "conflict": { + "ext-maxminddb": "<1.7.0,>=2.0.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "2.*", + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpcov": ">=6.0.0", + "phpunit/phpunit": ">=8.0.0,<10.0.0", + "squizlabs/php_codesniffer": "3.*" + }, + "suggest": { + "ext-bcmath": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder", + "ext-gmp": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder", + "ext-maxminddb": "A C-based database decoder that provides significantly faster lookups" + }, + "type": "library", + "autoload": { + "psr-4": { + "MaxMind\\Db\\": "src/MaxMind/Db" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Gregory J. Oschwald", + "email": "goschwald@maxmind.com", + "homepage": "https://www.maxmind.com/" + } + ], + "description": "MaxMind DB Reader API", + "homepage": "https://github.com/maxmind/MaxMind-DB-Reader-php", + "keywords": [ + "database", + "geoip", + "geoip2", + "geolocation", + "maxmind" + ], + "time": "2020-08-07 22:10:05" + }, + { + "name": "maxmind/web-service-common", + "version": "v0.7.0", + "source": { + "type": "git", + "url": "https://github.com/maxmind/web-service-common-php.git", + "reference": "74c996c218ada5c639c8c2f076756e059f5552fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maxmind/web-service-common-php/zipball/74c996c218ada5c639c8c2f076756e059f5552fc", + "reference": "74c996c218ada5c639c8c2f076756e059f5552fc", + "shasum": "" + }, + "require": { + "composer/ca-bundle": "^1.0.3", + "ext-curl": "*", + "ext-json": "*", + "php": ">=5.6" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "2.*", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0", + "squizlabs/php_codesniffer": "3.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "MaxMind\\Exception\\": "src/Exception", + "MaxMind\\WebService\\": "src/WebService" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Gregory Oschwald", + "email": "goschwald@maxmind.com" + } + ], + "description": "Internal MaxMind Web Service API", + "homepage": "https://github.com/maxmind/web-service-common-php", + "time": "2020-05-06 14:07:26" + }, + { + "name": "minishlink/web-push", + "version": "v5.2.5", + "source": { + "type": "git", + "url": "https://github.com/web-push-libs/web-push-php.git", + "reference": "0e75af425126435794ed42d7aa92119fd563e503" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-push-libs/web-push-php/zipball/0e75af425126435794ed42d7aa92119fd563e503", + "reference": "0e75af425126435794ed42d7aa92119fd563e503", + "shasum": "" + }, + "require": { + "ext-gmp": "*", + "ext-json": "*", + "guzzlehttp/guzzle": "^6.2", + "lib-openssl": "*", + "php": "^7.1", + "web-token/jwt-key-mgmt": "^1.0", + "web-token/jwt-signature": "^1.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.14", + "phpstan/phpstan": "0.11.2", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Minishlink\\WebPush\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Louis Lagrange", + "email": "lagrange.louis@gmail.com", + "homepage": "https://github.com/Minishlink" + } + ], + "description": "Web Push library for PHP", + "homepage": "https://github.com/web-push-libs/web-push-php", + "keywords": [ + "Push API", + "WebPush", + "notifications", + "push", + "web" + ], + "time": "2020-08-02 08:58:01" + }, + { + "name": "paragonie/random_compat", + "version": "v9.99.99", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "shasum": "" + }, + "require": { + "php": "^7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "time": "2018-07-02 15:55:56" + }, + { + "name": "paragonie/sodium_compat", + "version": "v1.13.0", + "source": { + "type": "git", + "url": "https://github.com/paragonie/sodium_compat.git", + "reference": "bbade402cbe84c69b718120911506a3aa2bae653" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/bbade402cbe84c69b718120911506a3aa2bae653", + "reference": "bbade402cbe84c69b718120911506a3aa2bae653", + "shasum": "" + }, + "require": { + "paragonie/random_compat": ">=1", + "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7|^8" + }, + "require-dev": { + "phpunit/phpunit": "^3|^4|^5|^6|^7" + }, + "suggest": { + "ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.", + "ext-sodium": "PHP >= 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security." + }, + "type": "library", + "autoload": { + "files": [ + "autoload.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com" + }, + { + "name": "Frank Denis", + "email": "jedisct1@pureftpd.org" + } + ], + "description": "Pure PHP implementation of libsodium; uses the PHP extension if it exists", + "keywords": [ + "Authentication", + "BLAKE2b", + "ChaCha20", + "ChaCha20-Poly1305", + "Chapoly", + "Curve25519", + "Ed25519", + "EdDSA", + "Edwards-curve Digital Signature Algorithm", + "Elliptic Curve Diffie-Hellman", + "Poly1305", + "Pure-PHP cryptography", + "RFC 7748", + "RFC 8032", + "Salpoly", + "Salsa20", + "X25519", + "XChaCha20-Poly1305", + "XSalsa20-Poly1305", + "Xchacha20", + "Xsalsa20", + "aead", + "cryptography", + "ecdh", + "elliptic curve", + "elliptic curve cryptography", + "encryption", + "libsodium", + "php", + "public-key cryptography", + "secret-key cryptography", + "side-channel resistant" + ], + "time": "2020-03-20 21:48:09" + }, + { + "name": "paypal/paypal-checkout-sdk", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/paypal/Checkout-PHP-SDK.git", + "reference": "ed6a55075448308b87a8b59dcb7fedf04a048cb1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paypal/Checkout-PHP-SDK/zipball/ed6a55075448308b87a8b59dcb7fedf04a048cb1", + "reference": "ed6a55075448308b87a8b59dcb7fedf04a048cb1", + "shasum": "" + }, + "require": { + "paypal/paypalhttp": "1.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "PayPalCheckoutSdk\\": "lib/PayPalCheckoutSdk", + "Sample\\": "samples/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "https://github.com/paypal/Checkout-PHP-SDK/blob/master/LICENSE" + ], + "authors": [ + { + "name": "PayPal", + "homepage": "https://github.com/paypal/Checkout-PHP-SDK/contributors" + } + ], + "description": "PayPal's PHP SDK for Checkout REST APIs", + "homepage": "http://github.com/paypal/Checkout-PHP-SDK/", + "keywords": [ + "checkout", + "orders", + "payments", + "paypal", + "rest", + "sdk" + ], + "time": "2019-11-07 23:16:44" + }, + { + "name": "paypal/paypalhttp", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/paypal/paypalhttp_php.git", + "reference": "1ad9b846a046f09d6135cbf2cbaa7701bbc630a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paypal/paypalhttp_php/zipball/1ad9b846a046f09d6135cbf2cbaa7701bbc630a3", + "reference": "1ad9b846a046f09d6135cbf2cbaa7701bbc630a3", + "shasum": "" + }, + "require": { + "ext-curl": "*" + }, + "require-dev": { + "phpunit/phpunit": "^5.7", + "wiremock-php/wiremock-php": "1.43.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PayPalHttp\\": "lib/PayPalHttp" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PayPal", + "homepage": "https://github.com/paypal/paypalhttp_php/contributors" + } + ], + "abandoned": true, + "time": "2019-11-06 21:27:12" + }, + { + "name": "phpmailer/phpmailer", + "version": "v6.1.7", + "source": { + "type": "git", + "url": "https://github.com/PHPMailer/PHPMailer.git", + "reference": "2c2370ba3df7034f9eb7b8f387c97b52b2ba5ad0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/2c2370ba3df7034f9eb7b8f387c97b52b2ba5ad0", + "reference": "2c2370ba3df7034f9eb7b8f387c97b52b2ba5ad0", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-filter": "*", + "php": ">=5.5.0" + }, + "require-dev": { + "doctrine/annotations": "^1.2", + "friendsofphp/php-cs-fixer": "^2.2", + "phpunit/phpunit": "^4.8 || ^5.7" + }, + "suggest": { + "ext-mbstring": "Needed to send email in multibyte encoding charset", + "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", + "league/oauth2-google": "Needed for Google XOAUTH2 authentication", + "psr/log": "For optional PSR-3 debug logging", + "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPMailer\\PHPMailer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-only" + ], + "authors": [ + { + "name": "Marcus Bointon", + "email": "phpmailer@synchromedia.co.uk" + }, + { + "name": "Jim Jagielski", + "email": "jimjag@gmail.com" + }, + { + "name": "Andy Prevost", + "email": "codeworxtech@users.sourceforge.net" + }, + { + "name": "Brent R. Matzelle" + } + ], + "description": "PHPMailer is a full-featured email creation and transfer class for PHP", + "time": "2020-07-14 18:50:27" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06 14:39:51" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2019-03-08 08:55:37" + }, + { + "name": "sonata-project/google-authenticator", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/sonata-project/GoogleAuthenticator.git", + "reference": "feda53899b26af24e3db2fe7a3e5f053ca483762" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sonata-project/GoogleAuthenticator/zipball/feda53899b26af24e3db2fe7a3e5f053ca483762", + "reference": "feda53899b26af24e3db2fe7a3e5f053ca483762", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Google\\Authenticator\\": "src/", + "Sonata\\GoogleAuthenticator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Stocker", + "email": "me@chregu.tv" + }, + { + "name": "Andre DeMarre", + "homepage": "http://www.devnetwork.net/viewtopic.php?f=50&t=94989" + }, + { + "name": "Thomas Rabaix", + "email": "thomas.rabaix@gmail.com" + } + ], + "description": "Library to integrate Google Authenticator into a PHP project", + "homepage": "https://github.com/sonata-project/GoogleAuthenticator", + "keywords": [ + "google authenticator" + ], + "time": "2018-07-18 22:08:02" + }, + { + "name": "spomky-labs/base64url", + "version": "v2.0.3", + "source": { + "type": "git", + "url": "https://github.com/Spomky-Labs/base64url.git", + "reference": "48ea8ff600cefe56b82d3d5b768b6f4f3bfe05a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Spomky-Labs/base64url/zipball/48ea8ff600cefe56b82d3d5b768b6f4f3bfe05a1", + "reference": "48ea8ff600cefe56b82d3d5b768b6f4f3bfe05a1", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.0", + "phpstan/phpstan": "^0.11", + "phpstan/phpstan-beberlei-assert": "^0.11.0", + "phpstan/phpstan-deprecation-rules": "^0.11", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-strict-rules": "^0.11", + "phpunit/phpunit": "^7.0|^8.0|^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Base64Url\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky-Labs/base64url/contributors" + } + ], + "description": "Base 64 URL Safe Encoding/Decoding PHP Library", + "homepage": "https://github.com/Spomky-Labs/base64url", + "keywords": [ + "base64", + "rfc4648", + "safe", + "url" + ], + "time": "2020-08-30 13:35:33" + }, + { + "name": "stripe/stripe-php", + "version": "v7.52.0", + "source": { + "type": "git", + "url": "https://github.com/stripe/stripe-php.git", + "reference": "51e95c514aff45616dff09791ca5b2f10cf5c4e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stripe/stripe-php/zipball/51e95c514aff45616dff09791ca5b2f10cf5c4e8", + "reference": "51e95c514aff45616dff09791ca5b2f10cf5c4e8", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "php": ">=5.6.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "2.16.1", + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5.7", + "squizlabs/php_codesniffer": "^3.3", + "symfony/process": "~3.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Stripe\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Stripe and contributors", + "homepage": "https://github.com/stripe/stripe-php/contributors" + } + ], + "description": "Stripe PHP Library", + "homepage": "https://stripe.com/", + "keywords": [ + "api", + "payment processing", + "stripe" + ], + "time": "2020-09-08 19:29:20" + }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.18.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "5dcab1bc7146cf8c1beaa4502a3d9be344334251" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/5dcab1bc7146cf8c1beaa4502a3d9be344334251", + "reference": "5dcab1bc7146cf8c1beaa4502a3d9be344334251", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/polyfill-intl-normalizer": "^1.10", + "symfony/polyfill-php70": "^1.10", + "symfony/polyfill-php72": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "time": "2020-08-04 06:02:08" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.18.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", + "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "time": "2020-07-14 12:35:20" + }, + { + "name": "symfony/polyfill-php70", + "version": "v1.18.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "0dd93f2c578bdc9c72697eaa5f1dd25644e618d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/0dd93f2c578bdc9c72697eaa5f1dd25644e618d3", + "reference": "0dd93f2c578bdc9c72697eaa5f1dd25644e618d3", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "~1.0|~2.0|~9.99", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php70\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2020-07-14 12:35:20" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.18.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "639447d008615574653fb3bc60d1986d7172eaae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/639447d008615574653fb3bc60d1986d7172eaae", + "reference": "639447d008615574653fb3bc60d1986d7172eaae", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2020-07-14 12:35:20" + }, + { + "name": "web-token/jwt-core", + "version": "v1.3.10", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-core.git", + "reference": "30e9df9e040d933043b16237f9dba7a3be746566" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-core/zipball/30e9df9e040d933043b16237f9dba7a3be746566", + "reference": "30e9df9e040d933043b16237f9dba7a3be746566", + "shasum": "" + }, + "require": { + "ext-gmp": "*", + "ext-mbstring": "*", + "fgrosse/phpasn1": "^2.0", + "php": "^7.1", + "spomky-labs/base64url": "^1.0|^2.0", + "web-token/jwt-util-ecc": "^1.3" + }, + "conflict": { + "spomky-labs/jose": "*" + }, + "require-dev": { + "phpunit/phpunit": "^6.0|^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jose\\Component\\Core\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-core/contributors" + } + ], + "description": "Core component of the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ], + "time": "2020-03-20 13:29:04" + }, + { + "name": "web-token/jwt-key-mgmt", + "version": "v1.3.10", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-key-mgmt.git", + "reference": "65b1e908e50b0e5be6b28135085d3c1097b81801" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-key-mgmt/zipball/65b1e908e50b0e5be6b28135085d3c1097b81801", + "reference": "65b1e908e50b0e5be6b28135085d3c1097b81801", + "shasum": "" + }, + "require": { + "lib-openssl": "*", + "paragonie/sodium_compat": "^1.2", + "web-token/jwt-core": "^1.3", + "web-token/jwt-util-ecc": "^1.3" + }, + "require-dev": { + "php-http/httplug": "^1.1", + "php-http/message-factory": "^1.0", + "php-http/mock-client": "^1.0", + "phpunit/phpunit": "^6.0|^7.0" + }, + "suggest": { + "php-http/httplug": "To enable JKU/X5U support.", + "php-http/message-factory": "To enable JKU/X5U support." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jose\\Component\\KeyManagement\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-key-mgmt/contributors" + } + ], + "description": "Key Management component of the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ], + "time": "2020-03-20 13:29:04" + }, + { + "name": "web-token/jwt-signature", + "version": "v1.3.10", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-signature.git", + "reference": "00f23e997c9032536444f819bc3338ab475d69f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-signature/zipball/00f23e997c9032536444f819bc3338ab475d69f9", + "reference": "00f23e997c9032536444f819bc3338ab475d69f9", + "shasum": "" + }, + "require": { + "web-token/jwt-core": "^1.3", + "web-token/jwt-signature-algorithm-ecdsa": "^1.3", + "web-token/jwt-signature-algorithm-eddsa": "^1.3", + "web-token/jwt-signature-algorithm-hmac": "^1.3", + "web-token/jwt-signature-algorithm-none": "^1.3", + "web-token/jwt-signature-algorithm-rsa": "^1.3" + }, + "require-dev": { + "phpunit/phpunit": "^6.0|^7.0" + }, + "suggest": { + "web-token/jwt-signature-algorithm-ecdsa": "ECDSA Based Signature Algorithms", + "web-token/jwt-signature-algorithm-eddsa": "EdDSA Based Signature Algorithms", + "web-token/jwt-signature-algorithm-experimental": "Experimental Signature Algorithms", + "web-token/jwt-signature-algorithm-hmac": "HMAC Based Signature Algorithms", + "web-token/jwt-signature-algorithm-none": "None Signature Algorithm", + "web-token/jwt-signature-algorithm-rsa": "RSA Based Signature Algorithms" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jose\\Component\\Signature\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-signature/contributors" + } + ], + "description": "Signature component of the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ], + "time": "2020-03-20 13:29:04" + }, + { + "name": "web-token/jwt-signature-algorithm-ecdsa", + "version": "v1.3.10", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-signature-algorithm-ecdsa.git", + "reference": "a3babd3b82c29c739d426271ccb9dc1a56222e36" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-signature-algorithm-ecdsa/zipball/a3babd3b82c29c739d426271ccb9dc1a56222e36", + "reference": "a3babd3b82c29c739d426271ccb9dc1a56222e36", + "shasum": "" + }, + "require": { + "web-token/jwt-signature": "^1.3" + }, + "require-dev": { + "phpunit/phpunit": "^6.0|^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jose\\Component\\Signature\\Algorithm\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-core/contributors" + } + ], + "description": "ECDSA Based Signature Algorithms the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ], + "time": "2020-03-20 13:29:04" + }, + { + "name": "web-token/jwt-signature-algorithm-eddsa", + "version": "v1.3.10", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-signature-algorithm-eddsa.git", + "reference": "b0dad134313b14b3ba077b63a7afcc2b38e5f793" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-signature-algorithm-eddsa/zipball/b0dad134313b14b3ba077b63a7afcc2b38e5f793", + "reference": "b0dad134313b14b3ba077b63a7afcc2b38e5f793", + "shasum": "" + }, + "require": { + "web-token/jwt-signature": "^1.3" + }, + "require-dev": { + "phpunit/phpunit": "^6.0|^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jose\\Component\\Signature\\Algorithm\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-core/contributors" + } + ], + "description": "EdDSA Signature Algorithm the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ], + "time": "2020-03-20 13:29:04" + }, + { + "name": "web-token/jwt-signature-algorithm-hmac", + "version": "v1.3.10", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-signature-algorithm-hmac.git", + "reference": "3bc85e1d13804902a8d81a11f58c28c9a471b5e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-signature-algorithm-hmac/zipball/3bc85e1d13804902a8d81a11f58c28c9a471b5e2", + "reference": "3bc85e1d13804902a8d81a11f58c28c9a471b5e2", + "shasum": "" + }, + "require": { + "web-token/jwt-signature": "^1.3" + }, + "require-dev": { + "phpunit/phpunit": "^6.0|^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jose\\Component\\Signature\\Algorithm\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-core/contributors" + } + ], + "description": "HMAC Based Signature Algorithms the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ], + "time": "2020-03-20 13:29:04" + }, + { + "name": "web-token/jwt-signature-algorithm-none", + "version": "v1.3.10", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-signature-algorithm-none.git", + "reference": "0391e160367e85846736e63ea6026e2dab667b6e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-signature-algorithm-none/zipball/0391e160367e85846736e63ea6026e2dab667b6e", + "reference": "0391e160367e85846736e63ea6026e2dab667b6e", + "shasum": "" + }, + "require": { + "web-token/jwt-signature": "^1.3" + }, + "require-dev": { + "phpunit/phpunit": "^6.0|^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jose\\Component\\Signature\\Algorithm\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-core/contributors" + } + ], + "description": "None Signature Algorithm the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ], + "time": "2020-03-20 13:29:04" + }, + { + "name": "web-token/jwt-signature-algorithm-rsa", + "version": "v1.3.10", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-signature-algorithm-rsa.git", + "reference": "344181ef6cdd3aca77f7ff7defc9fb502eb33ec0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-signature-algorithm-rsa/zipball/344181ef6cdd3aca77f7ff7defc9fb502eb33ec0", + "reference": "344181ef6cdd3aca77f7ff7defc9fb502eb33ec0", + "shasum": "" + }, + "require": { + "web-token/jwt-signature": "^1.3" + }, + "require-dev": { + "phpunit/phpunit": "^6.0|^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jose\\Component\\Signature\\Algorithm\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-core/contributors" + } + ], + "description": "RSA Based Signature Algorithms the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ], + "time": "2020-03-20 13:29:04" + }, + { + "name": "web-token/jwt-util-ecc", + "version": "v1.3.10", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-util-ecc.git", + "reference": "2011af8454561ebce06a77fcd681c29a252e0068" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-util-ecc/zipball/2011af8454561ebce06a77fcd681c29a252e0068", + "reference": "2011af8454561ebce06a77fcd681c29a252e0068", + "shasum": "" + }, + "require": { + "ext-gmp": "*", + "ext-mbstring": "*", + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.0|^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jose\\Component\\Core\\Util\\Ecc\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-core/contributors" + } + ], + "description": "ECC Tools for the JWT Framework.", + "homepage": "https://github.com/web-token", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ], + "time": "2020-03-20 13:29:04" + } + ], + "packages-dev": [ + { + "name": "filp/whoops", + "version": "2.7.3", + "source": { + "type": "git", + "url": "https://github.com/filp/whoops.git", + "reference": "5d5fe9bb3d656b514d455645b3addc5f7ba7714d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/filp/whoops/zipball/5d5fe9bb3d656b514d455645b3addc5f7ba7714d", + "reference": "5d5fe9bb3d656b514d455645b3addc5f7ba7714d", + "shasum": "" + }, + "require": { + "php": "^5.5.9 || ^7.0", + "psr/log": "^1.0.1" + }, + "require-dev": { + "mockery/mockery": "^0.9 || ^1.0", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0", + "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0" + }, + "suggest": { + "symfony/var-dumper": "Pretty print complex values better with var-dumper available", + "whoops/soap": "Formats errors as SOAP responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Whoops\\": "src/Whoops/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Filipe Dobreira", + "homepage": "https://github.com/filp", + "role": "Developer" + } + ], + "description": "php error handling for cool kids", + "homepage": "https://filp.github.io/whoops/", + "keywords": [ + "error", + "exception", + "handling", + "library", + "throwable", + "whoops" + ], + "time": "2020-06-14 09:00:00" + }, + { + "name": "kint-php/kint", + "version": "1.1", + "source": { + "type": "git", + "url": "https://github.com/kint-php/kint.git", + "reference": "a8549198558560b24e2879c6bac2875de5371483" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kint-php/kint/zipball/a8549198558560b24e2879c6bac2875de5371483", + "reference": "a8549198558560b24e2879c6bac2875de5371483", + "shasum": "" + }, + "require": { + "php": ">=5.1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "files": [ + "Kint.class.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Rokas Šleinius", + "homepage": "https://github.com/kint-php" + }, + { + "name": "Contributors", + "homepage": "https://github.com/kint-php/kint/contributors" + } + ], + "description": "Kint - debugging helper for PHP developers", + "homepage": "https://github.com/kint-php/kint", + "keywords": [ + "debug", + "kint", + "php" + ], + "time": "2017-01-15 14:23:43" + }, + { + "name": "maximebf/debugbar", + "version": "v1.16.3", + "source": { + "type": "git", + "url": "https://github.com/maximebf/php-debugbar.git", + "reference": "1a1605b8e9bacb34cc0c6278206d699772e1d372" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/1a1605b8e9bacb34cc0c6278206d699772e1d372", + "reference": "1a1605b8e9bacb34cc0c6278206d699772e1d372", + "shasum": "" + }, + "require": { + "php": "^7.1", + "psr/log": "^1.0", + "symfony/var-dumper": "^2.6|^3|^4|^5" + }, + "require-dev": { + "phpunit/phpunit": "^5" + }, + "suggest": { + "kriswallsmith/assetic": "The best way to manage assets", + "monolog/monolog": "Log using Monolog", + "predis/predis": "Redis storage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.16-dev" + } + }, + "autoload": { + "psr-4": { + "DebugBar\\": "src/DebugBar/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Maxime Bouroumeau-Fuseau", + "email": "maxime.bouroumeau@gmail.com", + "homepage": "http://maximebf.com" + }, + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "Debug bar in the browser for php application", + "homepage": "https://github.com/maximebf/php-debugbar", + "keywords": [ + "debug", + "debugbar" + ], + "time": "2020-05-06 07:06:27" + }, + { + "name": "psr/log", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2020-03-23 09:12:05" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.18.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2020-07-14 12:35:20" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.18.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/d87d5766cbf48d72388a9f6b85f280c8ad51f981", + "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981", + "shasum": "" + }, + "require": { + "php": ">=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2020-07-14 12:35:20" + }, + { + "name": "symfony/var-dumper", + "version": "v4.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "1bef32329f3166486ab7cb88599cae4875632b99" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/1bef32329f3166486ab7cb88599cae4875632b99", + "reference": "1bef32329f3166486ab7cb88599cae4875632b99", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php72": "~1.5", + "symfony/polyfill-php80": "^1.15" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/console": "<3.4" + }, + "require-dev": { + "ext-iconv": "*", + "symfony/console": "^3.4|^4.0|^5.0", + "symfony/process": "^4.4|^5.0", + "twig/twig": "^1.34|^2.4|^3.0" + }, + "suggest": { + "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", + "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" + }, + "bin": [ + "Resources/bin/var-dump-server" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony mechanism for exploring and dumping PHP variables", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "time": "2020-08-17 07:31:35" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^5.5|^7.0" + }, + "platform-dev": [] +} diff --git a/frontend/drupal/modules/simpletest/tests/request_sanitizer.test b/frontend/drupal/modules/simpletest/tests/request_sanitizer.test new file mode 100644 index 000000000..9fc811b2f --- /dev/null +++ b/frontend/drupal/modules/simpletest/tests/request_sanitizer.test @@ -0,0 +1,354 @@ + 'DrupalRequestSanitizer', + 'description' => 'Test the DrupalRequestSanitizer class', + 'group' => 'System', + ); + } + + /** + * {@inheritdoc} + */ + protected function setUp() { + require_once DRUPAL_ROOT . '/includes/request-sanitizer.inc'; + parent::setUp(); + set_error_handler(array($this, "sanitizerTestErrorHandler")); + } + + /** + * Iterate through all the RequestSanitizerTests. + */ + public function testRequestSanitization() { + foreach ($this->requestSanitizerTests() as $label => $data) { + $this->errors = array(); + // Normalize the test parameters. + $test = array( + 'request' => $data[0], + 'expected' => isset($data[1]) ? $data[1] : array(), + 'expected_errors' => isset($data[2]) ? $data[2] : NULL, + 'whitelist' => isset($data[3]) ? $data[3] : array(), + ); + $this->requestSanitizationTest($test['request'], $test['expected'], $test['expected_errors'], $test['whitelist'], $label); + } + } + + /** + * Tests RequestSanitizer class. + * + * @param \SanitizerTestRequest $request + * The request to sanitize. + * @param array $expected + * An array of expected request parameters after sanitization. + * @param array|null $expected_errors + * An array of expected errors. If set to NULL then error logging is + * disabled. + * @param array $whitelist + * An array of keys to whitelist and not sanitize. + * @param string $label + * A descriptive name for each test / group of assertions. + * + * @throws \ReflectionException + */ + public function requestSanitizationTest(SanitizerTestRequest $request, array $expected = array(), array $expected_errors = NULL, array $whitelist = array(), $label = NULL) { + // Set up globals. + $_GET = $request->getQuery(); + $_POST = $request->getRequest(); + $_COOKIE = $request->getCookies(); + $_REQUEST = array_merge($request->getQuery(), $request->getRequest()); + + $GLOBALS['conf']['sanitize_input_whitelist'] = $whitelist; + $GLOBALS['conf']['sanitize_input_logging'] = is_null($expected_errors) ? FALSE : TRUE; + if ($label !== 'already sanitized request') { + $reflection = new \ReflectionProperty('DrupalRequestSanitizer', 'sanitized'); + $reflection->setAccessible(TRUE); + $reflection->setValue(NULL, FALSE); + } + DrupalRequestSanitizer::sanitize(); + if (isset($_GET['destination'])) { + DrupalRequestSanitizer::cleanDestination(); + } + + // Normalise the expected data. + $expected += array( + 'cookies' => array(), + 'query' => array(), + 'request' => array(), + ); + + // Test PHP globals. + $this->assertEqualLabelled($expected['cookies'], $_COOKIE, NULL, 'Other', $label . ' (COOKIE)'); + $this->assertEqualLabelled($expected['query'], $_GET, NULL, 'Other', $label . ' (GET)'); + $this->assertEqualLabelled($expected['request'], $_POST, NULL, 'Other', $label . ' (POST)'); + $expected_request = array_merge($expected['query'], $expected['request']); + $this->assertEqualLabelled($expected_request, $_REQUEST, NULL, 'Other', $label . ' (REQUEST)'); + + // Ensure any expected errors have been triggered. + if (!empty($expected_errors)) { + foreach ($expected_errors as $expected_error) { + $this->assertError($expected_error, E_USER_NOTICE, $label . ' (errors)'); + } + } + else { + $this->assertEqualLabelled(array(), $this->errors, NULL, 'Other', $label . ' (errors)'); + } + } + + /** + * Data provider for testRequestSanitization. + * + * @return array + * A list of tests to carry out. + */ + public function requestSanitizerTests() { + $tests = array(); + + $request = new SanitizerTestRequest(array('q' => 'index.php')); + $tests['no sanitization GET'] = array($request, array('query' => array('q' => 'index.php'))); + + $request = new SanitizerTestRequest(array(), array('field' => 'value')); + $tests['no sanitization POST'] = array($request, array('request' => array('field' => 'value'))); + + $request = new SanitizerTestRequest(array(), array(), array(), array('key' => 'value')); + $tests['no sanitization COOKIE'] = array($request, array('cookies' => array('key' => 'value'))); + + $request = new SanitizerTestRequest(array('q' => 'index.php'), array('field' => 'value'), array(), array('key' => 'value')); + $tests['no sanitization GET, POST, COOKIE'] = array($request, array('query' => array('q' => 'index.php'), 'request' => array('field' => 'value'), 'cookies' => array('key' => 'value'))); + + $request = new SanitizerTestRequest(array('q' => 'index.php')); + $tests['no sanitization GET log'] = array($request, array('query' => array('q' => 'index.php')), array()); + + $request = new SanitizerTestRequest(array(), array('field' => 'value')); + $tests['no sanitization POST log'] = array($request, array('request' => array('field' => 'value')), array()); + + $request = new SanitizerTestRequest(array(), array(), array(), array('key' => 'value')); + $tests['no sanitization COOKIE log'] = array($request, array('cookies' => array('key' => 'value')), array()); + + $request = new SanitizerTestRequest(array('#q' => 'index.php')); + $tests['sanitization GET'] = array($request); + + $request = new SanitizerTestRequest(array(), array('#field' => 'value')); + $tests['sanitization POST'] = array($request); + + $request = new SanitizerTestRequest(array(), array(), array(), array('#key' => 'value')); + $tests['sanitization COOKIE'] = array($request); + + $request = new SanitizerTestRequest(array('#q' => 'index.php'), array('#field' => 'value'), array(), array('#key' => 'value')); + $tests['sanitization GET, POST, COOKIE'] = array($request); + + $request = new SanitizerTestRequest(array('#q' => 'index.php')); + $tests['sanitization GET log'] = array($request, array(), array('Potentially unsafe keys removed from query string parameters (GET): #q')); + + $request = new SanitizerTestRequest(array(), array('#field' => 'value')); + $tests['sanitization POST log'] = array($request, array(), array('Potentially unsafe keys removed from request body parameters (POST): #field')); + + $request = new SanitizerTestRequest(array(), array(), array(), array('#key' => 'value')); + $tests['sanitization COOKIE log'] = array($request, array(), array('Potentially unsafe keys removed from cookie parameters (COOKIE): #key')); + + $request = new SanitizerTestRequest(array('#q' => 'index.php'), array('#field' => 'value'), array(), array('#key' => 'value')); + $tests['sanitization GET, POST, COOKIE log'] = array($request, array(), array('Potentially unsafe keys removed from query string parameters (GET): #q', 'Potentially unsafe keys removed from request body parameters (POST): #field', 'Potentially unsafe keys removed from cookie parameters (COOKIE): #key')); + + $request = new SanitizerTestRequest(array('q' => 'index.php', 'foo' => array('#bar' => 'foo'))); + $tests['recursive sanitization log'] = array($request, array('query' => array('q' => 'index.php', 'foo' => array())), array('Potentially unsafe keys removed from query string parameters (GET): #bar')); + + $request = new SanitizerTestRequest(array('q' => 'index.php', 'foo' => array('#bar' => 'foo'))); + $tests['recursive no sanitization whitelist'] = array($request, array('query' => array('q' => 'index.php', 'foo' => array('#bar' => 'foo'))), array(), array('#bar')); + + $request = new SanitizerTestRequest(array(), array('#field' => 'value')); + $tests['no sanitization POST whitelist'] = array($request, array('request' => array('#field' => 'value')), array(), array('#field')); + + $request = new SanitizerTestRequest(array('q' => 'index.php', 'foo' => array('#bar' => 'foo', '#foo' => 'bar'))); + $tests['recursive multiple sanitization log'] = array($request, array('query' => array('q' => 'index.php', 'foo' => array())), array('Potentially unsafe keys removed from query string parameters (GET): #bar, #foo')); + + $request = new SanitizerTestRequest(array('#q' => 'index.php')); + $tests['already sanitized request'] = array($request, array('query' => array('#q' => 'index.php'))); + + $request = new SanitizerTestRequest(array('destination' => 'whatever?%23test=value')); + $tests['destination removal GET'] = array($request); + + $request = new SanitizerTestRequest(array('destination' => 'whatever?%23test=value')); + $tests['destination removal GET log'] = array($request, array(), array('Potentially unsafe destination removed from query string parameters (GET) because it contained the following keys: #test')); + + $request = new SanitizerTestRequest(array('destination' => 'whatever?q[%23test]=value')); + $tests['destination removal subkey'] = array($request); + + $request = new SanitizerTestRequest(array('destination' => 'whatever?q[%23test]=value')); + $tests['destination whitelist'] = array($request, array('query' => array('destination' => 'whatever?q[%23test]=value')), array(), array('#test')); + + $request = new SanitizerTestRequest(array('destination' => "whatever?\x00bar=base&%23test=value")); + $tests['destination removal zero byte'] = array($request); + + $request = new SanitizerTestRequest(array('destination' => 'whatever?q=value')); + $tests['destination kept'] = array($request, array('query' => array('destination' => 'whatever?q=value'))); + + $request = new SanitizerTestRequest(array('destination' => 'whatever')); + $tests['destination no query'] = array($request, array('query' => array('destination' => 'whatever'))); + + return $tests; + } + + /** + * Catches and logs errors to $this->errors. + * + * @param int $errno + * The severity level of the error. + * @param string $errstr + * The error message. + */ + public function sanitizerTestErrorHandler($errno, $errstr) { + $this->errors[] = compact('errno', 'errstr'); + } + + /** + * Asserts that the expected error has been logged. + * + * @param string $errstr + * The error message. + * @param int $errno + * The severity level of the error. + * @param string $label + * The label to include with the message. + * + * @return bool + * TRUE if the assertion succeeded, FALSE otherwise. + */ + protected function assertError($errstr, $errno, $label) { + $label = (empty($label)) ? '' : $label . ': '; + foreach ($this->errors as $error) { + if ($error['errstr'] === $errstr && $error['errno'] === $errno) { + return $this->pass($label . "Error with level $errno and message '$errstr' found"); + } + } + return $this->fail($label . "Error with level $errno and message '$errstr' not found in " . var_export($this->errors, TRUE)); + } + + /** + * Asserts two values are equal, includes a label. + * + * @param mixed $first + * The first value to check. + * @param mixed $second + * The second value to check. + * @param string $message + * The message to display along with the assertion. + * @param string $group + * The type of assertion - examples are "Browser", "PHP". + * @param string $label + * The label to include with the message. + * + * @return bool + * TRUE if the assertion succeeded, FALSE otherwise. + */ + protected function assertEqualLabelled($first, $second, $message = '', $group = 'Other', $label = '') { + $label = (empty($label)) ? '' : $label . ': '; + $message = $message ? $message : t('Value @first is equal to value @second.', array( + '@first' => var_export($first, TRUE), + '@second' => var_export($second, TRUE), + )); + return $this->assert($first == $second, $label . $message, $group); + } + +} + +/** + * Basic HTTP Request class. + */ +class SanitizerTestRequest { + + /** + * The query (GET). + * + * @var array + */ + protected $query; + + /** + * The request (POST). + * + * @var array + */ + protected $request; + + /** + * The request attributes. + * + * @var array + */ + protected $attributes; + + /** + * The request cookies. + * + * @var array + */ + protected $cookies; + + /** + * Constructor. + * + * @param array $query + * The GET parameters. + * @param array $request + * The POST parameters. + * @param array $attributes + * The request attributes. + * @param array $cookies + * The COOKIE parameters. + */ + public function __construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array()) { + $this->query = $query; + $this->request = $request; + $this->attributes = $attributes; + $this->cookies = $cookies; + } + + /** + * Getter for $query. + */ + public function getQuery() { + return $this->query; + } + + /** + * Getter for $request. + */ + public function getRequest() { + return $this->request; + } + + /** + * Getter for $attributes. + */ + public function getAttributes() { + return $this->attributes; + } + + /** + * Getter for $cookies. + */ + public function getCookies() { + return $this->cookies; + } + +} diff --git a/frontend/payments/cebelica/InvoiceFox/cebelcaApi.php b/frontend/payments/cebelica/InvoiceFox/cebelcaApi.php index cef910a34..c8e4424c1 100644 --- a/frontend/payments/cebelica/InvoiceFox/cebelcaApi.php +++ b/frontend/payments/cebelica/InvoiceFox/cebelcaApi.php @@ -47,12 +47,14 @@ function racunIzPredracuna($api,$podatki,$proformaId,$lang='si') { // nastavi, da je plačano $api->markPayed($header); - // kartica in gotovina se potrjujeta - if($tip_placila == 3){ + // kartica in paypal se potrjujeta + if($tip_placila == 3 || $tip_placila == 5){ + $id_location = ($tip_placila == 5) ? 4 : 2; + $glava = array ( 'id' => $invId, - "id_location" => 2, + "id_location" => $id_location, "id_register" => 1, "fiscalize" => 1, 'op-tax-id' => IZDAJATELJ_DAVCNA, diff --git a/frontend/payments/classes/class.ApiNarocilaController.php b/frontend/payments/classes/class.ApiNarocilaController.php index cf6835dba..56cabb955 100644 --- a/frontend/payments/classes/class.ApiNarocilaController.php +++ b/frontend/payments/classes/class.ApiNarocilaController.php @@ -252,6 +252,34 @@ class ApiNarocilaController{ $this->response = $price; break; + + // Dokoncaj narocilo ce je placano preko paypala (ko je stranka potrdila placilo v paypalu) + case 'capture_narocilo_paypal': + + if(isset($this->data['narocilo_id'])){ + $paypal = new UserNarocilaPaypal($this->data['narocilo_id']); + $this->response = $narocilo->paypalCaptureOrder(); + } + else{ + $this->response['error'] = 'Napaka! Manjka ID narocila!'; + $this->response['success'] = false; + } + + break; + + // Preklici narocilo za paypal (ko je stranka preklicala placilo v paypalu) + case 'cancel_narocilo_paypal': + + if(isset($this->data['narocilo_id'])){ + $paypal = new UserNarocilaPaypal($this->data['narocilo_id']); + $this->response = $narocilo->paypalCaptureOrder(); + } + else{ + $this->response['error'] = 'Napaka! Manjka ID narocila!'; + $this->response['success'] = false; + } + + break; } } } diff --git a/frontend/payments/classes/class.UserNarocila.php b/frontend/payments/classes/class.UserNarocila.php index 70a9fe97b..c6325fa20 100644 --- a/frontend/payments/classes/class.UserNarocila.php +++ b/frontend/payments/classes/class.UserNarocila.php @@ -658,6 +658,8 @@ class UserNarocila{ if($usr_id <= 0){ $response['error'] = 'ERROR! Missing user ID.'; + $response['success'] = false; + return $response; } @@ -695,6 +697,8 @@ class UserNarocila{ "); if (!$sqlNarocilo){ $response['error'] = 'ERROR! '.mysqli_error($GLOBALS['connect_db']); + $response['success'] = false; + return $response; } @@ -724,7 +728,6 @@ class UserNarocila{ } - return $response; } @@ -764,6 +767,8 @@ class UserNarocila{ } catch (Exception $e){ $response['error'] = 'ERROR! Sending email with invoice failed.'; + $response['success'] = false; + return $response; } @@ -779,6 +784,8 @@ class UserNarocila{ $token = isset($narocilo_data['stripe_id']) ? $narocilo_data['stripe_id'] : ''; if($token == ''){ $response['error'] = 'ERROR! Missing token.'; + $response['success'] = false; + return $response; } @@ -800,10 +807,12 @@ class UserNarocila{ } else{ $response['error'] = $payment_response['error']; + $response['success'] = false; } } else{ $response['error'] = $stripe_response['error']; + $response['success'] = false; } $response['narocilo_id'] = $narocilo_id; @@ -816,14 +825,29 @@ class UserNarocila{ global $lang; $response = array(); - $response['narocilo_id'] = $narocilo_id; + + // Inicializiramo paypal + $paypal = new UserNarocilaPaypal($narocilo_id); + + // Ustvarimo paypal placilo in vrnemo url, da se uporabnik prijavi v paypal in potrdi placilo + $paypal_response = $paypal->paypalCreatePayment(); + + // Ce je bilo placilo preko stripa uspesno zgeneriramo racun in uporabniku aktiviramo paket + if($paypal_response['success'] == true){ + $response['paypal_link'] = $paypal_response['paypal_link']; + $response['success'] = true; + } + else{ + $response['error'] = $paypal_response['error']; + $response['success'] = false; + } return $response; } - // Posodobi obstojece narocilo za uporabnika - ZA TESTIRATI + // Posodobi obstojece narocilo za uporabnika public function updateNarocilo($narocilo_data){ global $global_user_id; @@ -832,6 +856,7 @@ class UserNarocila{ // ce nimamo id-ja narocila vrnemo error if(!isset($narocilo_data['narocilo_id']) || $narocilo_data['narocilo_id'] == '0'){ $response['error'] = 'Napaka! Manjka ID narocila!'; + $response['success'] = false; return $response; } @@ -862,6 +887,8 @@ class UserNarocila{ $sqlNarocilo = sisplet_query("UPDATE user_access_narocilo SET ".$update.", cebelica_id_racun='0', cebelica_id_predracun='0' WHERE id='".$narocilo_data['narocilo_id']."'"); if (!$sqlNarocilo){ $response['error'] = 'ERROR! '.mysqli_error($GLOBALS['connect_db']); + $response['success'] = false; + return $response; } @@ -880,6 +907,7 @@ class UserNarocila{ // Ce nimamo id-ja narocila vrnemo error if($narocilo_id == 0){ $response['error'] = 'Napaka! Manjka ID narocila!'; + $response['success'] = false; return $response; } @@ -892,6 +920,7 @@ class UserNarocila{ // Ce je bil racun ze placan ne naredimo nicesar if($rowNarocilo['status'] == 1){ $response['error'] = 'Napaka! Račun je že plačan!'; + $response['success'] = false; return $response; } @@ -922,6 +951,8 @@ class UserNarocila{ "); if (!$sqlAccess){ $response['error'] = 'ERROR! '.mysqli_error($GLOBALS['connect_db']); + $response['success'] = false; + return $response; } } @@ -930,6 +961,8 @@ class UserNarocila{ $sqlAccess = sisplet_query("UPDATE user_access SET time_expire = time_expire + INTERVAL '".$rowNarocilo['trajanje']."' MONTH WHERE usr_id='".$rowNarocilo['usr_id']."'"); if (!$sqlAccess){ $response['error'] = 'ERROR! '.mysqli_error($GLOBALS['connect_db']); + $response['success'] = false; + return $response; } } @@ -946,6 +979,8 @@ class UserNarocila{ "); if (!$sqlAccess){ $response['error'] = 'ERROR! '.mysqli_error($GLOBALS['connect_db']); + $response['success'] = false; + return $response; } } @@ -955,6 +990,8 @@ class UserNarocila{ $sqlNarociloStatus = sisplet_query("UPDATE user_access_narocilo SET status='1' WHERE id='".$narocilo_id."'"); if (!$sqlNarociloStatus){ $response['error'] = 'ERROR! '.mysqli_error($GLOBALS['connect_db']); + $response['success'] = false; + return $response; } diff --git a/frontend/payments/classes/class.UserNarocilaPaypal.php b/frontend/payments/classes/class.UserNarocilaPaypal.php new file mode 100644 index 000000000..85906d6c0 --- /dev/null +++ b/frontend/payments/classes/class.UserNarocilaPaypal.php @@ -0,0 +1,274 @@ + 0){ + + // Dobimo podatke narocila + $sqlNarocilo = sisplet_query("SELECT un.*, u.name, u.surname, u.email, up.name AS package_name, up.description AS package_description, up.price AS package_price + FROM user_access_narocilo un, users u, user_access_paket up + WHERE un.id='".$narocilo_id."' AND un.usr_id=u.id AND un.package_id=up.id"); + if(mysqli_num_rows($sqlNarocilo) > 0){ + $this->narocilo = mysqli_fetch_array($sqlNarocilo); + } + else{ + die("Napaka pri komunikaciji s paypal! Narocilo ne obstaja."); + } + + + // Ustvarimo okolje za paypal + if($mysql_database_name == 'real1kasi') + $environment = new ProductionEnvironment($paypal_client_id, $paypal_secret); + else + $environment = new SandboxEnvironment($paypal_client_id, $paypal_secret); + + $this->paypal_client = new PayPalHttpClient($environment); + } + else { + die("Napaka pri komunikaciji s paypal! Manjka ID naročila."); + } + } + + + // Placamo narocilo s paypal + public function paypalCreatePayment(){ + global $site_url; + + $response = array(); + + + $UA = new UserNarocila(); + $cena = $UA->getPrice($this->narocilo['package_name'], $this->narocilo['trajanje'], $this->narocilo['discount']); + + if($this->narocilo['trajanje'] == 1) + $months_string = 'mesec'; + elseif($this->narocilo['trajanje'] == 2) + $months_string = 'meseca'; + elseif($this->narocilo['trajanje'] == 3 || $this->narocilo['trajanje'] == 4) + $months_string = 'mesece'; + else + $months_string = 'mesecev'; + + + // Zavezanec iz tujine ima racun/predracun brez ddv + if($UA->isWithoutDDV($this->narocilo['id'])){ + $ddv = 0; + $cena_za_placilo = $cena['final_without_tax']; + } + else{ + $ddv = 1; + $cena_za_placilo = $cena['final']; + } + + + // Podatki narocila + $orderDetails = array( + 'ime' => '1KA naročnina (paket '.strtoupper($this->narocilo['package_name']). ' - '.$this->narocilo['trajanje'].' '.$months_string.')', + 'narocilo_id' => $this->narocilo['id'], + 'cena' => $cena_za_placilo, + ); + + // Ustvarimo order na paypal, da se lahko potem user prijavi in ga placa + $paypal_response = $this->paypalCreateOrder($orderDetails); + + if(!isset($paypal_response['success']) || $paypal_response['success'] == false){ + return $paypal_response; + } + + + // Vstavimo plačilo v bazo + $sqlNarocilo = sisplet_query("INSERT INTO user_access_paypal_transaction + (transaction_id, narocilo_id, price, currency_type, time) + VALUES + ('".$paypal_response['transaction_id']."', '".$this->narocilo['id']."', '".$cena_za_placilo."', 'EUR', NOW()) + "); + if (!$sqlNarocilo){ + $response['error'] = 'ERROR! '.mysqli_error($GLOBALS['connect_db']); + $response['success'] = false; + + return $response; + } + + + $response['paypal_link'] = $paypal_response['paypal_link']; + + $response['success'] = true; + + return $response; + } + + // Posljemo podatke za placilo paypalu + private function paypalCreateOrder($orderDetails){ + global $site_url; + + $response = array(); + + $request = new OrdersCreateRequest(); + + $request->prefer('return=representation'); + //$request->headers["prefer"] = "return=representation"; + + $request->body = [ + "intent" => "CAPTURE", + "purchase_units" => [[ + "reference_id" => $orderDetails['narocilo_id'], + 'description' => $orderDetails['ime'], + + "amount" => [ + "value" => $orderDetails['cena'], + "currency_code" => "EUR" + ] + ]], + "application_context" => [ + "cancel_url" => $site_url . '/d/narocilo/paypal-cancel?narocilo_id='.$orderDetails['narocilo_id'], + "return_url" => $site_url . '/d/narocilo/paypal?narocilo_id='.$orderDetails['narocilo_id'], + + 'brand_name' => '1KA' + ] + ]; + + try { + // Poklicemo paypal api za ustvarjanje narocila + $paypal_response = $this->paypal_client->execute($request); + + if($paypal_response->result->status != 'CREATED'){ + $response['error'] = 'ERROR! Order was not created.'; + $response['success'] = false; + + return $response; + } + + // Dobimo id paypal narocila + $response['transaction_id'] = $paypal_response->result->id; + + // Dobimo link za preusmeritev stranke, da potrdi narocilo in potem lahko izvedemo "capture" + foreach($paypal_response->result->links as $link){ + + if($link->rel == 'capture') + $response['paypal_link'] = $link->href; + } + } + catch (HttpException $e) { + $response['error'] = $e->getMessage(); + $response['success'] = false; + + return $response; + } + + + $response['success'] = true; + + return $response; + } + + + // Zakljucimo placilo, ce je bilo placilo ok odobreno preko paypala s strani stranke + public function paypalCaptureOrder(){ + + $response = array(); + + // Preverimo plačilo v bazo + $sqlNarociloPaypal = sisplet_query("SELECT transaction_id + FROM user_access_paypal_transaction + WHERE narocilo_id='".$this->narocilo['id']."' + "); + if (!$sqlNarociloPaypal){ + $response['error'] = 'ERROR! '.mysqli_error($GLOBALS['connect_db']); + $response['success'] = false; + + return $response; + } + + // Narocilo ne obstaja (ni v bazi paypal narocil) + if (mysqli_num_rows($sqlNarociloPaypal) == 0){ + $response['error'] = 'ERROR! Paypal order does not exist.'; + $response['success'] = false; + + return $response; + } + + $rowNarociloPaypal = mysqli_fetch_array($sqlNarociloPaypal); + + // Preverimo, ce je bilo vse ok placano - POST request to /v2/checkout/orders + $request = new OrdersCaptureRequest($rowNarociloPaypal['transaction_id']); + //$request->prefer('return=representation'); + + try { + // Poklicemo paypal api kjer preverimo placilo narocila + $paypal_response = $this->paypal_client->execute($request); + } + catch (HttpException $e) { + $response['error'] = $e->getMessage(); + $response['success'] = false; + + return $response; + } + + + // Posodobimo status narocila + $sqlNarocilo = sisplet_query("UPDATE user_access_paypal_transaction + SET status='".$paypal_response->result->status."' + WHERE transaction_id='".$paypal_response->result->id."' + "); + if (!$sqlNarocilo){ + $response['error'] = 'ERROR! '.mysqli_error($GLOBALS['connect_db']); + $response['success'] = false; + + return $response; + } + + + $response['status'] = $paypal_response->result->status; + + $response['success'] = true; + + return $response; + } + + + // Preklicemo placilo, ce je bilo placilo preklicano preko paypala s strani stranke + public function paypalCancelOrder(){ + + $response = array(); + + // Posodobimo status narocila + $sqlNarocilo = sisplet_query("UPDATE user_access_paypal_transaction + SET status='CANCELED' + WHERE narocilo_id='".$this->narocilo['id']."' + "); + if (!$sqlNarocilo){ + $response['error'] = 'ERROR! '.mysqli_error($GLOBALS['connect_db']); + $response['success'] = false; + + return $response; + } + + $response['success'] = true; + + return $response; + } +} \ No newline at end of file diff --git a/frontend/payments/classes/class.UserNarocilaStripe.php b/frontend/payments/classes/class.UserNarocilaStripe.php index 321efe44e..2469c5a8f 100644 --- a/frontend/payments/classes/class.UserNarocilaStripe.php +++ b/frontend/payments/classes/class.UserNarocilaStripe.php @@ -106,6 +106,8 @@ class UserNarocilaStripe{ "); if (!$sqlNarocilo){ $response['error'] = 'ERROR! '.mysqli_error($GLOBALS['connect_db']); + $response['success'] = false; + return $response; } $response = array(); @@ -124,6 +126,7 @@ class UserNarocilaStripe{ // Placilo ni uspelo else{ $response['error'] = 'ERROR! Stripe payment failed. Failure code '.$stripeResponse['failure_code']; + $response['success'] = false; } return $response; diff --git a/frontend/payments/paypal-cancel.php b/frontend/payments/paypal-cancel.php new file mode 100644 index 000000000..52fc9bd74 --- /dev/null +++ b/frontend/payments/paypal-cancel.php @@ -0,0 +1,171 @@ + $value) { + if($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) { + $value = urlencode(stripslashes($value)); + } else { + $value = urlencode($value); + } + $req .= "&$key=$value"; +} + + +// Post IPN data back to PayPal to validate the IPN data is genuine +// Without this step anyone can fake IPN data +if(USE_SANDBOX == true) { + $paypal_url = "https://www.sandbox.paypal.com/cgi-bin/webscr"; +} +else { + $paypal_url = "https://www.paypal.com/cgi-bin/webscr"; +} + +$ch = curl_init($paypal_url); +if ($ch == FALSE) { + return FALSE; +} + + +curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); +curl_setopt($ch, CURLOPT_POST, 1); +curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); +curl_setopt($ch, CURLOPT_POSTFIELDS, $req); +curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); +curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); +curl_setopt($ch, CURLOPT_FORBID_REUSE, 1); + +if(DEBUG == true) { + curl_setopt($ch, CURLOPT_HEADER, 1); + curl_setopt($ch, CURLINFO_HEADER_OUT, 1); +} + + + +// CONFIG: Optional proxy configuration +//curl_setopt($ch, CURLOPT_PROXY, $proxy); +//curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); +// Set TCP timeout to 30 seconds +curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); +curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close')); +// CONFIG: Please download 'cacert.pem' from "http://curl.haxx.se/docs/caextract.html" and set the directory path +// of the certificate as shown below. Ensure the file is readable by the webserver. +// This is mandatory for some environments. +//$cert = __DIR__ . "./cacert.pem"; +//curl_setopt($ch, CURLOPT_CAINFO, $cert); +$res = curl_exec($ch); +if (curl_errno($ch) != 0) // cURL error + { + if(DEBUG == true) { + error_log(date('[Y-m-d H:i e] '). "Can't connect to PayPal to validate IPN message: " . curl_error($ch) . PHP_EOL, 3, LOG_FILE); + } + curl_close($ch); + exit; +} +else { + // Log the entire HTTP response if debug is switched on. + if(DEBUG == true) { + error_log(date('[Y-m-d H:i e] '). "HTTP request of validation request:". curl_getinfo($ch, CURLINFO_HEADER_OUT) ." for IPN payload: $req" . PHP_EOL, 3, LOG_FILE); + error_log(date('[Y-m-d H:i e] '). "HTTP response of validation request: $res" . PHP_EOL, 3, LOG_FILE); + } + curl_close($ch); +} + + + +// Inspect IPN validation result and act accordingly +// Split response headers and payload, a better way for strcmp +$tokens = explode("\r\n\r\n", trim($res)); +$res = trim(end($tokens)); +if (strcmp ($res, "VERIFIED") == 0) { + // assign posted variables to local variables + $item_name = $_POST['item_name']; + $item_number = $_POST['item_number']; + $payment_status = $_POST['payment_status']; + $payment_amount = $_POST['mc_gross']; + $payment_currency = $_POST['mc_currency']; + $txn_id = $_POST['txn_id']; + $receiver_email = $_POST['receiver_email']; + $payer_email = $_POST['payer_email']; + + include("DBController.php"); + $db = new DBController(); + + // check whether the payment_status is Completed + $isPaymentCompleted = false; + if($payment_status == "Completed") { + $isPaymentCompleted = true; + } + // check that txn_id has not been previously processed + $isUniqueTxnId = false; + $param_type="s"; + $param_value_array = array($txn_id); + $result = $db->runQuery("SELECT * FROM payment WHERE txn_id = ?",$param_type,$param_value_array); + if(empty($result)) { + $isUniqueTxnId = true; + } + // check that receiver_email is your PayPal email + // check that payment_amount/payment_currency are correct + if($isPaymentCompleted) { + $param_type = "sssdss"; + $param_value_array = array($item_number, $item_name, $payment_status, $payment_amount, $payment_currency, $txn_id); + $payment_id = $db->insert("INSERT INTO payment(item_number, item_name, payment_status, payment_amount, payment_currency, txn_id) VALUES(?, ?, ?, ?, ?, ?)", $param_type, $param_value_array); + + } + // process payment and mark item as paid. + + + if(DEBUG == true) { + error_log(date('[Y-m-d H:i e] '). "Verified IPN: $req ". PHP_EOL, 3, LOG_FILE); + } + +} +else if (strcmp ($res, "INVALID") == 0) { + // log for manual investigation + // Add business logic here which deals with invalid IPN messages + if(DEBUG == true) { + error_log(date('[Y-m-d H:i e] '). "Invalid IPN: $req" . PHP_EOL, 3, LOG_FILE); + } +} + + +?> \ No newline at end of file diff --git a/frontend/payments/paypal-pay.php b/frontend/payments/paypal-pay.php new file mode 100644 index 000000000..52fc9bd74 --- /dev/null +++ b/frontend/payments/paypal-pay.php @@ -0,0 +1,171 @@ + $value) { + if($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) { + $value = urlencode(stripslashes($value)); + } else { + $value = urlencode($value); + } + $req .= "&$key=$value"; +} + + +// Post IPN data back to PayPal to validate the IPN data is genuine +// Without this step anyone can fake IPN data +if(USE_SANDBOX == true) { + $paypal_url = "https://www.sandbox.paypal.com/cgi-bin/webscr"; +} +else { + $paypal_url = "https://www.paypal.com/cgi-bin/webscr"; +} + +$ch = curl_init($paypal_url); +if ($ch == FALSE) { + return FALSE; +} + + +curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); +curl_setopt($ch, CURLOPT_POST, 1); +curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); +curl_setopt($ch, CURLOPT_POSTFIELDS, $req); +curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); +curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); +curl_setopt($ch, CURLOPT_FORBID_REUSE, 1); + +if(DEBUG == true) { + curl_setopt($ch, CURLOPT_HEADER, 1); + curl_setopt($ch, CURLINFO_HEADER_OUT, 1); +} + + + +// CONFIG: Optional proxy configuration +//curl_setopt($ch, CURLOPT_PROXY, $proxy); +//curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); +// Set TCP timeout to 30 seconds +curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); +curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close')); +// CONFIG: Please download 'cacert.pem' from "http://curl.haxx.se/docs/caextract.html" and set the directory path +// of the certificate as shown below. Ensure the file is readable by the webserver. +// This is mandatory for some environments. +//$cert = __DIR__ . "./cacert.pem"; +//curl_setopt($ch, CURLOPT_CAINFO, $cert); +$res = curl_exec($ch); +if (curl_errno($ch) != 0) // cURL error + { + if(DEBUG == true) { + error_log(date('[Y-m-d H:i e] '). "Can't connect to PayPal to validate IPN message: " . curl_error($ch) . PHP_EOL, 3, LOG_FILE); + } + curl_close($ch); + exit; +} +else { + // Log the entire HTTP response if debug is switched on. + if(DEBUG == true) { + error_log(date('[Y-m-d H:i e] '). "HTTP request of validation request:". curl_getinfo($ch, CURLINFO_HEADER_OUT) ." for IPN payload: $req" . PHP_EOL, 3, LOG_FILE); + error_log(date('[Y-m-d H:i e] '). "HTTP response of validation request: $res" . PHP_EOL, 3, LOG_FILE); + } + curl_close($ch); +} + + + +// Inspect IPN validation result and act accordingly +// Split response headers and payload, a better way for strcmp +$tokens = explode("\r\n\r\n", trim($res)); +$res = trim(end($tokens)); +if (strcmp ($res, "VERIFIED") == 0) { + // assign posted variables to local variables + $item_name = $_POST['item_name']; + $item_number = $_POST['item_number']; + $payment_status = $_POST['payment_status']; + $payment_amount = $_POST['mc_gross']; + $payment_currency = $_POST['mc_currency']; + $txn_id = $_POST['txn_id']; + $receiver_email = $_POST['receiver_email']; + $payer_email = $_POST['payer_email']; + + include("DBController.php"); + $db = new DBController(); + + // check whether the payment_status is Completed + $isPaymentCompleted = false; + if($payment_status == "Completed") { + $isPaymentCompleted = true; + } + // check that txn_id has not been previously processed + $isUniqueTxnId = false; + $param_type="s"; + $param_value_array = array($txn_id); + $result = $db->runQuery("SELECT * FROM payment WHERE txn_id = ?",$param_type,$param_value_array); + if(empty($result)) { + $isUniqueTxnId = true; + } + // check that receiver_email is your PayPal email + // check that payment_amount/payment_currency are correct + if($isPaymentCompleted) { + $param_type = "sssdss"; + $param_value_array = array($item_number, $item_name, $payment_status, $payment_amount, $payment_currency, $txn_id); + $payment_id = $db->insert("INSERT INTO payment(item_number, item_name, payment_status, payment_amount, payment_currency, txn_id) VALUES(?, ?, ?, ?, ?, ?)", $param_type, $param_value_array); + + } + // process payment and mark item as paid. + + + if(DEBUG == true) { + error_log(date('[Y-m-d H:i e] '). "Verified IPN: $req ". PHP_EOL, 3, LOG_FILE); + } + +} +else if (strcmp ($res, "INVALID") == 0) { + // log for manual investigation + // Add business logic here which deals with invalid IPN messages + if(DEBUG == true) { + error_log(date('[Y-m-d H:i e] '). "Invalid IPN: $req" . PHP_EOL, 3, LOG_FILE); + } +} + + +?> \ No newline at end of file diff --git a/sql/update2.sql b/sql/update2.sql index d1e97d797..e95ba5aac 100644 --- a/sql/update2.sql +++ b/sql/update2.sql @@ -9277,12 +9277,30 @@ INSERT INTO srv_module (module_name, active) VALUES ('evoli_organizational_emplo #UPDATE srv_module SET active='1' WHERE module_name = 'evoli_teamship_meter'; #UPDATE srv_module SET active='1' WHERE module_name = 'evoli_organizational_employeeship_meter'; + UPDATE misc SET value='20.07.29' WHERE what="version"; UPDATE srv_user_setting_for_survey SET value = '1ka' WHERE what = 'default_chart_profile_skin' AND value = '1ka'; UPDATE misc SET value='20.08.10' WHERE what="version"; +## Tabela placil preko paypala +CREATE TABLE user_access_paypal_transaction( + id int(11) NOT NULL auto_increment, + transaction_id int(11) NOT NULL DEFAULT 0, + narocilo_id int(11) NOT NULL DEFAULT 0, + price DECIMAL(7,2) NOT NULL DEFAULT '0', + currency_type VARCHAR(100) NOT NULL DEFAULT '', + time DATETIME(3) NOT NULL, + status VARCHAR(30) NOT NULL DEFAULT '', + PRIMARY KEY (id), + UNIQUE KEY (transaction_id), + UNIQUE KEY (narocilo_id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +UPDATE misc SET value='20.09.07' WHERE what="version"; + + ALTER TABLE user_access_placilo ADD COLUMN canceled ENUM('0', '1') NOT NULL DEFAULT '0'; UPDATE misc SET value='20.09.11' WHERE what="version"; @@ -9308,3 +9326,4 @@ CREATE TABLE srv_clicks ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; UPDATE misc SET value='20.09.21' WHERE what="version"; +