edit more

This commit is contained in:
Hesabix 2024-01-11 11:12:59 +00:00
parent 8699a81fc8
commit bb5115f04b
4 changed files with 7 additions and 31 deletions

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -990,34 +990,13 @@ class Ssbhesabix_Setting {
'type' => 'text',
);
$fields[] = array(
'title' => __( 'Email', 'ssbhesabix' ),
'desc' => __( 'Enter a Hesabix email account', 'ssbhesabix' ),
'id' => 'ssbhesabix_account_username',
'type' => 'email',
);
$fields[] = array(
'title' => __( 'Password', 'ssbhesabix' ),
'desc' => __( 'Enter a Hesabix password', 'ssbhesabix' ),
'id' => 'ssbhesabix_account_password',
'type' => 'password',
);
$fields[] = array(
'title' => __( 'Login token', 'ssbhesabix' ),
'desc' => __( 'Find Login token in Setting->Financial Settings->API Menu', 'ssbhesabix' ),
'id' => 'ssbhesabix_account_login_token',
'type' => 'text',
);
$fields[] = array(
'title' => __( 'API Address', 'ssbhesabix' ),
'id' => 'ssbhesabix_api_address',
'type' => 'select',
'options' => array(
"0" => "hesabix.ir",
"1" => "api.hesabix.ir"
"1" => "next.hesabix.ir"
)
);
@ -1045,10 +1024,6 @@ class Ssbhesabix_Setting {
برای اتصال به API حسابیکس و فعال شدن این افزونه باید در اینجا
کلید API و توکن ورود به کسب و کار خود را وارد کنید.
</li>
<li>
اگر برای اتصال به API حسابیکس از توکن ورود استفاده کنید
نیازی به وارد کردن ایمیل و رمز عبور نیست.
</li>
<li>
برای پیدا کردن توکن ورود و کلید API، در حسابیکس به قسمت تنظیمات، تنظیمات API مراجعه کنید.
</li>

View file

@ -20,11 +20,11 @@ class Ssbhesabix_Api
{
if ($method == null) return false;
$endpoint = 'https://hesabix.ir/v1/' . $method;
$endpoint = 'https://hesabix.ir/' . $method;
$apiAddress = get_option('ssbhesabix_api_address', 0);
if($apiAddress == 1) $endpoint = 'http://api.hesabix.ir/v1/' . $method;
if($apiAddress == 1) $endpoint = 'http://next.hesabix.ir/' . $method;
$body = array_merge(array(
'apiKey' => get_option('ssbhesabix_account_api'),
@ -68,7 +68,7 @@ class Ssbhesabix_Api
return 'No response from Hesabix';
} else {
if (!isset($result->Success)) {
switch ($result->ErrorCode) {
switch ($result->errorCode) {
case '100':
return 'InternalServerError';
case '101':
@ -398,7 +398,8 @@ class Ssbhesabix_Api
//Settings functions
public function settingSetChangeHook($url, $hookPassword)
{
$method = 'setting/SetChangeHook';
$method = 'api/settings/chack-api';
echo 11;
$data = array(
'url' => $url,
'hookPassword' => $hookPassword,

View file

@ -26,7 +26,7 @@ class Ssbhesabix_i18n {
load_plugin_textdomain(
'ssbhesabix',
false,
dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages1/'
);
}