From deb03ce98907525c6e30731372de141537d9c7f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D8=B9=D8=A7=D8=B1=D9=81=20=D8=B3=D9=84=DB=8C=D9=85=D8=A7?= =?UTF-8?q?=D9=86=DB=8C?= <95649368+DeAref@users.noreply.github.com> Date: Mon, 6 Feb 2023 18:30:01 +0330 Subject: [PATCH 1/2] Add files via upload add compose generated vendor files --- vendor/autoload.php | 7 + vendor/composer/ClassLoader.php | 572 ++++++++++++++++++ vendor/composer/InstalledVersions.php | 350 +++++++++++ vendor/composer/LICENSE | 21 + vendor/composer/autoload_classmap.php | 10 + vendor/composer/autoload_namespaces.php | 9 + vendor/composer/autoload_psr4.php | 11 + vendor/composer/autoload_real.php | 57 ++ vendor/composer/autoload_static.php | 44 ++ vendor/composer/installed.json | 64 ++ vendor/composer/installed.php | 32 + vendor/composer/platform_check.php | 26 + vendor/telepaycash/sdk-telepay-php/LICENSE | 21 + vendor/telepaycash/sdk-telepay-php/README.md | 473 +++++++++++++++ .../telepaycash/sdk-telepay-php/composer.json | 38 ++ .../sdk-telepay-php/docs/cover.png | Bin 0 -> 32596 bytes .../sdk-telepay-php/examples/1-getters.php | 44 ++ .../examples/2-createInvoice.php | 30 + .../sdk-telepay-php/examples/3-transfer.php | 29 + .../sdk-telepay-php/examples/4-withdraw.php | 21 + .../examples/5-cancelAndDeleteInvoice.php | 33 + .../sdk-telepay-php/examples/6-webhook.php | 51 ++ .../sdk-telepay-php/examples/7-assets.php | 22 + .../telepaycash/sdk-telepay-php/phpunit.xml | 9 + .../sdk-telepay-php/src/TelePayAssetInput.php | 68 +++ .../sdk-telepay-php/src/TelePayBaseInput.php | 69 +++ .../sdk-telepay-php/src/TelePayClient.php | 331 ++++++++++ .../src/TelePayEnvironment.php | 21 + .../sdk-telepay-php/src/TelePayEvents.php | 43 ++ .../sdk-telepay-php/src/TelePayException.php | 46 ++ .../src/TelePayInvoiceInput.php | 113 ++++ .../src/TelePayTransferInput.php | 65 ++ .../src/TelePayWebhookInput.php | 103 ++++ .../src/TelePayWithdrawInput.php | 66 ++ .../tests/Asset/AssetsTest.php | 41 ++ .../tests/Invoice/InvoiceTest.php | 234 +++++++ .../tests/Merchant/MerchantTest.php | 40 ++ .../sdk-telepay-php/tests/TestInit.php | 19 + .../tests/Transfer/TransferTest.php | 55 ++ .../tests/Wallet/WalletTest.php | 66 ++ .../tests/Webhook/WebhookTest.php | 144 +++++ .../tests/Withdraw/WithdrawTest.php | 90 +++ 42 files changed, 3588 insertions(+) create mode 100644 vendor/autoload.php create mode 100644 vendor/composer/ClassLoader.php create mode 100644 vendor/composer/InstalledVersions.php create mode 100644 vendor/composer/LICENSE create mode 100644 vendor/composer/autoload_classmap.php create mode 100644 vendor/composer/autoload_namespaces.php create mode 100644 vendor/composer/autoload_psr4.php create mode 100644 vendor/composer/autoload_real.php create mode 100644 vendor/composer/autoload_static.php create mode 100644 vendor/composer/installed.json create mode 100644 vendor/composer/installed.php create mode 100644 vendor/composer/platform_check.php create mode 100644 vendor/telepaycash/sdk-telepay-php/LICENSE create mode 100644 vendor/telepaycash/sdk-telepay-php/README.md create mode 100644 vendor/telepaycash/sdk-telepay-php/composer.json create mode 100644 vendor/telepaycash/sdk-telepay-php/docs/cover.png create mode 100644 vendor/telepaycash/sdk-telepay-php/examples/1-getters.php create mode 100644 vendor/telepaycash/sdk-telepay-php/examples/2-createInvoice.php create mode 100644 vendor/telepaycash/sdk-telepay-php/examples/3-transfer.php create mode 100644 vendor/telepaycash/sdk-telepay-php/examples/4-withdraw.php create mode 100644 vendor/telepaycash/sdk-telepay-php/examples/5-cancelAndDeleteInvoice.php create mode 100644 vendor/telepaycash/sdk-telepay-php/examples/6-webhook.php create mode 100644 vendor/telepaycash/sdk-telepay-php/examples/7-assets.php create mode 100644 vendor/telepaycash/sdk-telepay-php/phpunit.xml create mode 100644 vendor/telepaycash/sdk-telepay-php/src/TelePayAssetInput.php create mode 100644 vendor/telepaycash/sdk-telepay-php/src/TelePayBaseInput.php create mode 100644 vendor/telepaycash/sdk-telepay-php/src/TelePayClient.php create mode 100644 vendor/telepaycash/sdk-telepay-php/src/TelePayEnvironment.php create mode 100644 vendor/telepaycash/sdk-telepay-php/src/TelePayEvents.php create mode 100644 vendor/telepaycash/sdk-telepay-php/src/TelePayException.php create mode 100644 vendor/telepaycash/sdk-telepay-php/src/TelePayInvoiceInput.php create mode 100644 vendor/telepaycash/sdk-telepay-php/src/TelePayTransferInput.php create mode 100644 vendor/telepaycash/sdk-telepay-php/src/TelePayWebhookInput.php create mode 100644 vendor/telepaycash/sdk-telepay-php/src/TelePayWithdrawInput.php create mode 100644 vendor/telepaycash/sdk-telepay-php/tests/Asset/AssetsTest.php create mode 100644 vendor/telepaycash/sdk-telepay-php/tests/Invoice/InvoiceTest.php create mode 100644 vendor/telepaycash/sdk-telepay-php/tests/Merchant/MerchantTest.php create mode 100644 vendor/telepaycash/sdk-telepay-php/tests/TestInit.php create mode 100644 vendor/telepaycash/sdk-telepay-php/tests/Transfer/TransferTest.php create mode 100644 vendor/telepaycash/sdk-telepay-php/tests/Wallet/WalletTest.php create mode 100644 vendor/telepaycash/sdk-telepay-php/tests/Webhook/WebhookTest.php create mode 100644 vendor/telepaycash/sdk-telepay-php/tests/Withdraw/WithdrawTest.php diff --git a/vendor/autoload.php b/vendor/autoload.php new file mode 100644 index 0000000..e1505ea --- /dev/null +++ b/vendor/autoload.php @@ -0,0 +1,7 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + /** @var ?string */ + private $vendorDir; + + // PSR-4 + /** + * @var array[] + * @psalm-var array> + */ + private $prefixLengthsPsr4 = array(); + /** + * @var array[] + * @psalm-var array> + */ + private $prefixDirsPsr4 = array(); + /** + * @var array[] + * @psalm-var array + */ + private $fallbackDirsPsr4 = array(); + + // PSR-0 + /** + * @var array[] + * @psalm-var array> + */ + private $prefixesPsr0 = array(); + /** + * @var array[] + * @psalm-var array + */ + private $fallbackDirsPsr0 = array(); + + /** @var bool */ + private $useIncludePath = false; + + /** + * @var string[] + * @psalm-var array + */ + private $classMap = array(); + + /** @var bool */ + private $classMapAuthoritative = false; + + /** + * @var bool[] + * @psalm-var array + */ + private $missingClasses = array(); + + /** @var ?string */ + private $apcuPrefix; + + /** + * @var self[] + */ + private static $registeredLoaders = array(); + + /** + * @param ?string $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + } + + /** + * @return string[] + */ + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); + } + + return array(); + } + + /** + * @return array[] + * @psalm-return array> + */ + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + /** + * @return array[] + * @psalm-return array + */ + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + /** + * @return array[] + * @psalm-return array + */ + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + /** + * @return string[] Array of classname => path + * @psalm-return array + */ + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param string[] $classMap Class to filename map + * @psalm-param array $classMap + * + * @return void + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void + */ + public function add($prefix, $paths, $prepend = false) + { + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + (array) $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + (array) $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = (array) $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + (array) $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + (array) $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + (array) $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + (array) $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 base directories + * + * @return void + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + * + * @return void + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + * + * @return void + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + * + * @return void + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } + } + + /** + * Unregisters this instance as an autoloader. + * + * @return void + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return true|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + includeFile($file); + + return true; + } + + return null; + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + return false; + } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if (false === $file && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { + // Remember that this class does not exist. + $this->missingClasses[$class] = true; + } + + return $file; + } + + /** + * Returns the currently registered loaders indexed by their corresponding vendor directories. + * + * @return self[] + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath . '\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + return false; + } +} + +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + * @private + */ +function includeFile($file) +{ + include $file; +} diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php new file mode 100644 index 0000000..d50e0c9 --- /dev/null +++ b/vendor/composer/InstalledVersions.php @@ -0,0 +1,350 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + */ +class InstalledVersions +{ + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints($constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($vendorDir.'/composer/installed.php')) { + $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = require __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + $installed[] = self::$installed; + + return $installed; + } +} diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE new file mode 100644 index 0000000..f27399a --- /dev/null +++ b/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) Nils Adermann, Jordi Boggiano + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php new file mode 100644 index 0000000..b26f1b1 --- /dev/null +++ b/vendor/composer/autoload_classmap.php @@ -0,0 +1,10 @@ + $vendorDir . '/composer/InstalledVersions.php', +); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php new file mode 100644 index 0000000..b7fc012 --- /dev/null +++ b/vendor/composer/autoload_namespaces.php @@ -0,0 +1,9 @@ + array($vendorDir . '/telepaycash/sdk-telepay-php/src'), + 'Examples\\' => array($vendorDir . '/telepaycash/sdk-telepay-php/examples'), +); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php new file mode 100644 index 0000000..6595872 --- /dev/null +++ b/vendor/composer/autoload_real.php @@ -0,0 +1,57 @@ += 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); + if ($useStaticLoader) { + require __DIR__ . '/autoload_static.php'; + + call_user_func(\Composer\Autoload\ComposerStaticInit6be902a253cbebadfd3b7764c353b083::getInitializer($loader)); + } else { + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); + } + + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + } + + $loader->register(true); + + return $loader; + } +} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php new file mode 100644 index 0000000..b11a045 --- /dev/null +++ b/vendor/composer/autoload_static.php @@ -0,0 +1,44 @@ + + array ( + 'TelePay\\' => 8, + ), + 'E' => + array ( + 'Examples\\' => 9, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'TelePay\\' => + array ( + 0 => __DIR__ . '/..' . '/telepaycash/sdk-telepay-php/src', + ), + 'Examples\\' => + array ( + 0 => __DIR__ . '/..' . '/telepaycash/sdk-telepay-php/examples', + ), + ); + + public static $classMap = array ( + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInit6be902a253cbebadfd3b7764c353b083::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit6be902a253cbebadfd3b7764c353b083::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit6be902a253cbebadfd3b7764c353b083::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json new file mode 100644 index 0000000..c1fab79 --- /dev/null +++ b/vendor/composer/installed.json @@ -0,0 +1,64 @@ +{ + "packages": [ + { + "name": "telepaycash/sdk-telepay-php", + "version": "v1.2.0", + "version_normalized": "1.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/TelePay-cash/telepay-php.git", + "reference": "e1b8dc8a2aba32b1e9b2015405b874e1e1944a74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/TelePay-cash/telepay-php/zipball/e1b8dc8a2aba32b1e9b2015405b874e1e1944a74", + "reference": "e1b8dc8a2aba32b1e9b2015405b874e1e1944a74", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.0.3" + }, + "time": "2023-02-05T13:55:02+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "TelePay\\": "src/", + "Examples\\": "examples/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Raubel", + "email": "raubel1993@gmail.com" + }, + { + "name": "Carlos Lugones", + "email": "contact@carloslugones.com" + } + ], + "description": "Library to receive payments with TelePay", + "keywords": [ + "payments", + "rest", + "sdk", + "telepay", + "toncoin" + ], + "support": { + "issues": "https://github.com/TelePay-cash/telepay-php/issues", + "source": "https://github.com/TelePay-cash/telepay-php/tree/v1.2.0" + }, + "install-path": "../telepaycash/sdk-telepay-php" + } + ], + "dev": true, + "dev-package-names": [] +} diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php new file mode 100644 index 0000000..174090b --- /dev/null +++ b/vendor/composer/installed.php @@ -0,0 +1,32 @@ + array( + 'pretty_version' => '1.0.0+no-version-set', + 'version' => '1.0.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'reference' => NULL, + 'name' => '__root__', + 'dev' => true, + ), + 'versions' => array( + '__root__' => array( + 'pretty_version' => '1.0.0+no-version-set', + 'version' => '1.0.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'reference' => NULL, + 'dev_requirement' => false, + ), + 'telepaycash/sdk-telepay-php' => array( + 'pretty_version' => 'v1.2.0', + 'version' => '1.2.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../telepaycash/sdk-telepay-php', + 'aliases' => array(), + 'reference' => 'e1b8dc8a2aba32b1e9b2015405b874e1e1944a74', + 'dev_requirement' => false, + ), + ), +); diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php new file mode 100644 index 0000000..f79e574 --- /dev/null +++ b/vendor/composer/platform_check.php @@ -0,0 +1,26 @@ += 70000)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.0". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +} diff --git a/vendor/telepaycash/sdk-telepay-php/LICENSE b/vendor/telepaycash/sdk-telepay-php/LICENSE new file mode 100644 index 0000000..c17af1c --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 TelePay.cash + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/telepaycash/sdk-telepay-php/README.md b/vendor/telepaycash/sdk-telepay-php/README.md new file mode 100644 index 0000000..cc7e9c2 --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/README.md @@ -0,0 +1,473 @@ +# PHP SDK for the TelePay API + +![TelePay PHP](https://github.com/TelePay-cash/telepay-php/blob/main/docs/cover.png?raw=true) + +TelePay client library for the PHP language, so you can easely process cryptocurrency payments using the REST API. + +[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT) +[![CI](https://github.com/TelePay-cash/telepay-php/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/TelePay-cash/telepay-php/actions/workflows/ci.yml) +[![Last commit](https://img.shields.io/github/last-commit/telepay-cash/telepay-php.svg?style=flat-square)](https://github.com/telepay-cash/telepay-php/commits) +[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/telepay-cash/telepay-php?style=flat-square)](https://github.com/telepay-cash/telepay-php/commits) +[![Github Stars](https://img.shields.io/github/stars/telepay-cash/telepay-php?style=flat-square&logo=github&)](https://github.com/telepay-cash/telepay-php/stargazers) +[![Github Forks](https://img.shields.io/github/forks/telepay-cash/telepay-php?style=flat-square&logo=github)](https://github.com/telepay-cash/telepay-php/network/members) +[![Github Watchers](https://img.shields.io/github/watchers/telepay-cash/telepay-php?style=flat-square&logo=github)](https://github.com/telepay-cash/telepay-php) +[![GitHub contributors](https://img.shields.io/github/contributors/telepay-cash/telepay-php?label=code%20contributors&style=flat-square)](https://github.com/telepay-cash/telepay-php/graphs/contributors) +[![Telegram](https://img.shields.io/badge/Telegram-2CA5E0?style=flat-squeare&logo=telegram&logoColor=white)](https://t.me/TelePayCash) +[![Blog](https://img.shields.io/badge/RSS-FFA500?style=flat-square&logo=rss&logoColor=white)](https://blog.telepay.cash) + +## Installation + +Install the package with composer: + +```bash +composer require telepaycash/sdk-telepay-php +``` + +## Using the library + +Import the library classes using the Composer autoload: + +```php +require 'vendor/autoload.php'; + +use TelePay\TelePayClient; +use TelePay\TelePayEnvironment; +``` + +Configure the TelePay client using the secret of your merchant + +```php +$clientSecret = "YOUR API SECRET KEY"; + +$environment = new TelePayEnvironment($clientSecret); + +$telepay = new TelePayClient($environment); +``` + +**Get your current merchant** + +```php +$me = $telepay->getMe(); +print_r($me); +``` + +Response + +```php +Array +( + [version] => 1.0 + [merchant] => Array + ( + [name] => MyMerchant + [url] => https://mymerchant.com/ + [logo_url] => https://ik.imagekit.io/telepay/merchants/descarga_-k4ehiTd5.jpeg + [logo_thumbnail_url] => https://ik.imagekit.io/telepay/tr:n-media_library_thumbnail/merchants/descarga_-k4ehiTd5.jpeg + [verified] => + [username] => merchant_username + [public_profile] => https://telepay.cash/to/merchant_username + [owner] => Array + ( + [first_name] => Raubel + [last_name] => Guerra + [username] => raubel1993 + ) + + [created_at] => 2022-04-13T00:51:37.802614Z + [updated_at] => + ) +) +``` +[Read docs](https://telepay.readme.io/reference/getme) + +**Get the balance of all merchant wallets** + +```php +$balances = $telepay->getAllBalances(); +print_r($balances); +``` + +Response + +```php +Array +( + [wallets] => Array + ( + [0] => Array + ( + [asset] => TON + [blockchain] => TON + [balance] => 10.005 + [network] => mainnet + ) + + [1] => Array + ( + [asset] => TON + [blockchain] => TON + [balance] => 0 + [network] => testnet + ) + + ) + +) +``` +[Read docs](https://telepay.readme.io/reference/getbalance) + +**Get the balance of one of the merchant wallets** + +```php +$asset = new TelePayAssetInput("TON", "TON", "mainnet"); +$balance = $telepay->getBalance($asset); +print_r($balance); +``` + +Response + +```php +Array +( + [wallets] => Array + ( + [0] => Array + ( + [asset] => TON + [blockchain] => TON + [balance] => 0 + [network] => mainnet + ) + + ) + +) +``` +[Read docs](https://telepay.readme.io/reference/getbalance-1) + +**Get the assets** + +Get assets suported by TelePay. [Read docs](https://telepay.readme.io/reference/getassets) + +```php +$assets = $telepay->getAssets(); +print_r($assers); +``` + +Response + +```php +Array +( + [assets] => Array + ( + [0] => Array + ( + [asset] => TON + [blockchain] => TON + [usd_price] => 1.050999999999999934 + [url] => https://ton.org + [networks] => Array + ( + [0] => mainnet + [1] => testnet + ) + + [coingecko_id] => the-open-network + ) + + ) + +) +``` + +You can get the detail of a single asset. [Read docs](https://telepay.readme.io/reference/getasset) + +```php +$asset = new TelePayAssetInput("TON", "TON", "mainnet"); +$assetDetail = $telepay->getAsset($asset); +``` + +**Create one invoice** + +```php +$orderId = 56; +$invoice = new TelePayInvoiceInput("TON", "TON", "testnet", "0.2"); +$invoice->setDescription("Test using SDK TelePay PHP"); +$invoice->setMetadata([ + "my_reference_id" => $orderId, + "other_metadata" => "any value" +]); +$invoice->setSuccessUrl("https://www.example.com/payment_success?order_id=$orderId"); +$invoice->setCancelUrl("https://www.example.com/payment_cancelled?order_id=$orderId"); + +$respCreateInvoice = $telepay->createInvoice($invoice); +print_r($respCreateInvoice); +``` + +Response + +```php +Array +( + [number] => YJ1EJO9PLA + [asset] => TON + [blockchain] => TON + [network] => mainnet + [status] => pending + [amount] => 2.000000000000000000 + [amount_remaining] => 0.000000000000000000 + [amount_real] => 0.000000000000000000 + [description] => Test using SDK TelePay PHP + [metadata] => Array + ( + [my_reference_id] => 56 + [other_metadata] => any value + ) + + [checkout_url] => https://telepay.cash/checkout/YJ1EJO9PLA + [onchain_url] => ton://transfer/UQDoFjaqMtuxkJV-caGiEdxMxjkTAWU9oskjpfAA1uwHbe4u?amount=2000000000 + [success_url] => https://www.example.com/payment_success?order_id=56 + [cancel_url] => https://www.example.com/payment_cancelled?order_id=56 + [explorer_url] => + [expires_at] => 2022-06-28T00:09:52.038782Z + [created_at] => 2022-06-27T14:09:52.038908Z + [updated_at] => +) +``` +[Read docs](https://telepay.readme.io/reference/createinvoice) + +**View invoices** + +Find many invoices. [Read docs](https://telepay.readme.io/reference/getinvoices) + +```php +$invoicesResponse = $telepay->getInvoices(); +``` + +Find one invoice by number. [Read docs](https://telepay.readme.io/reference/getinvoice) + +```php +$invoiceNumber = "UIOAXSSFNB"; +$respGetInvoice = $telepay->getInvoice($invoiceNumber); +``` + +**Cancel invoice** + +```php +$invoiceNumber = "8N1DLRKV5S"; +$respCancelInvoice = $telepay->cancelInvoice($invoiceNumber); +print_r($respCancelInvoice); +``` + +Response + +```php +Array +( + [number] => YJ1EJO9PLA + [asset] => TON + [blockchain] => TON + [network] => mainnet + [status] => cancelled + [amount] => 2.000000000000000000 + [amount_remaining] => 0.000000000000000000 + [amount_real] => 0.000000000000000000 + [description] => Test using SDK TelePay PHP + [metadata] => Array + ( + [other_metadata] => any value + [my_reference_id] => 56 + ) + [checkout_url] => https://telepay.cash/checkout/YJ1EJO9PLA + [onchain_url] => + [success_url] => https://www.example.com/payment_success?order_id=56 + [cancel_url] => https://www.example.com/payment_cancelled?order_id=56 + [explorer_url] => + [expires_at] => 2022-06-28T00:09:52.038782Z + [created_at] => 2022-06-27T14:09:52.038908Z + [updated_at] => 2022-06-27T14:09:53.205920Z +) +``` + +**Delete invoice** + +```php +$invoiceNumber = "8N1DLRKV5S"; +$respDeleteInvoice = $telepay->deleteInvoice($invoiceNumber); +print_r($respDeleteInvoice); +``` + +Response + +```php +Array +( + [success] => invoice.deleted + [message] => Invoice deleted. +) +``` + +**Transfer** + +```php +$transfer = new TelePayTransferInput("TON", "TON", "mainnet", "0.00005", "raubel1993"); +$transfer->setMessage("Debt settled"); + +$respTransfer= $telepay->transfer($transfer); +print_r($respTransfer); +``` + +Response + +```php +Array +( + [success] => transfer.ok + [message] => Transfer performed. +) +``` +[Read docs](https://telepay.readme.io/reference/transfer) + +**Withdraw Fee** + +```php +$withdraw = new TelePayWithdrawInput("TON", "TON", "mainnet", "0.2", "EQCwLtwjII1yBfO3m6T9I7__6CUXj60ZFmN3Ww2aiLQLicsO"); +$withdraw->setMessage("for my savings account"); + +$respWithdrawFee = $telepay->getWithdrawFee($withdraw); +print_r($respWithdrawFee); +``` + +Response + +```php +Array +( + [blockchain_fee] => 0.001824 + [processing_fee] => 0.01 + [total] => 0.011824 +) +``` + +**Withdraw** + +```php +$withdraw = new TelePayWithdrawInput("TON", "TON", "mainnet", "0.2", "EQCwLtwjII1yBfO3m6T9I7__6CUXj60ZFmN3Ww2aiLQLicsO"); +$withdraw->setMessage("for my savings account"); + +$respWithdraw = $telepay->withdraw($withdraw); +print_r($respWithdraw); +``` + +Response + +```php +Array +( + [success] => 1 +) +``` + +**View webhooks** + +Find many webhooks. [Read docs](https://telepay.readme.io/reference/getwebhooks) + +```php +$webhooksResponse = $telepay->getWebhooks(); +``` + +Find one webhook by Id. [Read docs](https://telepay.readme.io/reference/getwebhook) + +```php +$webhookId = 325; +$webhookResponse = $telepay->getWebhook($webhookId); +print_r($webhookResponse); +``` + +Response + +```php +Array +( + [id] => 325 + [url] => https://www.example.com/webhook + [secret] => secret + [events] => Array + ( + [0] => invoice.completed + ) + + [active] => 1 +) +``` + +**Create or update a webhook** + +For create a webhook is required the url, a secret and the events associated. [Read docs](https://telepay.readme.io/reference/createwebhook) + +```php +$urlWebhook = "https://www.example.com/webhook"; +$secretWebhook = "secret"; +$eventsWebhook = [ + TelePayEvents::INVOICE_COMPLETED +]; +$webhookInput = new TelePayWebhookInput($urlWebhook, $secretWebhook, $eventsWebhook); + +$responseCreateWebhook = $telepay->createWebhook($webhookInput); +``` + +For update a webhook is required a webhookId and the new params. [Read docs](https://telepay.readme.io/reference/updatewebhook) + +```php +$webhookId = 325; +$responseUpdateWebhook = $telepay->updateWebhook($webhookId, $webhookInput); +``` + +**Activate or deativate a webhook** + +```php +$webhookId = 325; + +$telepay->activateWebhook($webhookId); + +$telepay->deactivateWebhook($webhookId); +``` + +**Delete a webhook** + +```php +$webhookId = 325; + +$telepay->deleteWebhook($webhookId); +``` + +## Tests + +All endpoint responses were tested. +To run the tests yourself, you need your TelePay merchant secret with at least 3 testnet toncoins, +a Telepay user who will receive the test transfer, and a testnet wallet which will receive the test withdraw. + +```bash +TELEPAY_SECRET_API_KEY= USERNAME_TELEPAY_TRANSFER= WHITDRAW_TO_WALLET= composer tests +``` + +## Contributors ✨ + +The library is made by ([emoji key](https://allcontributors.org/docs/en/emoji-key)): + + + + + + + + + +

Raubel Guerra

💻

Carlos Lugones

🧑‍🏫
+ + + + + +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! diff --git a/vendor/telepaycash/sdk-telepay-php/composer.json b/vendor/telepaycash/sdk-telepay-php/composer.json new file mode 100644 index 0000000..b494c39 --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/composer.json @@ -0,0 +1,38 @@ +{ + "name": "telepaycash/sdk-telepay-php", + "description": "Library to receive payments with TelePay", + "keywords": ["telepay", "payments", "rest", "sdk", "toncoin"], + "type": "library", + "license": "MIT", + "autoload": { + "psr-4": { + "TelePay\\": "src/", + "Examples\\":"examples/" + } + }, + "autoload-dev": { + "psr-4": { + "Test\\":"tests/" + } + }, + "require": { + "php": ">=7.0" + }, + "authors": [ + { + "name": "Raubel", + "email": "raubel1993@gmail.com" + }, + { + "name": "Carlos Lugones", + "email": "contact@carloslugones.com" + } + ], + "scripts": { + "tests": "./vendor/bin/phpunit", + "tests-coverage": "./vendor/bin/phpunit --coverage-html coverage" + }, + "require-dev": { + "phpunit/phpunit": "^10.0.3" + } +} diff --git a/vendor/telepaycash/sdk-telepay-php/docs/cover.png b/vendor/telepaycash/sdk-telepay-php/docs/cover.png new file mode 100644 index 0000000000000000000000000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ln)ElO4$`c%TI5q>zEW zayQ-2>*($6otOf@g4+m$-9|=HM?7X`sfDP?TBqhRX(# z#ZYWhP&i62GRvIQ?^wn?HV*T?K%NfFXup+i9}>#p&vWv%F!;;if3LNPA=ZOG?}q=m z#P;Z)OK|_!hgOhF0}!kK`!YSU`Tl3WW(fIal>co1-xs=(UGKjybR(PLzc27a{XhLC r(*H0AakKxQm^1fZtRgetMe(); +$merchant = $me['merchant']; +$merchantName = $merchant['name']; +$merchantUrl = $merchant['url']; +$merchantUsername = $merchant['username']; +$merchantPublicProfile = $merchant['public_profile']; + +$balance = $telepay->getAllBalances(); +$wallets = $balance['wallets']; +echo "My wallets: \n"; +foreach ($wallets as $wallet) { + echo "Asset: ".$wallet['asset'] + ." Blockchain: ".$wallet['blockchain'] + ." Networks: ".$wallet['network'] + ." balance: ".$wallet['balance'] + ."\n"; +} + +$invoicesResponse = $telepay->getInvoices(); +$invoices = $invoicesResponse['invoices']; +echo "My invoices: \n"; +foreach ($invoices as $invoice) { + echo "Number: ".$invoice['number']."\n" + ." description: ".$invoice['description']."\n" + ."Asset: ".$invoice['asset']."\n" + ." Blockchain: ".$invoice['blockchain']."\n" + ." Networks: ".$invoice['network']."\n" + ." status: ".$invoice['status']."\n" + ." amount: ".$invoice['amount']."\n" + ."\n"; +} \ No newline at end of file diff --git a/vendor/telepaycash/sdk-telepay-php/examples/2-createInvoice.php b/vendor/telepaycash/sdk-telepay-php/examples/2-createInvoice.php new file mode 100644 index 0000000..fb8ad90 --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/examples/2-createInvoice.php @@ -0,0 +1,30 @@ +setDescription("Test using SDK TelePay PHP"); +$invoice->setMetadata([ + "my_reference_id" => $orderId, + "other_metadata" => "any value" +]); +$invoice->setSuccessUrl("https://www.example.com/payment_success?order_id=$orderId"); +$invoice->setCancelUrl("https://www.example.com/payment_cancelled?order_id=$orderId"); + +$respCreateInvoice = $telepay->createInvoice($invoice); +$invoiceNumber = $respCreateInvoice['number']; +print_r($respCreateInvoice); + +$respGetInvoice = $telepay->getInvoice($invoiceNumber); +print_r($respGetInvoice); \ No newline at end of file diff --git a/vendor/telepaycash/sdk-telepay-php/examples/3-transfer.php b/vendor/telepaycash/sdk-telepay-php/examples/3-transfer.php new file mode 100644 index 0000000..f905f88 --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/examples/3-transfer.php @@ -0,0 +1,29 @@ +setMessage("Debt settled"); + + $respTransfer= $telepay->transfer($transfer); + print_r($respTransfer); +} catch (TelePayException $th) { + print_r([ + "statusCode" => $th->getStatusCode(), + "error" => $th->getError(), + "message" => $th->getMessage(), + ]); +}catch (\Throwable $th) { + throw $th; +} \ No newline at end of file diff --git a/vendor/telepaycash/sdk-telepay-php/examples/4-withdraw.php b/vendor/telepaycash/sdk-telepay-php/examples/4-withdraw.php new file mode 100644 index 0000000..4f27445 --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/examples/4-withdraw.php @@ -0,0 +1,21 @@ +setMessage("for my savings account"); + +$respWithdrawFee = $telepay->getWithdrawFee($withdraw); +print_r($respWithdrawFee); + +$respWithdraw = $telepay->withdraw($withdraw); +print_r($respWithdraw); diff --git a/vendor/telepaycash/sdk-telepay-php/examples/5-cancelAndDeleteInvoice.php b/vendor/telepaycash/sdk-telepay-php/examples/5-cancelAndDeleteInvoice.php new file mode 100644 index 0000000..0d10a36 --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/examples/5-cancelAndDeleteInvoice.php @@ -0,0 +1,33 @@ +setDescription("Test using SDK TelePay PHP"); +$invoice->setMetadata([ + "my_reference_id" => $orderId, + "other_metadata" => "any value" +]); +$invoice->setSuccessUrl("https://www.example.com/payment_success?order_id=$orderId"); +$invoice->setCancelUrl("https://www.example.com/payment_cancelled?order_id=$orderId"); + +$respCreateInvoice = $telepay->createInvoice($invoice); +print_r($respCreateInvoice); + +$invoiceNumber = $respCreateInvoice['number']; + +$respCancelInvoice = $telepay->cancelInvoice($invoiceNumber); +print_r($respCancelInvoice); + +$respDeleteInvoice = $telepay->deleteInvoice($invoiceNumber); +print_r($respDeleteInvoice); \ No newline at end of file diff --git a/vendor/telepaycash/sdk-telepay-php/examples/6-webhook.php b/vendor/telepaycash/sdk-telepay-php/examples/6-webhook.php new file mode 100644 index 0000000..3bd81ac --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/examples/6-webhook.php @@ -0,0 +1,51 @@ +getWebhooks(); +foreach ($responseGetAllWebhooks['webhooks'] as $webhook) { + $telepay->deleteWebhook($webhook['id']); +} + +$webhookInput = new TelePayWebhookInput($urlWebhook, $secretWebhook, $eventsWebhook); + +$responseCreateWebhook = $telepay->createWebhook($webhookInput); +print_r($responseCreateWebhook); + +$responseGetOneWebhook = $telepay->getWebhook($responseCreateWebhook['id']); +print_r($responseGetOneWebhook); + +$responseGetAllWebhooks = $telepay->getWebhooks(); +print_r($responseGetAllWebhooks); + +$responseDeactivateWebhook = $telepay->deactivateWebhook($responseCreateWebhook['id']); +print_r($responseDeactivateWebhook); + +$webhookInput->setSecret("new secret"); +$webhookInput->setActive(false); +$responseUpdateWebhook = $telepay->updateWebhook($responseCreateWebhook['id'], $webhookInput); +print_r($responseUpdateWebhook); + +$responseActivateWebhook = $telepay->activateWebhook($responseCreateWebhook['id']); +print_r($responseActivateWebhook); + +$responseDeleteWebhook = $telepay->deleteWebhook($responseCreateWebhook['id']); +print_r($responseDeleteWebhook); + + + diff --git a/vendor/telepaycash/sdk-telepay-php/examples/7-assets.php b/vendor/telepaycash/sdk-telepay-php/examples/7-assets.php new file mode 100644 index 0000000..92c208b --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/examples/7-assets.php @@ -0,0 +1,22 @@ +getAssets(); +print_r($assetsResponse); + +echo "Asset detail"; +$asset = new TelePayAssetInput("TON", "TON", "mainnet"); +$assetDetail = $telepay->getAsset($asset); +print_r($assetDetail); \ No newline at end of file diff --git a/vendor/telepaycash/sdk-telepay-php/phpunit.xml b/vendor/telepaycash/sdk-telepay-php/phpunit.xml new file mode 100644 index 0000000..a80f590 --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/phpunit.xml @@ -0,0 +1,9 @@ + + + + + + tests + + + diff --git a/vendor/telepaycash/sdk-telepay-php/src/TelePayAssetInput.php b/vendor/telepaycash/sdk-telepay-php/src/TelePayAssetInput.php new file mode 100644 index 0000000..f3009dd --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/src/TelePayAssetInput.php @@ -0,0 +1,68 @@ +setAsset($asset); + $this->setBlockchain($blockchain); + if($network) { + $this->setNetwork($network); + } + } + public function getBodyPrepared() + { + $body = array( + "asset" => $this->asset, + "blockchain" => $this->blockchain, + "network" => $this->network + ); + return $body; + } + + public function getAsset() + { + return $this->asset; + } + public function setAsset($asset) + { + $this->asset = $asset; + } + public function getBlockchain() + { + return $this->blockchain; + } + public function setBlockchain($blockchain) + { + $this->blockchain = $blockchain; + } + public function getNetwork() + { + return $this->network; + } + public function setNetwork($network) + { + $this->network = $network; + } +} \ No newline at end of file diff --git a/vendor/telepaycash/sdk-telepay-php/src/TelePayBaseInput.php b/vendor/telepaycash/sdk-telepay-php/src/TelePayBaseInput.php new file mode 100644 index 0000000..16e8b40 --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/src/TelePayBaseInput.php @@ -0,0 +1,69 @@ +setAsset($asset); + $this->setBlockchain($blockchain); + $this->setNetwork($network); + $this->setAmount($amount); + } + + public function getAsset() + { + return $this->asset; + } + public function setAsset($asset) + { + $this->asset = $asset; + } + public function getBlockchain() + { + return $this->blockchain; + } + public function setBlockchain($blockchain) + { + $this->blockchain = $blockchain; + } + public function getNetwork() + { + return $this->network; + } + public function setNetwork($network) + { + $this->network = $network; + } + public function getAmount() + { + return $this->amount; + } + public function setAmount($amount) + { + $this->amount = $amount; + } +} diff --git a/vendor/telepaycash/sdk-telepay-php/src/TelePayClient.php b/vendor/telepaycash/sdk-telepay-php/src/TelePayClient.php new file mode 100644 index 0000000..48d844f --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/src/TelePayClient.php @@ -0,0 +1,331 @@ +environment = $environment; + } + + /** + * Info about the current merchant + */ + public function getMe() + { + static $merchantCache; + if (!$merchantCache) { + $url = $this->environment->getBaseUrl() . "getMe"; + $response = $this->makeRequest($url); + $merchantCache = $response; + } + return $merchantCache; + } + + /** + * Get your merchant wallet balance, specifying the asset + * @param TelePayAssetInput $asset + */ + public function getBalance($asset) + { + $url = $this->environment->getBaseUrl() . "getBalance"; + $assetBody = $asset->getBodyPrepared(); + $response = $this->makeRequest($url, $assetBody, 'POST'); + return $response; + } + + /** + * Get your merchant wallet assets with corresponding balance + */ + public function getAllBalances() + { + $url = $this->environment->getBaseUrl() . "getBalance"; + $response = $this->makeRequest($url); + return $response; + } + + /** + * Get assets suported by TelePay + */ + public function getAssets() + { + static $assetCache; + if (!$assetCache) { + $url = $this->environment->getBaseUrl() . "getAssets"; + $response = $this->makeRequest($url); + $assetCache = $response; + } + return $assetCache; + } + + /** + * Get asset details + * @param TelePayAssetInput $asset + */ + public function getAsset($asset) + { + $url = $this->environment->getBaseUrl() . "getAsset"; + $assetBody = $asset->getBodyPrepared(); + $response = $this->makeRequest($url, $assetBody, 'GET'); + return $response; + } + + /** + * Get your merchant invoices + */ + public function getInvoices() + { + $url = $this->environment->getBaseUrl() . "getInvoices"; + $response = $this->makeRequest($url); + return $response; + } + + /** + * Get invoice details, by its number + * @param Int $invoiceNumber + */ + public function getInvoice($invoiceNumber) + { + $url = $this->environment->getBaseUrl() . "getInvoice/" . $invoiceNumber; + $response = $this->makeRequest($url); + return $response; + } + + /** + * Creates an invoice, associated to your merchant + * @param TelePayInvoiceInput $invoice + */ + public function createInvoice($invoice) + { + $this->validate($invoice->getAsset(), $invoice->getBlockchain(), $invoice->getNetwork()); + $url = $this->environment->getBaseUrl() . "createInvoice"; + $invoiceBody = $invoice->getBodyPrepared(); + $response = $this->makeRequest($url, $invoiceBody, "POST"); + return $response; + } + + /** + * Cancel invoice, by its number + * @param Int $invoiceNumber + */ + public function cancelInvoice($invoiceNumber) + { + $url = $this->environment->getBaseUrl() . "cancelInvoice/" . $invoiceNumber; + $response = $this->makeRequest($url, null, "POST"); + return $response; + } + + /** + * Delete invoice, by its number + * @param Int $invoiceNumber + */ + public function deleteInvoice($invoiceNumber) + { + $url = $this->environment->getBaseUrl() . "deleteInvoice/" . $invoiceNumber; + $response = $this->makeRequest($url, null, "POST"); + return $response; + } + + /** + * Transfer funds between internal wallets. Off-chain operation + * @param TelePayTransferInput $transfer + */ + public function transfer($transfer) + { + $this->validate($transfer->getAsset(), $transfer->getBlockchain(), $transfer->getNetwork()); + $url = $this->environment->getBaseUrl() . "transfer"; + $transferBody = $transfer->getBodyPrepared(); + $response = $this->makeRequest($url, $transferBody, "POST"); + return $response; + } + + /** + * Get estimated withdraw fee, composed of blockchain fee and processing fee + * @param TelePayWithdrawInput $withdraw + */ + public function getWithdrawFee($withdraw) + { + $this->validate($withdraw->getAsset(), $withdraw->getBlockchain(), $withdraw->getNetwork()); + $url = $this->environment->getBaseUrl() . "getWithdrawFee"; + $withdrawBody = $withdraw->getBodyPrepared(); + $response = $this->makeRequest($url, $withdrawBody, "POST"); + return $response; + } + + /** + * Withdraw funds from merchant wallet to external wallet. On-chain operation + * @param TelePayWithdrawInput $withdraw + */ + public function withdraw($withdraw) + { + $this->validate($withdraw->getAsset(), $withdraw->getBlockchain(), $withdraw->getNetwork()); + $url = $this->environment->getBaseUrl() . "withdraw"; + $withdrawBody = $withdraw->getBodyPrepared(); + set_time_limit(60); + $response = $this->makeRequest($url, $withdrawBody, "POST"); + return $response; + } + + /** + * Get webhooks + */ + public function getWebhooks() + { + $url = $this->environment->getBaseUrl() . "getWebhooks"; + $response = $this->makeRequest($url); + return $response; + } + + /** + * Get webhook details + * @param int $webhookId + */ + public function getWebhook($webhookId) + { + $url = $this->environment->getBaseUrl() . "getWebhook/" . $webhookId; + $response = $this->makeRequest($url); + return $response; + } + + /** + * Create a new webhook + * @param TelePayWebhookInput $webhook + */ + public function createWebhook($webhook) + { + $url = $this->environment->getBaseUrl() . "createWebhook"; + $webhookBody = $webhook->getBodyPrepared(); + $response = $this->makeRequest($url, $webhookBody, "POST"); + return $response; + } + + /** + * Update a webhook + * @param int $webhookId + * @param TelePayWebhookInput $webhook + */ + public function updateWebhook($webhookId, $webhook) + { + $url = $this->environment->getBaseUrl() . "updateWebhook/" . $webhookId; + $webhookBody = $webhook->getBodyPrepared(); + unset($webhookBody['active']); + $response = $this->makeRequest($url, $webhookBody, "POST"); + return $response; + } + + /** + * Deletes a webhook + * @param int $webhookId + */ + public function deleteWebhook($webhookId) + { + $url = $this->environment->getBaseUrl() . "deleteWebhook/" . $webhookId; + $response = $this->makeRequest($url, [], "POST"); + return $response; + } + + /** + * Activates a webhook + * @param int $webhookId + */ + public function activateWebhook($webhookId) + { + $url = $this->environment->getBaseUrl() . "activateWebhook/" . $webhookId; + $response = $this->makeRequest($url, [], "POST"); + return $response; + } + + /** + * Deactivates a webhook + * @param int $webhookId + */ + public function deactivateWebhook($webhookId) + { + $url = $this->environment->getBaseUrl() . "deactivateWebhook/" . $webhookId; + $response = $this->makeRequest($url, [], "POST"); + return $response; + } + + /** + * Validate asset, blockchain and network combination + * @param string $asset + * @param string $blockchain + * @param string $network + * @return void + * @throws TelePayException + */ + public function validate($asset, $blockchain, $network) + { + $assetsResponse = $this->getAssets(); + $combinationExist = false; + foreach ($assetsResponse['assets'] as $assetItem) { + if ($assetItem['asset'] != $asset || $assetItem['blockchain'] != $blockchain) { + continue; + } + foreach ($assetItem['networks'] as $networkItem) { + if ($networkItem == $network) { + $combinationExist = true; + break; + } + } + if ($combinationExist) { + break; + } + } + if (!$combinationExist) { + throw new TelePayException( + "The combination of asset $asset, blockchain $blockchain and network $network does not exist", + 401, + "INVALID_ASSET_BLOCKCHAIN_NETWORK_COMBINATION" + ); + } + } + + private function makeRequest($url, $body = [], $verb = "GET") + { + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, $url); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + curl_setopt($curl, CURLOPT_HTTPHEADER, array( + 'Accept: application/json', + 'Content-Type: application/json', + 'AUTHORIZATION: ' . $this->environment->getClientSecret() + )); + if ($body) { + curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($body)); + } + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $verb); + $response = json_decode(curl_exec($curl), true); + $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); + curl_close($curl); + if ($httpCode != 200 && $httpCode != 201) { + if (isset($response['error'])) { + throw new TelePayException($response['message'], $httpCode, $response['error']); + } + throw new TelePayException(json_encode($response), $httpCode); + } + return $response; + } + + /** + * Validate Webhooks signature + * @param string $data + * @param string $signature + * @return boolean + */ + public function validateSignature($data, $signature) + { + $data = str_replace(["\"", "null"], ["'", "None"], $data); + $hashSecret = hash('sha1', $this->environment->getClientSecret()); + $hashData = hash('sha512', utf8_encode($data)); + $mySignature = hash('sha512', ($hashSecret . $hashData)); + return $mySignature === $signature; + } +} diff --git a/vendor/telepaycash/sdk-telepay-php/src/TelePayEnvironment.php b/vendor/telepaycash/sdk-telepay-php/src/TelePayEnvironment.php new file mode 100644 index 0000000..f67fe17 --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/src/TelePayEnvironment.php @@ -0,0 +1,21 @@ +clientSecret = $clientSecret; + } + public function getClientSecret() + { + return $this->clientSecret; + } + + public function getBaseUrl() + { + return "https://api.telepay.cash/rest/"; + } +} \ No newline at end of file diff --git a/vendor/telepaycash/sdk-telepay-php/src/TelePayEvents.php b/vendor/telepaycash/sdk-telepay-php/src/TelePayEvents.php new file mode 100644 index 0000000..6582aa4 --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/src/TelePayEvents.php @@ -0,0 +1,43 @@ +statusCode = $status; + $this->error = $error; + parent::__construct($message); + } + + public function getName() + { + return 'TelePay Exception'; + } + + public function getStatusCode() + { + return $this->statusCode; + } + + public function getError() + { + return $this->error; + } +} \ No newline at end of file diff --git a/vendor/telepaycash/sdk-telepay-php/src/TelePayInvoiceInput.php b/vendor/telepaycash/sdk-telepay-php/src/TelePayInvoiceInput.php new file mode 100644 index 0000000..f00297a --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/src/TelePayInvoiceInput.php @@ -0,0 +1,113 @@ +setExpiresAt(600); + } + + public function getBodyPrepared() + { + $body = array( + "asset" => $this->asset, + "blockchain" => $this->blockchain, + "network" => $this->network, + "amount" => $this->amount, + "expires_at" => $this->expires_at + ); + if ($this->description) { + $body["description"] = $this->description; + } + if ($this->metadata) { + $body["metadata"] = $this->metadata; + } + if ($this->success_url) { + $body["success_url"] = $this->success_url; + } + if ($this->cancel_url) { + $body["cancel_url"] = $this->cancel_url; + } + return $body; + } + + public function getDescription() + { + return $this->description; + } + public function setDescription($description) + { + $this->description = $description; + } + public function getMetadata() + { + return $this->metadata; + } + public function setMetadata($metadata) + { + $this->metadata = $metadata; + } + public function getSuccessUrl() + { + return $this->success_url; + } + public function setSuccessUrl($success_url) + { + $this->success_url = $success_url; + } + public function getCancelUrl() + { + return $this->cancel_url; + } + public function setCancelUrl($cancel_url) + { + $this->cancel_url = $cancel_url; + } + public function getExpiresAt() + { + return $this->expires_at; + } + public function setExpiresAt($expires_at) + { + $this->expires_at = $expires_at; + } +} diff --git a/vendor/telepaycash/sdk-telepay-php/src/TelePayTransferInput.php b/vendor/telepaycash/sdk-telepay-php/src/TelePayTransferInput.php new file mode 100644 index 0000000..3de32b8 --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/src/TelePayTransferInput.php @@ -0,0 +1,65 @@ +setUsername($username); + } + public function getBodyPrepared() + { + $body = array( + "asset" => $this->asset, + "blockchain" => $this->blockchain, + "network" => $this->network, + "amount" => $this->amount, + "username" => $this->username + ); + if ($this->message) { + $body["message"] = $this->message; + } + return $body; + } + + public function getUsername() + { + return $this->username; + } + public function setUsername($username) + { + $this->username = $username; + } + public function getMessage() + { + return $this->message; + } + public function setMessage($message) + { + $this->message = $message; + } +} \ No newline at end of file diff --git a/vendor/telepaycash/sdk-telepay-php/src/TelePayWebhookInput.php b/vendor/telepaycash/sdk-telepay-php/src/TelePayWebhookInput.php new file mode 100644 index 0000000..d05b50c --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/src/TelePayWebhookInput.php @@ -0,0 +1,103 @@ +setUrl($url); + $this->setSecret($secret); + $this->setEvents($events); + $this->setActive($active); + } + public function getBodyPrepared() + { + $body = [ + "url" => $this->url, + "secret" => $this->secret, + "events" => $this->events, + ]; + if ($this->active !== null) { + $body["active"] = $this->active; + } + return $body; + } + + /** + * Set and get the url. + */ + public function getUrl() + { + return $this->url; + } + public function setUrl($url) + { + $this->url = $url; + } + + /** + * Set and get the secret. + */ + public function getSecret() + { + return $this->secret; + } + public function setSecret($secret) + { + $this->secret = $secret; + } + + /** + * Set and get the events. + */ + public function getEvents() + { + return $this->events; + } + public function setEvents($events) + { + if (!is_array($events)) { + $events = [$events]; + } + foreach ($events as $event) { + TelePayEvents::validate($event); + } + $this->events = $events; + } + + /** + * Set and get the active. + */ + public function getActive() + { + return $this->active; + } + public function setActive($active) + { + $this->active = $active; + } +} diff --git a/vendor/telepaycash/sdk-telepay-php/src/TelePayWithdrawInput.php b/vendor/telepaycash/sdk-telepay-php/src/TelePayWithdrawInput.php new file mode 100644 index 0000000..b3d18f5 --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/src/TelePayWithdrawInput.php @@ -0,0 +1,66 @@ +setToAddress($to_address); + } + public function getBodyPrepared() + { + $body = array( + "asset" => $this->asset, + "blockchain" => $this->blockchain, + "network" => $this->network, + "amount" => $this->amount, + "to_address" => $this->to_address + ); + if ($this->message) { + $body["message"] = $this->message; + } + return $body; + } + + public function getToAddress() + { + return $this->to_address; + } + public function setToAddress($to_address) + { + $this->to_address = $to_address; + } + + public function getMessage() + { + return $this->message; + } + public function setMessage($message) + { + $this->message = $message; + } +} \ No newline at end of file diff --git a/vendor/telepaycash/sdk-telepay-php/tests/Asset/AssetsTest.php b/vendor/telepaycash/sdk-telepay-php/tests/Asset/AssetsTest.php new file mode 100644 index 0000000..1208cd3 --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/tests/Asset/AssetsTest.php @@ -0,0 +1,41 @@ +getAssets(); + + $this->assertNotNull($assets); + $this->assertArrayHasKey('assets', $assets); + + $assets = $assets['assets']; + $this->assertIsArray($assets); + $this->assertGreaterThanOrEqual(1, count($assets)); + foreach ($assets as $asset) { + $this->assertArrayHasKey('asset', $asset); + $this->assertNotNull($asset['asset']); + + $this->assertArrayHasKey('blockchain', $asset); + $this->assertNotNull($asset['blockchain']); + + $this->assertArrayHasKey('url', $asset); + $this->assertNotNull($asset['url']); + + $this->assertArrayHasKey('networks', $asset); + + $networks = $asset['networks']; + $this->assertIsArray($networks); + foreach ($networks as $network) { + $this->assertIsString($network); + } + } + } +} \ No newline at end of file diff --git a/vendor/telepaycash/sdk-telepay-php/tests/Invoice/InvoiceTest.php b/vendor/telepaycash/sdk-telepay-php/tests/Invoice/InvoiceTest.php new file mode 100644 index 0000000..0eb579c --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/tests/Invoice/InvoiceTest.php @@ -0,0 +1,234 @@ + 20, + "other_metadata" => "any value" + ]; + private $success_url = "https://www.example.com/payment_success?order_id=20"; + private $cancel_url = "https://www.example.com/payment_cancelled?order_id=20"; + + public function testCreateInvoiceSuccessfull() + { + $telepay = TestInit::client(); + + $newInvoice = new TelePayInvoiceInput($this->asset, $this->blockchain, $this->network, $this->amount); + $newInvoice->setDescription($this->description); + $newInvoice->setMetadata($this->metadata); + $newInvoice->setSuccessUrl($this->success_url); + $newInvoice->setCancelUrl($this->cancel_url); + + $invoice = $telepay->createInvoice($newInvoice); + + $this->assertNotNull($invoice); + $this->assertArrayHasKey('number', $invoice); + $this->assertNotNull($invoice['number']); + + $this->assertArrayHasKey('asset', $invoice); + $this->assertNotNull($invoice['asset']); + $this->assertEquals($this->asset, $invoice['asset']); + + $this->assertArrayHasKey('blockchain', $invoice); + $this->assertNotNull($invoice['blockchain']); + $this->assertEquals($this->blockchain, $invoice['blockchain']); + + $this->assertArrayHasKey('network', $invoice); + $this->assertNotNull($invoice['network']); + $this->assertEquals($this->network, $invoice['network']); + + $this->assertArrayHasKey('amount', $invoice); + $this->assertNotNull($invoice['amount']); + $this->assertTrue( $this->amount == $invoice['amount']); + + $this->assertArrayHasKey('description', $invoice); + $this->assertNotNull($invoice['description']); + $this->assertEquals($this->description, $invoice['description']); + + $this->assertArrayHasKey('metadata', $invoice); + $this->assertNotNull($invoice['metadata']); + $this->assertEquals($this->metadata, $invoice['metadata']); + + $this->assertArrayHasKey('success_url', $invoice); + $this->assertNotNull($invoice['success_url']); + $this->assertEquals($this->success_url, $invoice['success_url']); + + $this->assertArrayHasKey('cancel_url', $invoice); + $this->assertNotNull($invoice['cancel_url']); + $this->assertEquals($this->cancel_url, $invoice['cancel_url']); + + $this->assertArrayHasKey('status', $invoice); + $this->assertNotNull($invoice['status']); + $this->assertEquals('pending', $invoice['status']); + + $this->assertArrayHasKey('checkout_url', $invoice); + $this->assertNotNull($invoice['checkout_url']); + + $this->assertArrayHasKey('onchain_url', $invoice); + $this->assertNotNull($invoice['onchain_url']); + + return $invoice['number']; + } + + public function testCreateInvoiceFail() + { + $telepay = TestInit::client(); + + $unexistentAsset = "UNEXISTENT"; + + $newInvoice = new TelePayInvoiceInput($unexistentAsset, $this->blockchain, $this->network, $this->amount); + $newInvoice->setDescription($this->description); + $newInvoice->setMetadata($this->metadata); + $newInvoice->setSuccessUrl($this->success_url); + $newInvoice->setCancelUrl($this->cancel_url); + + try { + $telepay->createInvoice($newInvoice); + $this->fail('TelePayException was not thrown'); + } catch (TelePayException $exception) { + $this->assertEquals(401, $exception->getStatusCode()); + $this->assertEquals('INVALID_ASSET_BLOCKCHAIN_NETWORK_COMBINATION', $exception->getError()); + } + } + + /** + * @depends testCreateInvoiceSuccessfull + */ + public function testGetInvoiceByNumber($invoiceNumber) + { + $telepay = TestInit::client(); + $invoice = $telepay->getInvoice($invoiceNumber); + + $this->assertNotNull($invoice); + $this->assertArrayHasKey('number', $invoice); + $this->assertNotNull($invoice['number']); + + $this->assertArrayHasKey('asset', $invoice); + $this->assertNotNull($invoice['asset']); + $this->assertEquals($this->asset, $invoice['asset']); + + $this->assertArrayHasKey('blockchain', $invoice); + $this->assertNotNull($invoice['blockchain']); + $this->assertEquals($this->blockchain, $invoice['blockchain']); + + $this->assertArrayHasKey('network', $invoice); + + $this->assertArrayHasKey('amount', $invoice); + $this->assertNotNull($invoice['amount']); + $this->assertEquals((float) $this->amount, $invoice['amount']); + + $this->assertArrayHasKey('description', $invoice); + $this->assertNotNull($invoice['description']); + $this->assertEquals($this->description, $invoice['description']); + + $this->assertArrayHasKey('metadata', $invoice); + $this->assertNotNull($invoice['metadata']); + $this->assertEquals($this->metadata, $invoice['metadata']); + + $this->assertArrayHasKey('success_url', $invoice); + $this->assertNotNull($invoice['success_url']); + $this->assertEquals($this->success_url, $invoice['success_url']); + + $this->assertArrayHasKey('cancel_url', $invoice); + $this->assertNotNull($invoice['cancel_url']); + $this->assertEquals($this->cancel_url, $invoice['cancel_url']); + + $this->assertArrayHasKey('status', $invoice); + $this->assertNotNull($invoice['status']); + $this->assertEquals('pending', $invoice['status']); + + $this->assertArrayHasKey('checkout_url', $invoice); + $this->assertNotNull($invoice['checkout_url']); + + $this->assertArrayHasKey('onchain_url', $invoice); + $this->assertNotNull($invoice['onchain_url']); + + return $invoiceNumber; + } + + /** + * @depends testGetInvoiceByNumber + */ + public function testCancelInvoiceByNumber($invoiceNumber) + { + $telepay = TestInit::client(); + $invoice = $telepay->cancelInvoice($invoiceNumber); + + $this->assertNotNull($invoice); + $this->assertArrayHasKey('number', $invoice); + $this->assertNotNull($invoice['number']); + + $this->assertArrayHasKey('asset', $invoice); + $this->assertNotNull($invoice['asset']); + $this->assertEquals($this->asset, $invoice['asset']); + + $this->assertArrayHasKey('blockchain', $invoice); + $this->assertNotNull($invoice['blockchain']); + $this->assertEquals($this->blockchain, $invoice['blockchain']); + + $this->assertArrayHasKey('network', $invoice); + $this->assertEquals($this->network, $invoice['network']); + + $this->assertArrayHasKey('amount', $invoice); + $this->assertNotNull($invoice['amount']); + $this->assertEquals((float) $this->amount, $invoice['amount']); + + $this->assertArrayHasKey('description', $invoice); + $this->assertNotNull($invoice['description']); + $this->assertEquals($this->description, $invoice['description']); + + $this->assertArrayHasKey('metadata', $invoice); + $this->assertNotNull($invoice['metadata']); + $this->assertEquals($this->metadata, $invoice['metadata']); + + $this->assertArrayHasKey('success_url', $invoice); + $this->assertNotNull($invoice['success_url']); + $this->assertEquals($this->success_url, $invoice['success_url']); + + $this->assertArrayHasKey('cancel_url', $invoice); + $this->assertNotNull($invoice['cancel_url']); + $this->assertEquals($this->cancel_url, $invoice['cancel_url']); + + $this->assertArrayHasKey('status', $invoice); + $this->assertNotNull($invoice['status']); + $this->assertEquals('cancelled', $invoice['status']); + + $this->assertArrayHasKey('checkout_url', $invoice); + $this->assertNotNull($invoice['checkout_url']); + + $this->assertArrayHasKey('onchain_url', $invoice); + $this->assertNotNull($invoice['onchain_url']); + + + $checkInvoice = $telepay->getInvoice($invoiceNumber); + $this->assertNotNull($checkInvoice); + $this->assertArrayHasKey('status', $checkInvoice); + $this->assertEquals('cancelled', $checkInvoice['status']); + + return $invoiceNumber; + } + + /** + * @depends testCancelInvoiceByNumber + */ + public function testDeleteInvoiceByNumber($invoiceNumber) + { + $telepay = TestInit::client(); + $response = $telepay->deleteInvoice($invoiceNumber); + $this->assertNotNull($response); + $this->assertEquals('invoice.deleted', $response['success']); + } +} diff --git a/vendor/telepaycash/sdk-telepay-php/tests/Merchant/MerchantTest.php b/vendor/telepaycash/sdk-telepay-php/tests/Merchant/MerchantTest.php new file mode 100644 index 0000000..1e6986c --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/tests/Merchant/MerchantTest.php @@ -0,0 +1,40 @@ +getMe(); + $this->assertNotNull($me); + $this->assertArrayHasKey('version', $me); + $this->assertArrayHasKey('merchant', $me); + + $merchant = $me['merchant']; + $this->assertArrayHasKey('name', $merchant); + $this->assertArrayHasKey('url', $merchant); + $this->assertArrayHasKey('logo_url', $merchant); + $this->assertArrayHasKey('logo_thumbnail_url', $merchant); + $this->assertArrayHasKey('verified', $merchant); + $this->assertArrayHasKey('username', $merchant); + $this->assertArrayHasKey('public_profile', $merchant); + + $this->assertArrayHasKey('owner', $merchant); + + $owner = $merchant['owner']; + $this->assertNotNull($owner); + $this->assertArrayHasKey('first_name', $owner); + $this->assertArrayHasKey('last_name', $owner); + $this->assertArrayHasKey('username', $owner); + + $this->assertArrayHasKey('created_at', $merchant); + $this->assertArrayHasKey('updated_at', $merchant); + } +} diff --git a/vendor/telepaycash/sdk-telepay-php/tests/TestInit.php b/vendor/telepaycash/sdk-telepay-php/tests/TestInit.php new file mode 100644 index 0000000..674905c --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/tests/TestInit.php @@ -0,0 +1,19 @@ +asset, $this->blockchain, $this->network, $this->amount, $this->getUsername()); + $transfer->setMessage($this->message); + + $respTransfer = $telepay->transfer($transfer); + + $this->assertNotNull($respTransfer); + $this->assertArrayHasKey('success', $respTransfer); + $this->assertEquals("transfer.ok", $respTransfer['success']); + } + + public function testTransferenceFail() + { + $telepay = TestInit::client(); + + $unexistentAsset = "UNEXISTENT"; + + $transfer = new TelePayTransferInput($unexistentAsset, $this->blockchain, $this->network, $this->amount, $this->getUsername()); + $transfer->setMessage($this->message); + + try { + $telepay->transfer($transfer); + $this->fail('TelePayException was not thrown'); + } catch (TelePayException $exception) { + $this->assertEquals(401, $exception->getStatusCode()); + $this->assertEquals('INVALID_ASSET_BLOCKCHAIN_NETWORK_COMBINATION', $exception->getError()); + } + } +} diff --git a/vendor/telepaycash/sdk-telepay-php/tests/Wallet/WalletTest.php b/vendor/telepaycash/sdk-telepay-php/tests/Wallet/WalletTest.php new file mode 100644 index 0000000..720cc85 --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/tests/Wallet/WalletTest.php @@ -0,0 +1,66 @@ +getBalance($asset); + + $this->assertNotNull($balance); + $this->assertArrayHasKey('wallets', $balance); + + $wallets = $balance['wallets']; + $this->assertIsArray($wallets); + $this->assertEquals(1, count($wallets)); + + $wallet = $wallets[0]; + $this->assertArrayHasKey('asset', $wallet); + $this->assertNotNull($wallet['asset']); + + $this->assertArrayHasKey('blockchain', $wallet); + $this->assertNotNull($wallet['blockchain']); + + $this->assertArrayHasKey('balance', $wallet); + $this->assertNotNull($wallet['balance']); + + $this->assertArrayHasKey('network', $wallet); + + return $balance; + } + + public function testGetAllBalances() + { + $telepay = TestInit::client(); + + $balances = $telepay->getAllBalances(); + + $this->assertNotNull($balances); + $this->assertArrayHasKey('wallets', $balances); + + $wallets = $balances['wallets']; + $this->assertIsArray($wallets); + $this->assertGreaterThanOrEqual(1, count($wallets)); + foreach ($wallets as $wallet) { + $this->assertArrayHasKey('asset', $wallet); + $this->assertNotNull($wallet['asset']); + + $this->assertArrayHasKey('blockchain', $wallet); + $this->assertNotNull($wallet['blockchain']); + + $this->assertArrayHasKey('balance', $wallet); + $this->assertNotNull($wallet['balance']); + + $this->assertArrayHasKey('network', $wallet); + } + } +} diff --git a/vendor/telepaycash/sdk-telepay-php/tests/Webhook/WebhookTest.php b/vendor/telepaycash/sdk-telepay-php/tests/Webhook/WebhookTest.php new file mode 100644 index 0000000..fc30c83 --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/tests/Webhook/WebhookTest.php @@ -0,0 +1,144 @@ +url, $this->secret, $this->events); + + $webhook = $telepay->createWebhook($newWebhook); + + $this->assertNotNull($webhook); + $this->assertArrayHasKey('id', $webhook); + $this->assertNotNull($webhook['id']); + + $this->assertArrayHasKey('url', $webhook); + $this->assertNotNull($webhook['url']); + $this->assertEquals($this->url, $webhook['url']); + + $this->assertArrayHasKey('secret', $webhook); + $this->assertNotNull($webhook['secret']); + $this->assertEquals($this->secret, $webhook['secret']); + + $this->assertArrayHasKey('active', $webhook); + $this->assertNotNull($webhook['active']); + + $this->assertArrayHasKey('events', $webhook); + $this->assertNotNull($webhook['events']); + $this->assertEquals($this->events, $webhook['events']); + + return $webhook['id']; + } + + /** + * @depends testCreateWebhookSuccessfull + */ + public function testGetWebhookByNumber($webhookNumber) + { + $telepay = TestInit::client(); + $webhook = $telepay->getWebhook($webhookNumber); + + $this->assertNotNull($webhook); + $this->assertArrayHasKey('id', $webhook); + $this->assertNotNull($webhook['id']); + + $this->assertArrayHasKey('url', $webhook); + $this->assertNotNull($webhook['url']); + $this->assertEquals($this->url, $webhook['url']); + + $this->assertArrayHasKey('secret', $webhook); + $this->assertNotNull($webhook['secret']); + $this->assertEquals($this->secret, $webhook['secret']); + + $this->assertArrayHasKey('active', $webhook); + $this->assertNotNull($webhook['active']); + + $this->assertArrayHasKey('events', $webhook); + $this->assertNotNull($webhook['events']); + $this->assertEquals($this->events, $webhook['events']); + + return $webhookNumber; + } + + /** + * @depends testGetWebhookByNumber + */ + public function testDeactivateWebhook($webhookNumber) + { + $telepay = TestInit::client(); + + $webhook = $telepay->deactivateWebhook($webhookNumber); + + $this->assertNotNull($webhook); + $this->assertArrayHasKey('active', $webhook); + $this->assertEquals($webhook['active'], false); + + return $webhookNumber; + } + + /** + * @depends testDeactivateWebhook + */ + public function testUpdateWebhook($webhookNumber) + { + $telepay = TestInit::client(); + + $newSecret = "newSecret"; + $updateWebhook = new TelePayWebhookInput($this->url, $newSecret, $this->events, false); + + $webhook = $telepay->updateWebhook($webhookNumber, $updateWebhook); + + $this->assertNotNull($webhook); + $this->assertArrayHasKey('id', $webhook); + $this->assertEquals($webhook['id'], $webhookNumber); + $this->assertArrayHasKey('secret', $webhook); + $this->assertEquals($webhook['secret'], $newSecret); + $this->assertArrayHasKey('active', $webhook); + + return $webhookNumber; + } + + /** + * @depends testUpdateWebhook + */ + public function testActivateWebhook($webhookNumber) + { + $telepay = TestInit::client(); + + $webhook = $telepay->activateWebhook($webhookNumber); + + $this->assertNotNull($webhook); + $this->assertArrayHasKey('active', $webhook); + $this->assertEquals($webhook['active'], true); + + return $webhookNumber; + } + + /** + * @depends testActivateWebhook + */ + public function testDeleteWebhookByNumber($webhookNumber) + { + $telepay = TestInit::client(); + $response = $telepay->deleteWebhook($webhookNumber); + $this->assertNotNull($response); + $this->assertArrayHasKey('success', $response); + $this->assertEquals($response['success'], 'webhook.deleted'); + } +} diff --git a/vendor/telepaycash/sdk-telepay-php/tests/Withdraw/WithdrawTest.php b/vendor/telepaycash/sdk-telepay-php/tests/Withdraw/WithdrawTest.php new file mode 100644 index 0000000..0debdb3 --- /dev/null +++ b/vendor/telepaycash/sdk-telepay-php/tests/Withdraw/WithdrawTest.php @@ -0,0 +1,90 @@ +asset, $this->blockchain, $this->network, $this->amount, $this->getWallet()); + $withdraw->setMessage($this->message); + + $respWithdrawFee = $telepay->getWithdrawFee($withdraw); + + $this->assertNotNull($respWithdrawFee); + $this->assertArrayHasKey('blockchain_fee', $respWithdrawFee); + $this->assertNotNull($respWithdrawFee['blockchain_fee']); + $this->assertArrayHasKey('processing_fee', $respWithdrawFee); + $this->assertNotNull($respWithdrawFee['processing_fee']); + $this->assertArrayHasKey('total', $respWithdrawFee); + $this->assertNotNull($respWithdrawFee['total']); + } + + public function testWithdrawFeeFail() + { + $telepay = TestInit::client(); + + $unexistentAsset = "UNEXISTENT"; + + $withdraw = new TelePayWithdrawInput($unexistentAsset, $this->blockchain, $this->network, $this->amount, $this->getWallet()); + $withdraw->setMessage($this->message); + + try { + $telepay->getWithdrawFee($withdraw); + $this->fail('TelePayException was not thrown'); + } catch (TelePayException $exception) { + $this->assertEquals(401, $exception->getStatusCode()); + $this->assertEquals('INVALID_ASSET_BLOCKCHAIN_NETWORK_COMBINATION', $exception->getError()); + } + } + + public function testWithdrawSuccessfull() + { + $telepay = TestInit::client(); + + $withdraw = new TelePayWithdrawInput($this->asset, $this->blockchain, $this->network, $this->amount, $this->getWallet()); + $withdraw->setMessage($this->message); + + $respWithdraw = $telepay->withdraw($withdraw); + + $this->assertNotNull($respWithdraw); + $this->assertEquals('pending', $respWithdraw['status']); + } + + public function testWithdrawFail() + { + $telepay = TestInit::client(); + + $unexistentAsset = "UNEXISTENT"; + + $withdraw = new TelePayWithdrawInput($unexistentAsset, $this->blockchain, $this->network, $this->amount, $this->getWallet()); + $withdraw->setMessage($this->message); + + try { + $telepay->withdraw($withdraw); + $this->fail('TelePayException was not thrown'); + } catch (TelePayException $exception) { + $this->assertEquals(401, $exception->getStatusCode()); + $this->assertEquals('INVALID_ASSET_BLOCKCHAIN_NETWORK_COMBINATION', $exception->getError()); + } + } +} From 816cd32393c3932746545e44325619f2e2840a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D8=B9=D8=A7=D8=B1=D9=81=20=D8=B3=D9=84=DB=8C=D9=85=D8=A7?= =?UTF-8?q?=D9=86=DB=8C?= <95649368+DeAref@users.noreply.github.com> Date: Mon, 6 Feb 2023 18:32:03 +0330 Subject: [PATCH 2/2] Create README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..06139ab --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# telepay-php-example + +## with this repo you can install telepay-php library without use composer