diff --git a/README.md b/README.md index b19f978..3382d73 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This repository contains the OpenCart wallee payment module that enables the sh ## Documentation -* [English](https://plugin-documentation.wallee.com/wallee-payment/opencart-2.1/1.0.52/docs/en/documentation.html) +* [English](https://plugin-documentation.wallee.com/wallee-payment/opencart-2.1/1.0.53/docs/en/documentation.html) ## Support @@ -21,4 +21,4 @@ Support queries can be issued on the [wallee support site](https://app-wallee.co ## License -Please see the [license file](https://github.com/wallee-payment/opencart-2.1/blob/1.0.52/LICENSE) for more information. \ No newline at end of file +Please see the [license file](https://github.com/wallee-payment/opencart-2.1/blob/1.0.53/LICENSE) for more information. \ No newline at end of file diff --git a/docs/en/documentation.html b/docs/en/documentation.html index 8aafe4e..a13308d 100644 --- a/docs/en/documentation.html +++ b/docs/en/documentation.html @@ -22,7 +22,7 @@

Documentation

  • - + Source
  • @@ -49,7 +49,7 @@

    1. -

      Download the extension.

      +

      Download the extension.

    2. Extract the files and upload the content of the Upload directory into the root directory of your store using FTP/SSH.

      diff --git a/upload/admin/view/template/payment/wallee.tpl b/upload/admin/view/template/payment/wallee.tpl index 96128f7..0b708a7 100644 --- a/upload/admin/view/template/payment/wallee.tpl +++ b/upload/admin/view/template/payment/wallee.tpl @@ -257,14 +257,14 @@
      -

      1.0.52

      +

      1.0.53

      -

      2022/10/24 14:51:52

      +

      2022/11/29 17:27:42

      diff --git a/upload/system/library/wallee/helper.php b/upload/system/library/wallee/helper.php index 69ac313..3e27a59 100644 --- a/upload/system/library/wallee/helper.php +++ b/upload/system/library/wallee/helper.php @@ -3,6 +3,12 @@ require_once DIR_SYSTEM . '/library/wallee/version_helper.php'; class WalleeHelper { + + + const SHOP_SYSTEM = 'x-meta-shop-system'; + const SHOP_SYSTEM_VERSION = 'x-meta-shop-system-version'; + const SHOP_SYSTEM_AND_VERSION = 'x-meta-shop-system-and-version'; + const FALLBACK_LANGUAGE = 'en-US'; /** * @@ -455,8 +461,11 @@ public function getApiClient(){ public function refreshApiClient(){ $this->apiClient = new Wallee\Sdk\ApiClient($this->registry->get('config')->get('wallee_user_id'), - $this->registry->get('config')->get('wallee_application_key')); + $this->registry->get('config')->get('wallee_application_key')); $this->apiClient->setBasePath(self::getBaseUrl() . "/api"); + foreach (self::getDefaultHeaderData() as $key => $value) { + $this->apiClient->addDefaultHeader($key, $value); + } if ($this->registry->get('config')->get('wallee_log_level') >= self::LOG_DEBUG) { $this->apiClient->enableDebugging(); $this->apiClient->setDebugFile(DIR_LOGS . "wallee_communication.log"); @@ -770,4 +779,19 @@ public static function mergeArray(array $first, array $second){ } return $result; } + + + /** + * @return array + */ + protected static function getDefaultHeaderData() + { + $shop_version = VERSION; + [$major_version, $minor_version, $_] = explode('.', $shop_version, 3); + return [ + self::SHOP_SYSTEM => 'opencart-3', + self::SHOP_SYSTEM_VERSION => $shop_version, + self::SHOP_SYSTEM_AND_VERSION => 'opencart-' . $major_version . '.' . $minor_version, + ]; + } }