Skip to content

Commit

Permalink
CC-14473: Fixed notifications while redirecting fails after successfu…
Browse files Browse the repository at this point in the history
…l payment. (#4)

CC-14473 COMPUTOP: Issues during checkout with older browser versions
  • Loading branch information
michbeck authored Mar 18, 2022
1 parent 3269b2a commit 677d2c4
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 33 deletions.
3 changes: 3 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
parameters:
level: 7
paths:
- src/
checkGenericClassInNonGenericObjectType: false
checkMissingIterableValueType: false
excludePaths:
Expand Down
29 changes: 1 addition & 28 deletions psalm-report.json

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

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct($zedRequestClient)
*
* @return \Spryker\Shared\Kernel\Transfer\TransferInterface
*/
public function call($url, TransferInterface $object, $requestOptions = null)
public function call(string $url, TransferInterface $object, ?array $requestOptions = null): TransferInterface
{
return $this->zedRequestClient->call($url, $object, $requestOptions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ interface ComputopShipmentToZedRequestClientInterface
*
* @return \Spryker\Shared\Kernel\Transfer\TransferInterface
*/
public function call($url, TransferInterface $object, $requestOptions = null);
public function call(string $url, TransferInterface $object, ?array $requestOptions = null): TransferInterface;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<transfers xmlns="spryker:transfer-01"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="spryker:transfer-01 http://static.spryker.com/transfer-01.xsd">

<transfer name="Quote">
<property name="items" type="Item[]" singular="item"/>
<property name="defaultShipmentSelected" type="bool"/>
</transfer>

<transfer name="Item">
<property name="shipment" type="Shipment"/>
</transfer>

<transfer name="ShipmentMethod">
<property name="isActive" type="bool"/>
<property name="idShipmentMethod" type="int"/>
</transfer>

<transfer name="Shipment">
<property name="shipmentSelection" type="string"/>
<property name="method" type="ShipmentMethod"/>
<property name="shippingAddress" type="Address"/>
</transfer>

<transfer name="Address">
</transfer>
</transfers>
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function createQuoteDefaultShipmentExpander(): QuoteShipmentExpanderInter
{
return new QuoteDefaultShipmentExpander(
$this->getConfig(),
$this->getShipmentFacade()
$this->getShipmentFacade(),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function expand(QuoteTransfer $quoteTransfer): QuoteTransfer
$defaultShipmentMethodTransfer = $this->shipmentFacade->findShipmentMethodByKey($defaultShipmentMethodKey);
if ($defaultShipmentMethodTransfer === null || $defaultShipmentMethodTransfer->getIsActive() === false) {
throw new ComputopDefaultShipmentException(
sprintf('Default shipment method "%s" is not available!', $defaultShipmentMethodKey)
sprintf('Default shipment method "%s" is not available!', $defaultShipmentMethodKey),
);
}

Expand Down Expand Up @@ -86,7 +86,7 @@ protected function addShipmentToQuoteItems(QuoteTransfer $quoteTransfer, Shipmen
protected function createShipmentTransfer(ShipmentMethodTransfer $shipmentMethodTransfer): ShipmentTransfer
{
return (new ShipmentTransfer())
->setShipmentSelection($shipmentMethodTransfer->getIdShipmentMethod())
->setShipmentSelection((string)$shipmentMethodTransfer->getIdShipmentMethod())
->setMethod($shipmentMethodTransfer)
->setShippingAddress(new AddressTransfer());
}
Expand Down
1 change: 1 addition & 0 deletions tests/SprykerEcoTest/Zed/ComputopShipment/codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ suites:
coreNamespaces:
- Spryker
- SprykerEco
- SprykerEcoTest
- \SprykerTest\Zed\Testify\Helper\BusinessHelper

0 comments on commit 677d2c4

Please sign in to comment.