Skip to content

Commit

Permalink
Merge pull request #264 from Adyen/develop
Browse files Browse the repository at this point in the history
Release 3.5.0
  • Loading branch information
peterojo authored Aug 8, 2022
2 parents fd69509 + 948e39b commit 3188ae5
Show file tree
Hide file tree
Showing 83 changed files with 1,135 additions and 563 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @acampos1916 @rikterbeek @peterojo @morerice @AlexandrosMor @candemiralp
* @acampos1916 @rikterbeek @peterojo @morerice @AlexandrosMor @candemiralp @RokPopov
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}
],
"description": "Official Shopware 6 Plugin to connect to Payment Service Provider Adyen",
"version": "3.4.1",
"version": "3.5.0",
"type": "shopware-platform-plugin",
"license": "MIT",
"require": {
Expand Down
88 changes: 44 additions & 44 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions src/AdyenPaymentShopware6.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ public function update(UpdateContext $updateContext): void
if (\version_compare($currentVersion, '3.2.0', '<')) {
$this->updateTo320($updateContext);
}

if (\version_compare($currentVersion, '3.5.0', '<')) {
$this->updateTo350($updateContext);
}
}

private function addPaymentMethod(PaymentMethods\PaymentMethodInterface $paymentMethod, Context $context): void
Expand Down Expand Up @@ -446,6 +450,24 @@ private function updateTo320(UpdateContext $updateContext): void
], $updateContext->getContext());
}
}

private function updateTo350(UpdateContext $updateContext): void
{
//Version 3.5.0 introduces Bancontact mobile
foreach ([
new PaymentMethods\BancontactMobilePaymentMethod()
] as $method) {
$this->addPaymentMethod(
$method,
$updateContext->getContext()
);
$this->setPaymentMethodIsActive(
true,
$updateContext->getContext(),
$method
);
}
}
}

if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
Expand Down
9 changes: 6 additions & 3 deletions src/Controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class AdminController
/**
* @var NotificationService
*/
private NotificationService $notificationService;
private $notificationService;

/** @var CurrencyFormatter */
private $currencyFormatter;
Expand Down Expand Up @@ -133,9 +133,12 @@ public function check(RequestDataBag $dataBag): JsonResponse
{
try {
$client = new Client();
$client->setXApiKey($dataBag->get(ConfigurationService::BUNDLE_NAME . '.config.apiKeyTest'));
$environment = $dataBag->get(ConfigurationService::BUNDLE_NAME . '.config.environment') ? 'live' : 'test';
$client->setXApiKey(
$dataBag->get(ConfigurationService::BUNDLE_NAME . '.config.apiKey' . ucfirst($environment))
);
$client->setEnvironment(
$dataBag->get(ConfigurationService::BUNDLE_NAME . '.config.environment') ? 'live' : 'test',
$environment,
$dataBag->get(ConfigurationService::BUNDLE_NAME . '.config.liveEndpointUrlPrefix')
);
$service = new Checkout($client);
Expand Down
Loading

0 comments on commit 3188ae5

Please sign in to comment.