Skip to content

Commit

Permalink
Merged in WOO-874 (pull request #93)
Browse files Browse the repository at this point in the history
WOO-874

Approved-by: Thomas Tornevall
Approved-by: Gert Larsson
  • Loading branch information
mjresurs committed Dec 21, 2022
2 parents d2e8d2f + 539db05 commit 7623413
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 21 deletions.
18 changes: 0 additions & 18 deletions src/Modules/GetAddress/Controller/GetAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,9 @@

namespace Resursbank\Woocommerce\Modules\GetAddress\Controller;

use JsonException;
use ReflectionException;
use Resursbank\Ecom\Config;
use Resursbank\Ecom\Exception\ApiException;
use Resursbank\Ecom\Exception\AuthException;
use Resursbank\Ecom\Exception\ConfigException;
use Resursbank\Ecom\Exception\CurlException;
use Resursbank\Ecom\Exception\GetAddressException;
use Resursbank\Ecom\Exception\HttpException;
use Resursbank\Ecom\Exception\Validation\EmptyValueException;
use Resursbank\Ecom\Exception\Validation\IllegalTypeException;
use Resursbank\Ecom\Exception\ValidationException;
use Resursbank\Ecom\Lib\Utilities\Session;
use Resursbank\Ecom\Module\Customer\Http\GetAddressController;
use Resursbank\Ecom\Module\Customer\Repository;
Expand All @@ -34,17 +25,8 @@
class GetAddress
{
/**
* @throws ApiException
* @throws AuthException
* @throws ConfigException
* @throws CurlException
* @throws EmptyValueException
* @throws GetAddressException
* @throws HttpException
* @throws IllegalTypeException
* @throws JsonException
* @throws ReflectionException
* @throws ValidationException
*/
public static function exec(): string
{
Expand Down
3 changes: 2 additions & 1 deletion src/Modules/GetAddress/Filter/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Resursbank\Ecom\Exception\ConfigException;
use Resursbank\Ecom\Exception\GetAddressException;
use Resursbank\Ecom\Module\Customer\Widget\GetAddress;
use ResursBank\Module\Data;
use Resursbank\Woocommerce\Util\Route;
use Resursbank\Woocommerce\Util\Url;
use Throwable;
Expand Down Expand Up @@ -81,6 +82,6 @@ public static function exec(): void
}
}

echo $result;
echo Data::getEscapedHtml($result);
}
}
2 changes: 1 addition & 1 deletion src/Settings/PartPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ private static function getAnnuityPeriods(): array
if (isset($annuityFactors)) {
/** @var AnnuityInformation $annuityFactor */
foreach ($annuityFactors->content as $annuityFactor) {
$return[$annuityFactor->durationInMonths] = $annuityFactor->paymentPlanName;
$return[$annuityFactor->durationMonths] = $annuityFactor->paymentPlanName;
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/Util/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static function getScriptUrl(
// NOTE: plugin_dir_url returns everything up to the last slash.
return plugin_dir_url(
file: RESURSBANK_MODULE_DIR_NAME . "/src/Modules/$module/resources/js/" .
str_replace(search: '/', replace: '', subject: $file)
str_replace(search: '/', replace: '', subject: $file)
) . $file;
}

Expand All @@ -52,7 +52,10 @@ public static function getEcomUrl(
/**
* Generate a URL for a given endpoint, with a list of arguments.
*
* @param string $baseUrl
* @param array $arguments
*
* @return string
* @throws IllegalValueException
*/
public static function getQueryArg(string $baseUrl, array $arguments): string
Expand Down

0 comments on commit 7623413

Please sign in to comment.