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', '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( $fields[] = array(
'title' => __( 'API Address', 'ssbhesabix' ), 'title' => __( 'API Address', 'ssbhesabix' ),
'id' => 'ssbhesabix_api_address', 'id' => 'ssbhesabix_api_address',
'type' => 'select', 'type' => 'select',
'options' => array( 'options' => array(
"0" => "hesabix.ir", "0" => "hesabix.ir",
"1" => "api.hesabix.ir" "1" => "next.hesabix.ir"
) )
); );
@ -1045,10 +1024,6 @@ class Ssbhesabix_Setting {
برای اتصال به API حسابیکس و فعال شدن این افزونه باید در اینجا برای اتصال به API حسابیکس و فعال شدن این افزونه باید در اینجا
کلید API و توکن ورود به کسب و کار خود را وارد کنید. کلید API و توکن ورود به کسب و کار خود را وارد کنید.
</li> </li>
<li>
اگر برای اتصال به API حسابیکس از توکن ورود استفاده کنید
نیازی به وارد کردن ایمیل و رمز عبور نیست.
</li>
<li> <li>
برای پیدا کردن توکن ورود و کلید API، در حسابیکس به قسمت تنظیمات، تنظیمات API مراجعه کنید. برای پیدا کردن توکن ورود و کلید API، در حسابیکس به قسمت تنظیمات، تنظیمات API مراجعه کنید.
</li> </li>

View file

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

View file

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