Skip to content

Commit 0cf8496

Browse files
committed
UMCS-383(change) Test use non 3ds keypair for invoice transactions.
1 parent 9f3a96c commit 0cf8496

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

test/integration/BasketV2Test.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
use UnzerSDK\Exceptions\UnzerApiException;
2929
use UnzerSDK\Resources\Basket;
3030
use UnzerSDK\Resources\EmbeddedResources\BasketItem;
31-
use UnzerSDK\Resources\PaymentTypes\Invoice;
3231
use UnzerSDK\Resources\PaymentTypes\Paypal;
3332
use UnzerSDK\Resources\PaymentTypes\SepaDirectDebit;
3433
use UnzerSDK\test\BaseIntegrationTest;
@@ -58,8 +57,6 @@ public function minV2BasketShouldBeCreatableAndFetchable(): void
5857
$this->unzer->createBasket($basket);
5958
$this->assertNotEmpty($basket->getId());
6059

61-
$invoice = new Invoice();
62-
$invoice->setParentResource($this->unzer)->charge(100, 'EUR', 'https://unzer.com', null, 'orderId', null, $basket);
6360
$fetchedBasket = $this->unzer->fetchBasket($basket->getId())->setOrderId('');
6461
$this->assertEquals($basket->expose(), $fetchedBasket->expose());
6562
}
@@ -87,8 +84,6 @@ public function BasketShouldBeCreatableAndFetchable(): void
8784
$this->unzer->createBasket($basket);
8885
$this->assertNotEmpty($basket->getId());
8986

90-
$invoice = new Invoice();
91-
$invoice->setParentResource($this->unzer)->charge(100, 'EUR', 'https://unzer.com', null, 'orderId', null, $basket);
9287
$fetchedBasket = $this->unzer->fetchBasket($basket->getId());
9388
$this->assertEquals($basket->expose(), $fetchedBasket->expose());
9489
}

test/integration/PaymentCancelTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
use UnzerSDK\Constants\CancelReasonCodes;
2828
use UnzerSDK\Resources\PaymentTypes\Invoice;
2929
use UnzerSDK\Resources\PaymentTypes\InvoiceSecured;
30+
use UnzerSDK\Services\EnvironmentService;
3031
use UnzerSDK\test\BaseIntegrationTest;
3132

3233
class PaymentCancelTest extends BaseIntegrationTest
@@ -344,6 +345,7 @@ public function partCancelOnPartlyChargedAuthorizeWithAmountGtCharged(): void
344345
*/
345346
public function fullCancelOnInitialInvoiceCharge($amount): void
346347
{
348+
$this->unzer->setKey(EnvironmentService::getTestPrivateKey(true));
347349
/** @var Invoice $invoice */
348350
$invoice = $this->unzer->createPaymentType(new Invoice());
349351
$charge = $invoice->charge(100.0, 'EUR', self::RETURN_URL);
@@ -364,6 +366,7 @@ public function fullCancelOnInitialInvoiceCharge($amount): void
364366
*/
365367
public function partCancelOnInitialInvoiceChargeShouldBePossible(): void
366368
{
369+
$this->unzer->setKey(EnvironmentService::getTestPrivateKey(true));
367370
/** @var Invoice $invoice */
368371
$invoice = $this->unzer->createPaymentType(new Invoice());
369372
$charge = $invoice->charge(100.0, 'EUR', self::RETURN_URL);

test/integration/PaymentTypes/InvoiceTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,16 @@
2727
use UnzerSDK\Constants\ApiResponseCodes;
2828
use UnzerSDK\Exceptions\UnzerApiException;
2929
use UnzerSDK\Resources\PaymentTypes\Invoice;
30+
use UnzerSDK\Services\EnvironmentService;
3031
use UnzerSDK\test\BaseIntegrationTest;
3132

3233
class InvoiceTest extends BaseIntegrationTest
3334
{
35+
protected function setUp(): void
36+
{
37+
$this->getUnzerObject(EnvironmentService::getTestPrivateKey(true));
38+
}
39+
3440
/**
3541
* Verifies invoice payment type can be created.
3642
*

0 commit comments

Comments
 (0)