Skip to content

Commit

Permalink
Merge branch 'mollie:master' into users/vm/PISHPS-204-bankdata
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackScorp authored Jan 12, 2024
2 parents aa18cc9 + cbcc33c commit 4fb6960
Show file tree
Hide file tree
Showing 87 changed files with 4,844 additions and 3,093 deletions.
14 changes: 8 additions & 6 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ prod: ## Installs all production dependencies
@composer validate
@composer install --no-dev
cd src/Resources/app/administration && npm install --omit=dev
cd src/Resources/app/storefront && npm install --production
cd src/Resources/app/storefront && npm install --omit=dev

dev: ## Installs all dev dependencies
php switch-composer.php dev
@composer validate
@composer install
cd src/Resources/app/administration && npm install
cd src/Resources/app/storefront && npm install
curl -1sLf 'https://dl.cloudsmith.io/public/friendsofshopware/stable/setup.deb.sh' | sudo -E bash && sudo apt install shopware-cli
curl -1sLf 'https://dl.cloudsmith.io/public/friendsofshopware/stable/setup.deb.sh' | sudo -E bash && sudo apt install -y --allow-downgrades shopware-cli=0.3.18

install: ## [deprecated] Installs all production dependencies. Please use "make prod" now.
@make prod -B
Expand All @@ -49,16 +49,18 @@ clean: ## Cleans all dependencies and files
rm -rf ./src/Resources/app/storefront/dist/storefront
# ------------------------------------------------------
rm -rf ./src/Resources/public/administration
rm -rf ./src/Resources/public/molllie-payments.js
rm -rf ./src/Resources/public/mollie-payments.js

build: ## Installs the plugin, and builds the artifacts using the Shopware build commands.
php switch-composer.php prod
cd ../../.. && export NODE_OPTIONS=--openssl-legacy-provider && shopware-cli extension build custom/plugins/MolliePayments
php switch-composer.php dev
# -----------------------------------------------------
# CUSTOM WEBPACK
php switch-composer.php dev
cd ./src/Resources/app/storefront && make build -B
# -----------------------------------------------------
php switch-composer.php prod
cd ../../.. && export NODE_OPTIONS=--openssl-legacy-provider && shopware-cli extension build custom/plugins/MolliePayments
php switch-composer.php dev
# -----------------------------------------------------
cd ../../.. && php bin/console --no-debug theme:refresh
cd ../../.. && php bin/console --no-debug theme:compile
cd ../../.. && php bin/console --no-debug theme:refresh
Expand Down
24 changes: 9 additions & 15 deletions src/Compatibility/Bundles/FlowBuilder/Actions/ShipOrderAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

namespace Kiener\MolliePayments\Compatibility\Bundles\FlowBuilder\Actions;

use Kiener\MolliePayments\Facade\MollieShipment;
use Kiener\MolliePayments\Facade\MollieShipmentInterface;
use Kiener\MolliePayments\Service\OrderService;
use Kiener\MolliePayments\Components\ShipmentManager\ShipmentManagerInterface;
use Kiener\MolliePayments\Service\OrderServiceInterface;
use Psr\Log\LoggerInterface;
use Shopware\Core\Content\Flow\Dispatching\Action\FlowAction;
Expand All @@ -27,20 +25,20 @@ class ShipOrderAction extends FlowAction implements EventSubscriberInterface
private $orderService;

/**
* @var MollieShipmentInterface
* @var ShipmentManagerInterface
*/
private $shipmentFacade;
private $shipment;


/**
* @param OrderServiceInterface $orderService
* @param MollieShipmentInterface $shipment
* @param ShipmentManagerInterface $shipment
* @param LoggerInterface $logger
*/
public function __construct(OrderServiceInterface $orderService, MollieShipmentInterface $shipment, LoggerInterface $logger)
public function __construct(OrderServiceInterface $orderService, ShipmentManagerInterface $shipment, LoggerInterface $logger)
{
$this->orderService = $orderService;
$this->shipmentFacade = $shipment;
$this->shipment = $shipment;
$this->logger = $logger;
}

Expand Down Expand Up @@ -122,13 +120,9 @@ private function shipOrder(string $orderId, Context $context): void

$this->logger->info('Starting Shipment through Flow Builder Action for order: ' . $orderNumber);

$this->shipmentFacade->shipOrder(
$order,
'',
'',
'',
$context
);
# ship (all or) the rest of the order without providing any specific tracking information.
# this will ensure tracking data is automatically taken from the order
$this->shipment->shipOrderRest($order, null, $context);
} catch (\Exception $ex) {
$this->logger->error(
'Error when shipping order with Flow Builder Action',
Expand Down
5 changes: 3 additions & 2 deletions src/Components/MollieLimits/Service/MollieLimitsRemover.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Kiener\MolliePayments\Exception\MissingCartServiceException;
use Kiener\MolliePayments\Exception\MissingRequestException;
use Kiener\MolliePayments\Service\MollieApi\OrderDataExtractor;
use Kiener\MolliePayments\Service\MollieApi\OrderItemsExtractor;
use Kiener\MolliePayments\Service\OrderService;
use Kiener\MolliePayments\Service\Payment\Provider\ActivePaymentMethodsProviderInterface;
use Kiener\MolliePayments\Service\Payment\Remover\PaymentMethodRemover;
Expand Down Expand Up @@ -35,10 +36,10 @@ class MollieLimitsRemover extends PaymentMethodRemover
* @param OrderService $orderService
* @param SettingsService $settingsService
* @param ActivePaymentMethodsProviderInterface $paymentMethodsProvider
* @param OrderDataExtractor $orderDataExtractor
* @param OrderItemsExtractor $orderDataExtractor
* @param LoggerInterface $logger
*/
public function __construct(ContainerInterface $container, RequestStack $requestStack, OrderService $orderService, SettingsService $settingsService, ActivePaymentMethodsProviderInterface $paymentMethodsProvider, OrderDataExtractor $orderDataExtractor, LoggerInterface $logger)
public function __construct(ContainerInterface $container, RequestStack $requestStack, OrderService $orderService, SettingsService $settingsService, ActivePaymentMethodsProviderInterface $paymentMethodsProvider, OrderItemsExtractor $orderDataExtractor, LoggerInterface $logger)
{
parent::__construct($container, $requestStack, $orderService, $settingsService, $orderDataExtractor, $logger);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function setRefund(?RefundEntity $refund): void
*/
public function getLabel(): string
{
return $this->label;
return (string) $this->label;
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Kiener\MolliePayments\Components\ShipmentManager\Exceptions;

class NoDeliveriesFoundException extends \Exception
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Kiener\MolliePayments\Components\ShipmentManager\Exceptions;

class NoLineItemsProvidedException extends \Exception
{
}
43 changes: 43 additions & 0 deletions src/Components/ShipmentManager/Models/ShipmentLineItem.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace Kiener\MolliePayments\Components\ShipmentManager\Models;

class ShipmentLineItem
{

/**
* @var string
*/
private $shopwareId;

/**
* @var int
*/
private $quantity;

/**
* @param string $shopwareId
* @param int $quantity
*/
public function __construct(string $shopwareId, int $quantity)
{
$this->shopwareId = $shopwareId;
$this->quantity = $quantity;
}

/**
* @return string
*/
public function getShopwareId(): string
{
return $this->shopwareId;
}

/**
* @return int
*/
public function getQuantity(): int
{
return $this->quantity;
}
}
58 changes: 58 additions & 0 deletions src/Components/ShipmentManager/Models/TrackingData.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

namespace Kiener\MolliePayments\Components\ShipmentManager\Models;

class TrackingData
{

/**
* @var string
*/
private $carrier;

/**
* @var string
*/
private $code;

/**
* @var string
*/
private $trackingUrl;

/**
* @param string $carrier
* @param string $code
* @param string $trackingUrl
*/
public function __construct(string $carrier, string $code, string $trackingUrl)
{
$this->carrier = $carrier;
$this->code = $code;
$this->trackingUrl = $trackingUrl;
}

/**
* @return string
*/
public function getCarrier(): string
{
return $this->carrier;
}

/**
* @return string
*/
public function getCode(): string
{
return $this->code;
}

/**
* @return string
*/
public function getTrackingUrl(): string
{
return $this->trackingUrl;
}
}
Loading

0 comments on commit 4fb6960

Please sign in to comment.