Skip to content

Commit e84a1b6

Browse files
authored
Merge pull request #89 from unzerdev/UMCS-383/qa_changes
UMCS-383(change) UPL example: Adjust text regarding transaction refer…
2 parents f20ad91 + 0cf8496 commit e84a1b6

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

examples/Success.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646

4747
$shortId = $_SESSION['ShortId'] ?? null;
4848
if ($shortId !== null) {
49-
echo '<p>Please look for ShortId ' . $shortId . ' in Unzer Insights to see the transaction.</p>';
49+
$defaultTransactionMessage = '<p>Please look for ShortId ' . $shortId . ' in Unzer Insights to see the transaction.</p>';
50+
$paylaterTransactionMessage = '<p>Please use the "descriptor" to look for the transaction in the Unzer Pay Later Merchant Portal.</p>';
51+
echo preg_match('/[\d]{4}.[\d]{4}.[\d]{4}/', $shortId) ? $defaultTransactionMessage : $paylaterTransactionMessage;
5052
}
5153
$paymentId = $_SESSION['PaymentId'] ?? null;
5254
if ($paymentId !== null) {
@@ -73,7 +75,7 @@
7375
<input type="hidden" name="payment_id" value="' . $paymentId . ' ">
7476
<div class="fields inline">
7577
<div class="field">
76-
<button class="unzerUI primary button fluid" id="submit-button" type="submit">Charge payment.</button>
78+
<button class="unzerUI primary button fluid" id="submit-button" type="submit">Charge payment</button>
7779
</div>
7880
</div>
7981
</form>';

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)