diff --git a/admin/img/hesabfa-logo.fa.png b/admin/img/hesabix-logo.fa.png similarity index 100% rename from admin/img/hesabfa-logo.fa.png rename to admin/img/hesabix-logo.fa.png diff --git a/admin/partials/ssbhesabix-admin-setting.php b/admin/partials/ssbhesabix-admin-setting.php index 7e8d494..55b8a74 100644 --- a/admin/partials/ssbhesabix-admin-setting.php +++ b/admin/partials/ssbhesabix-admin-setting.php @@ -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 و توکن ورود به کسب و کار خود را وارد کنید. -
  • - اگر برای اتصال به API حسابیکس از توکن ورود استفاده کنید - نیازی به وارد کردن ایمیل و رمز عبور نیست. -
  • برای پیدا کردن توکن ورود و کلید API، در حسابیکس به قسمت تنظیمات، تنظیمات API مراجعه کنید.
  • diff --git a/includes/class-ssbhesabix-api.php b/includes/class-ssbhesabix-api.php index a69017e..209e5b6 100644 --- a/includes/class-ssbhesabix-api.php +++ b/includes/class-ssbhesabix-api.php @@ -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, diff --git a/includes/class-ssbhesabix-i18n.php b/includes/class-ssbhesabix-i18n.php index 6f8a849..7eb3708 100644 --- a/includes/class-ssbhesabix-i18n.php +++ b/includes/class-ssbhesabix-i18n.php @@ -26,7 +26,7 @@ class Ssbhesabix_i18n { load_plugin_textdomain( 'ssbhesabix', false, - dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/' + dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages1/' ); }