Skip to content

Commit 53b5e11

Browse files
committed
Fix validation issues in migration
ADPM-119
1 parent 4d191c5 commit 53b5e11

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/upgrade/upgrade-5.0.0.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ function migratePaymentMethodConfigs(array $migratedShops)
150150
$oneyInstallments = $checkoutProxy->getAvailablePaymentMethods($request);
151151
$oneyEnabledInstallments = [];
152152

153-
foreach ($oneyInstallments as $installment) {
154-
$oneyEnabledInstallments[] = $oneyInstallmentsMap[$installment];
153+
foreach ($oneyInstallments->getPaymentMethodsResponse() as $installment) {
154+
$oneyEnabledInstallments[] = $oneyInstallmentsMap[$installment->getType()];
155155
}
156156

157157
$oneyIsConfigured = false;
@@ -217,11 +217,11 @@ function migratePaymentMethodConfigs(array $migratedShops)
217217
function migrateApiCredentialsForShop(): bool
218218
{
219219
$storeId = StoreContext::getInstance()->getStoreId();
220-
$mode = ConfigurationCore::get('ADYEN_MODE', null, null, $storeId);
221-
$merchantAccount = ConfigurationCore::get('ADYEN_MERCHANT_ACCOUNT', null, null, $storeId);
220+
$mode = ConfigurationCore::get('ADYEN_MODE', null, null, (int) $storeId);
221+
$merchantAccount = ConfigurationCore::get('ADYEN_MERCHANT_ACCOUNT', null, null, (int) $storeId);
222222
$ivLength = openssl_cipher_iv_length('aes-256-ctr');
223-
$testApiKeyEncrypted = ConfigurationCore::get('ADYEN_APIKEY_TEST', null, null, $storeId);
224-
$liveApiKeyEncrypted = ConfigurationCore::get('ADYEN_APIKEY_LIVE', null, null, $storeId);
223+
$testApiKeyEncrypted = ConfigurationCore::get('ADYEN_APIKEY_TEST', null, null, (int) $storeId);
224+
$liveApiKeyEncrypted = ConfigurationCore::get('ADYEN_APIKEY_LIVE', null, null, (int) $storeId);
225225
$hex = Tools::substr($testApiKeyEncrypted, 0, $ivLength * 2);
226226
$iv = hex2bin($hex);
227227
$testApiKey = openssl_decrypt(
@@ -240,7 +240,7 @@ function migrateApiCredentialsForShop(): bool
240240
0,
241241
$iv
242242
);
243-
$liveUrlPrefix = ConfigurationCore::get('ADYEN_LIVE_ENDPOINT_URL_PREFIX', null, null, $storeId);
243+
$liveUrlPrefix = ConfigurationCore::get('ADYEN_LIVE_ENDPOINT_URL_PREFIX', null, null, (int) $storeId);
244244

245245
if (empty($mode) || empty($merchantAccount)) {
246246
return false;
@@ -548,7 +548,10 @@ function removeFiles(string $installPath)
548548
*/
549549
function getProxy(ConnectionSettings $connectionSettings): Proxy
550550
{
551-
return ProxyFactory::makeProxy(Proxy::class, $connectionSettings);
551+
/** @var Proxy $proxy */
552+
$proxy = ProxyFactory::makeProxy(Proxy::class, $connectionSettings);
553+
554+
return $proxy;
552555
}
553556

554557
/**

0 commit comments

Comments
 (0)