{"id":15143556,"url":"https://github.com/muqsit/tebex","last_synced_at":"2025-10-23T20:30:36.164Z","repository":{"id":45054508,"uuid":"286594228","full_name":"Muqsit/Tebex","owner":"Muqsit","description":"Tebex plugin for PocketMine-MP servers","archived":false,"fork":false,"pushed_at":"2024-06-23T08:07:52.000Z","size":338,"stargazers_count":32,"open_issues_count":2,"forks_count":7,"subscribers_count":4,"default_branch":"pmmp-api5","last_synced_at":"2025-01-30T20:51:42.435Z","etag":null,"topics":["api3","buycraft","phpstan-l8","phpstan-strict","plugin","pmmp","pocketmine","tebex"],"latest_commit_sha":null,"homepage":"https://poggit.pmmp.io/ci/Muqsit/Tebex","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Muqsit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-10T22:51:53.000Z","updated_at":"2024-11-29T02:46:56.000Z","dependencies_parsed_at":"2023-11-12T03:26:37.065Z","dependency_job_id":"43c5edf4-dc18-4279-a4ba-4e69640753da","html_url":"https://github.com/Muqsit/Tebex","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Muqsit%2FTebex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Muqsit%2FTebex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Muqsit%2FTebex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Muqsit%2FTebex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Muqsit","download_url":"https://codeload.github.com/Muqsit/Tebex/tar.gz/refs/heads/pmmp-api5","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237882172,"owners_count":19381176,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api3","buycraft","phpstan-l8","phpstan-strict","plugin","pmmp","pocketmine","tebex"],"created_at":"2024-09-26T10:01:56.446Z","updated_at":"2025-10-23T20:30:35.797Z","avatar_url":"https://github.com/Muqsit.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tebex\nTebex webstore integration for PocketMine-MP.\n\n## Features\n- `disable-sub-commands` configuration so you can disable `/tebex secret` and other risky sub-commands when running in production.\n- Running tebex API calls over a dedicated child thread so the main thread doesn't lag when checking for pending commands, running `/tebex refresh` etc.\n\n## Developer Docs\nAt the moment, there isn't a method to interact with this plugin. The plugin however has the Tebex API and handling split — `tebex/handler/*` makes use of TebexAPI.\nYou can create a new TebexAPI instance and supply any valid secret to it and call tebex endpoints. All method calls in TebexAPI are run on child thread(s) so you'll need to supply\na `TebexResponseHandler $callback` to retrieve responses.\n```php\nTebexAPI::getInformation(TebexResponseHandler $callback) : void\n```\nYou may construct a `new TebexResponseHandler(Closure\u003cTebexResponse, void\u003e $on_success, Closure\u003cTebexException, void\u003e $on_failure)`, or use the helper methods:\n- `TebexResponseHandler::debug(string $expected_response_class = TebexResponse::class)` — `var_dump`s the response.\n- `TebexResponseHandler::onSuccess(Closure\u003cTebexResponse, void\u003e $on_success)` — Calls `$on_success` on success and logs (level: critical) error message on failure.\n```php\n$secret = \"\";\n$worker_limit = 1;\n$api = new TebexAPI(MainLogger::getLogger(), $secret, SSLConfiguration::recommended(), $worker_limit);\n\n$api-\u003egetInformation(TebexResponseHandler::onSuccess(function(TebexInformation $information) : void{\n\t$account_info = $this-\u003einformation-\u003egetAccount();\n\t$server_info = $this-\u003einformation-\u003egetServer();\n}));\n\n$api-\u003elookup(\"Steve\", TebexResponseHandler::onSuccess(function(TebexUser $user) : void{\n\tvar_dump($user-\u003egetChargebackRate());\n}));\n\n$api-\u003elookup(\"Alex\", TebexResponseHandler::debug(TebexUser::class)); // var_dump()s the TebexUser on success\n\n$api-\u003ewaitAll(); // wait until all queued requests have received responses\n$api-\u003eshutdown(); // shutdown connection (stops all threads and unlinks temp SSL files)\n```\nNot all Tebex endpoints have been implemented in TebexAPI. You may create an issue or a PR adding the missing ones or create one yourself (take a look at classes in `tebex\\api`, use `TebexAPI::request(TebexRequest, TebexResponseHandler)` to dispatch custom ones).\n\n## Notes\nThe [official Tebex plugin for PocketMine](https://github.com/tebexio/BuycraftPM) runs refresh tasks on main thread, freezing the server based on Tebex \u003c-\u003e Your Minecraft Server\nlatency. It executes Tebex API calls while having `CURLOPT_SSL_VERIFYPEER` disabled, thereby allowing man-in-the-middle (MITM) attacks and has some unnecessary commands that\ndo not suit Bedrock Edition (the `/buy` GUI command) which is why I decided to write a tebex integration plugin from scratch.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuqsit%2Ftebex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuqsit%2Ftebex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuqsit%2Ftebex/lists"}