Skip to content

Commit

Permalink
Merge pull request #18 from logeecom/master
Browse files Browse the repository at this point in the history
PISYL-210: Review of Pull Request in Github
  • Loading branch information
fjbender authored Apr 9, 2024
2 parents 22c6a3c + efd77dd commit 6fa6e98
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/Action/ConvertMolliePaymentAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ public function execute($request): void
$cartToken = $paymentOptions['cartToken'];
$saveCardInfo = $paymentOptions['saveCardInfo'];
$useSavedCards = $paymentOptions['useSavedCards'];
$selectedIssuer = PaymentMethod::IDEAL === $paymentMethod ? $paymentOptions['issuers']['id'] : null;
$selectedIssuer = null;
if (PaymentMethod::IDEAL === $paymentMethod && null !== $paymentOptions['issuers']) {
$selectedIssuer = $paymentOptions['issuers']['id'];
}
}

/** @var MollieGatewayConfigInterface $method */
Expand Down
5 changes: 3 additions & 2 deletions src/DependencyInjection/SyliusMollieExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ public function prepend(ContainerBuilder $container): void
return;
}

$doctrineConfig = $container->getExtensionConfig('doctrine_migrations');
$container->prependExtensionConfig('doctrine_migrations', [
'migrations_paths' => [
'migrations_paths' => \array_merge(\array_pop($doctrineConfig)['migrations_paths'] ?? [], [
'SyliusMolliePlugin\Migrations' => __DIR__ . '/../Migrations',
],
]),
]);

$container->prependExtensionConfig('sylius_labs_doctrine_migrations_extra', [
Expand Down
18 changes: 18 additions & 0 deletions src/Payments/Methods/KlarnaOne.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace SyliusMolliePlugin\Payments\Methods;

use Mollie\Api\Types\PaymentMethod;

final class KlarnaOne extends AbstractMethod
{
public function getMethodId(): string
{
return PaymentMethod::KLARNA_ONE;
}

public function getPaymentType(): string
{
return self::ORDER_API;
}
}
2 changes: 2 additions & 0 deletions src/Payments/MethodsInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use SyliusMolliePlugin\Payments\Methods\Ideal;
use SyliusMolliePlugin\Payments\Methods\In3;
use SyliusMolliePlugin\Payments\Methods\Kbc;
use SyliusMolliePlugin\Payments\Methods\KlarnaOne;
use SyliusMolliePlugin\Payments\Methods\Klarnapaylater;
use SyliusMolliePlugin\Payments\Methods\KlarnaPayNow;
use SyliusMolliePlugin\Payments\Methods\Klarnasliceit;
Expand All @@ -43,6 +44,7 @@ interface MethodsInterface
Giropay::class,
Ideal::class,
Kbc::class,
KlarnaOne::class,
Klarnapaylater::class,
Klarnasliceit::class,
KlarnaPayNow::class,
Expand Down
1 change: 1 addition & 0 deletions src/Payments/PaymentTerms/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public static function getLogLevels(): array
public static function getOnlyOrderAPIMethods(): array
{
return [
PaymentMethod::KLARNA_ONE,
PaymentMethod::KLARNA_PAY_NOW,
PaymentMethod::KLARNA_PAY_LATER,
PaymentMethod::KLARNA_SLICE_IT,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% set mealvouchersId = constant('SyliusMolliePlugin\\Payments\\Methods\\MealVoucher::MEAL_VOUCHERS') %}
{% set applePay = constant('Mollie\\Api\\Types\\PaymentMethod::APPLEPAY') %}
{% set klarnaOne = constant('Mollie\\Api\\Types\\PaymentMethod::KLARNA_ONE') %}
{% set klarnaPayLater = constant('Mollie\\Api\\Types\\PaymentMethod::KLARNA_PAY_LATER') %}
{% set klarnaSliceIt = constant('Mollie\\Api\\Types\\PaymentMethod::KLARNA_SLICE_IT') %}
{% set billie = constant('Mollie\\Api\\Types\\PaymentMethod::BILLIE') %}
Expand Down Expand Up @@ -133,6 +134,7 @@
<div class="twelve wide field">
{% if
methodForm.vars.value.methodId == mealvouchersId or
methodForm.vars.value.methodId == klarnaOne or
methodForm.vars.value.methodId == klarnaPayLater or
methodForm.vars.value.methodId == klarnaSliceIt or
methodForm.vars.value.methodId == billie or
Expand Down

0 comments on commit 6fa6e98

Please sign in to comment.