-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
58366f5
commit cdfd969
Showing
7 changed files
with
84 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,8 @@ public function resolveFromOrder(OrderInterface $order): CompanyInfo | |
return new CompanyInfo( | ||
'Azienda A', | ||
'IT73228252614', | ||
'[email protected]' | ||
'[email protected]', | ||
'[email protected]', | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,6 @@ final class DummyCompanyInfoResolver implements CompanyInfoResolverInterface | |
{ | ||
public function resolveFromOrder(OrderInterface $order): CompanyInfo | ||
{ | ||
return new CompanyInfo('Webgriffe SRL', '02277170359', '[email protected]'); | ||
return new CompanyInfo('Webgriffe SRL', '02277170359', '[email protected]', '[email protected]'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Webgriffe\SyliusPausePayPlugin\Unit\Client\ValueObject; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Webgriffe\SyliusPausePayPlugin\Client\ValueObject\Order; | ||
use Webgriffe\SyliusPausePayPlugin\Client\ValueObject\OrderItem; | ||
|
||
final class OrderTest extends TestCase | ||
{ | ||
public function test_to_array(): void | ||
{ | ||
$order = new Order( | ||
100.0, | ||
'123', | ||
new \DateTimeImmutable('2024-09-01 12:23:56'), | ||
'Description', | ||
'Remittance', | ||
'http://ok.com', | ||
'http://ko.com', | ||
'Buyer Name', | ||
'VAT123', | ||
'[email protected]', | ||
'[email protected]', | ||
[ | ||
new OrderItem('Product 1', 1, 10.0), | ||
new OrderItem('Product 2', 2, 20.0), | ||
] | ||
); | ||
|
||
self::assertSame( | ||
[ | ||
'amount' => 100.0, | ||
'number' => '123', | ||
'issueDate' => '01/09/2024 12:23', | ||
'description' => 'Description', | ||
'remittance' => 'Remittance', | ||
'okRedirect' => 'http://ok.com', | ||
'koRedirect' => 'http://ko.com', | ||
'allowToEditRemittance' => false, | ||
'buyerInfo' => [ | ||
'name' => 'Buyer Name', | ||
'vatCode' => 'VAT123', | ||
'email' => '[email protected]', | ||
'pec' => '[email protected]', | ||
], | ||
'items' => [ | ||
[ | ||
'description' => 'Product 1', | ||
'quantity' => 1, | ||
'amount' => 10.0, | ||
], | ||
[ | ||
'description' => 'Product 2', | ||
'quantity' => 2, | ||
'amount' => 20.0, | ||
], | ||
], | ||
'allowSCTPayment' => true, | ||
], | ||
$order->toArray() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ public function test_it_maps_sylius_payment_to_pausepay_order(): void | |
self::assertSame('Webgriffe SRL', $pausePayOrder->getBuyerInfoName()); | ||
self::assertSame('02277170359', $pausePayOrder->getBuyerInfoVatNumber()); | ||
self::assertSame('[email protected]', $pausePayOrder->getBuyerInfoEmail()); | ||
self::assertSame('[email protected]', $pausePayOrder->getBuyerInfoPec()); | ||
|
||
$items = $pausePayOrder->getPurchasedItems(); | ||
self::assertCount(3, $items); | ||
|