Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
Fixed lunarstatus get the api error
Browse files Browse the repository at this point in the history
  • Loading branch information
lucionescu committed Jan 26, 2024
1 parent 31054a3 commit dca9355
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The software is provided “as is”, without warranty of any kind, express or i
## Supported HikaShop versions
*The plugin has been tested with most versions of HikaShop at every iteration. We recommend using the latest version of HikaShop, but if that is not possible for some reason, test the plugin with your HikaShop version and it would probably function properly.*

## Note for version 2.0.0
## Note for version 2*
1. Before installing the new version, make sure you have processed all orders paid through "Lunar".
1. Please keep in mind that orders not processed by the old "Lunar" method will no longer be able to be processed by the new method.
1. It will be necessary to check and adjust the settings for the "Lunar" payment method if you have such a method already created.
Expand Down
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
All notable changes to this project will be documented in this file.

## 2.0.1 - 2024-01-26
- Fixed lunarstatus get the api error

## 2.0.0 - 2024-01-24
- Changed payment flow to hosted checkout & added mobilepay method

Expand Down
14 changes: 10 additions & 4 deletions lunarstatus/lunarstatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function onBeforeOrderUpdate(&$order, &$do)
}
}

if (! isset($apiResponse)) {
if (isset($apiResponse) && true !== $apiResponse) {
$this->error = $this->getResponseError($apiResponse);
}

Expand All @@ -95,8 +95,10 @@ private function captureTransaction($data)

if (isset($apiResponse['captureState']) && 'completed' === $apiResponse['captureState']) {
$this->db->setQuery($sql)->execute();
return $apiResponse;
return true;
}

return $apiResponse;
}

/**
Expand All @@ -110,8 +112,10 @@ private function refundTransaction($data)

if (isset($apiResponse['refundState']) && 'completed' === $apiResponse['refundState']) {
$this->db->setQuery($sql)->execute();
return $apiResponse;
return true;
}

return $apiResponse;
}

/**
Expand All @@ -125,8 +129,10 @@ private function voidTransaction($data)

if (isset($apiResponse['cancelState']) && 'completed' === $apiResponse['cancelState']) {
$this->db->setQuery($sql)->execute();
return $apiResponse;
return true;
}

return $apiResponse;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lunarstatus/lunarstatus.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<extension type="plugin" version="2.5" method="upgrade" group="hikashop">
<name>Hikashop Lunar Status Plugin</name>
<creationDate>19 April 2022</creationDate>
<version>2.0.0</version>
<version>2.0.1</version>
<author>Lunar</author>
<authorEmail>[email protected]</authorEmail>
<authorUrl>https://lunar.app</authorUrl>
Expand Down

0 comments on commit dca9355

Please sign in to comment.