Skip to content

Commit

Permalink
Created new version of the Mollie Payments plugin for Shopware 6
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinder committed Jan 13, 2020
1 parent 9b7a5e6 commit a6a88f0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kiener/mollie-payments-plugin",
"description": "Mollie Payments",
"version": "v1.0.2",
"version": "v1.0.3",
"type": "shopware-platform-plugin",
"license": "MIT",
"authors": [
Expand Down
15 changes: 6 additions & 9 deletions src/Handler/PaymentHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Shopware\Core\Checkout\Payment\Cart\PaymentHandler\AsynchronousPaymentHandlerInterface;
use Shopware\Core\Checkout\Payment\Exception\CustomerCanceledAsyncPaymentException;
use Shopware\Core\Framework\DataAbstractionLayer\Exception\InconsistentCriteriaIdsException;
use Shopware\Core\Framework\Language\LanguageEntity;
use Shopware\Core\System\Language\LanguageEntity;
use Shopware\Core\Framework\Validation\DataBag\RequestDataBag;
use Shopware\Core\System\Currency\CurrencyEntity;
use Shopware\Core\System\Locale\LocaleEntity;
Expand Down Expand Up @@ -286,14 +286,6 @@ public function prepare(AsyncPaymentTransactionStruct $transaction, SalesChannel
'transactionId' => $transaction->getOrderTransaction()->getId()
], $this->router::ABSOLUTE_URL);

/**
* During local testing, we set this webhook URL to null, as our local URL
* is not supported by the Mollie API.
*
* @todo Remove webhook URL clearance before publishing.
*/
$webhookUrl = null;

/**
* Build an array of order data to send in the request
* to Mollie's Orders API to create an order payment.
Expand All @@ -320,6 +312,11 @@ public function prepare(AsyncPaymentTransactionStruct $transaction, SalesChannel
'payment' => []
];

// Remove webhook URL on dev-environments
if (strtolower(getenv('APP_ENV')) === 'dev') {
unset($orderData['webhookUrl']);
}

$orderData = array_merge($orderData, $this->paymentMethodData);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/MolliePayments.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function install(InstallContext $context) : void
$this->container->get('payment_method.repository'),
$this->container->get(PluginIdProvider::class),
$this->container->get('system_config.repository'),
$this->getClassName()
get_class($this)
);

$paymentMethodHelper->addPaymentMethods($context->getContext());
Expand Down
12 changes: 6 additions & 6 deletions src/Service/CustomFieldService.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);

namespace Kiener\MolliePayments\Service;

Expand All @@ -7,28 +7,28 @@
use Shopware\Core\Checkout\Customer\CustomerDefinition;
use Shopware\Core\Checkout\Order\OrderDefinition;
use Shopware\Core\Framework\Context;
use Shopware\Core\Framework\CustomField\CustomFieldTypes;
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
use Shopware\Core\System\CustomField\CustomFieldTypes;
use Symfony\Component\DependencyInjection\ContainerInterface;

class CustomFieldService
{
/** @var ContainerInterface */
protected $container;

/** @var EntityRepository */
/** @var EntityRepositoryInterface */
protected $customFieldSetRepository;

/**
* CustomFieldService constructor.
*
* @param ContainerInterface $container
* @param EntityRepository $customFieldSetRepository
* @param EntityRepositoryInterface $customFieldSetRepository
* @param LoggerInterface $logger
*/
public function __construct(
$container,
EntityRepository $customFieldSetRepository
EntityRepositoryInterface $customFieldSetRepository
)
{
$this->container = $container;
Expand Down

0 comments on commit a6a88f0

Please sign in to comment.