kernel, env, compoder, botstrap update
This commit is contained in:
36
kernel/services/ModuleShopService.php
Normal file
36
kernel/services/ModuleShopService.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\services;
|
||||
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use kernel\helpers\RESTClient;
|
||||
|
||||
class ModuleShopService
|
||||
{
|
||||
protected string $url;
|
||||
protected string $token;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->url = $_ENV['MODULE_SHOP_URL'];
|
||||
$this->token = $_ENV['MODULE_SHOP_TOKEN'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function email_auth(string $email)
|
||||
{
|
||||
$request = RESTClient::post($this->url . "/api/secure/email_auth", ['email' => $email], false);
|
||||
|
||||
return json_decode($request->getBody()->getContents(), true);
|
||||
}
|
||||
|
||||
public function code_check(string $code)
|
||||
{
|
||||
$request = RESTClient::post($this->url . "/api/secure/code_check", ['code' => $code], false);
|
||||
|
||||
return json_decode($request->getBody()->getContents(), true);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user