Skip to content

Commit

Permalink
NTR: new plugin version 2.5.0 (#395)
Browse files Browse the repository at this point in the history
Co-authored-by: Vitalij Mik <vitalij.mik@dasistweb.de>
  • Loading branch information
BlackScorp and Vitalij Mik authored Jan 24, 2024
1 parent de64e8c commit e93d5a8
Show file tree
Hide file tree
Showing 5 changed files with 803 additions and 1,008 deletions.
2 changes: 1 addition & 1 deletion MollieShopware.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

class MollieShopware extends Plugin
{
const PLUGIN_VERSION = '2.4.0';
const PLUGIN_VERSION = '2.5.0';

const PAYMENT_PREFIX = 'mollie_';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function testTransactionNetShop($shopwareTotalAmount, $roundAfterTax, $pr
true
);

$mollieItemSum = $transaction->getItems()[0]->getTotalAmount() + $transaction->getItems()[1]->getTotalAmount() + $transaction->getItems()[2]->getTotalAmount();
$mollieItemSum = round($transaction->getItems()[0]->getTotalAmount() + $transaction->getItems()[1]->getTotalAmount() + $transaction->getItems()[2]->getTotalAmount(), 2);

# ---------------------------------------------------------------------------

Expand All @@ -118,9 +118,9 @@ public function testTransactionNetShop($shopwareTotalAmount, $roundAfterTax, $pr
$this->assertEquals($shopwareTotalAmount, $transaction->getTotalAmount(), 'Total sum is not the defined sum of Shopware!');
$this->assertEquals($shopwareTotalAmount, $mollieItemSum, 'Mollie Validation: Sum of line items does not match total sum');

$this->assertEquals($product1[2], $transaction->getItems()[0]->getTotalAmount(), 'Total Amount of Item 1 not correct!');
$this->assertEquals($product2[2], $transaction->getItems()[1]->getTotalAmount(), 'Total Amount of Item 2 not correct!');
$this->assertEquals($product3[2], $transaction->getItems()[2]->getTotalAmount(), 'Total Amount of Item 3 not correct!');
$this->assertEquals(round($product1[2], 2), $transaction->getItems()[0]->getTotalAmount(), 'Total Amount of Item 1 not correct!');
$this->assertEquals(round($product2[2], 2), $transaction->getItems()[1]->getTotalAmount(), 'Total Amount of Item 2 not correct!');
$this->assertEquals(round($product3[2], 2), $transaction->getItems()[2]->getTotalAmount(), 'Total Amount of Item 3 not correct!');
}


Expand Down Expand Up @@ -179,7 +179,7 @@ public function testTransactionGrossShop($shopwareTotalAmount, $roundAfterTax, $
false
);

$mollieItemSum = $transaction->getItems()[0]->getTotalAmount() + $transaction->getItems()[1]->getTotalAmount() + $transaction->getItems()[2]->getTotalAmount();
$mollieItemSum = round($transaction->getItems()[0]->getTotalAmount() + $transaction->getItems()[1]->getTotalAmount() + $transaction->getItems()[2]->getTotalAmount(), 2);

# ---------------------------------------------------------------------------

Expand All @@ -189,9 +189,9 @@ public function testTransactionGrossShop($shopwareTotalAmount, $roundAfterTax, $
$this->assertEquals($shopwareTotalAmount, $transaction->getTotalAmount(), 'Total sum is not the defined sum of Shopware!');
$this->assertEquals($shopwareTotalAmount, $mollieItemSum, 'Mollie Validation: Sum of line items does not match total sum');

$this->assertEquals($product1[2], $transaction->getItems()[0]->getTotalAmount(), 'Total Amount of Item 1 not correct!');
$this->assertEquals($product2[2], $transaction->getItems()[1]->getTotalAmount(), 'Total Amount of Item 2 not correct!');
$this->assertEquals($product3[2], $transaction->getItems()[2]->getTotalAmount(), 'Total Amount of Item 3 not correct!');
$this->assertEquals(round($product1[2], 2), $transaction->getItems()[0]->getTotalAmount(), 'Total Amount of Item 1 not correct!');
$this->assertEquals(round($product2[2], 2), $transaction->getItems()[1]->getTotalAmount(), 'Total Amount of Item 2 not correct!');
$this->assertEquals(round($product3[2], 2), $transaction->getItems()[2]->getTotalAmount(), 'Total Amount of Item 3 not correct!');
}


Expand Down
8 changes: 4 additions & 4 deletions Tests/PHPUnit/Utils/Fixtures/BasketLineItemFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public function buildProductItemNet($unitPriceNet, $quantity, $taxRate)
0,
0,
'Sample Product',
$unitPriceNet,
$unitPriceNet,
round($unitPriceNet, 2),
round($unitPriceNet, 2),
$quantity,
$taxRate,
''
Expand Down Expand Up @@ -51,8 +51,8 @@ public function buildProductItemGross($unitPriceGross, $quantity, $taxRate)
0,
0,
'Sample Product',
$unitPriceGross,
$netPrice,
round($unitPriceGross, 2),
round($netPrice, 2),
$quantity,
$taxRate,
''
Expand Down
Loading

0 comments on commit e93d5a8

Please sign in to comment.