Skip to content

Commit 69abb7c

Browse files
update unit tests for new parameters
1 parent bc5157a commit 69abb7c

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/Results/ReceiptAttachResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ReceiptAttachResult
2727
public function __construct(
2828
public readonly ?string $ResultCode,
2929
public readonly ?string $ResultDescription,
30-
public readonly ?string $OpKey,
30+
public readonly ?string $OpKey = null,
3131
) {
3232
}
3333
}

tests/RobokassaApiTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,13 @@ public function testGetPaymentParameters(): void
138138
. '"payment_method":"full_payment","payment_object":"excise","nomenclature_code":"04620034587217"}'
139139
. '],"sno":"osn"}',
140140
'IsTest' => null,
141+
'PreviousInvoiceID' => null,
141142
];
142143
$this->assertEquals($expectedPaymentParameters, $paymentParameters);
143144

144145
$paymentParametersAsJson = $robokassa->getPaymentParametersAsJson($invoiceOptions);
145146
$expectedPaymentParametersAsJson = '{"MerchantLogin":"robo-demo","OutSum":"100.00","Description":"Description\"\'><b>",'
147+
. '"PreviousInvoiceID":null,'
146148
. '"SignatureValue":"7c6a95094fa5c3e5e2baf83c8817e8c0","IncCurrLabel":null,"InvId":"999","Culture":"en",'
147149
. '"Encoding":"utf-8","Email":null,"ExpirationDate":null,"OutSumCurrency":null,"UserIp":null,'
148150
. '"Receipt":"{\"items\":['
@@ -303,14 +305,12 @@ public function testSendSecondReceiptAttach(): void
303305
$this->assertEquals(200, $response->getStatusCode());
304306
$expectedBodyContent = '{"ResultCode":"1000",'
305307
. '"ResultDescription":'
306-
. '"Exception of type \u0027Robox.Merchant.Util.Exceptions.MerchantNotFoundException\u0027 was thrown.",'
307-
. '"OpKey":null}';
308+
. '"Exception of type \u0027Robox.Merchant.Util.Exceptions.MerchantNotFoundException\u0027 was thrown."}';
308309
$this->assertEquals($expectedBodyContent, (string)$response->getBody());
309310

310311
$expectedReceiptAttachResult = new ReceiptAttachResult(
311312
ResultCode: "1000",
312-
ResultDescription: "Exception of type 'Robox.Merchant.Util.Exceptions.MerchantNotFoundException' was thrown.",
313-
OpKey: null
313+
ResultDescription: "Exception of type 'Robox.Merchant.Util.Exceptions.MerchantNotFoundException' was thrown."
314314
);
315315
$receiptAttachResult = $robokassa->getReceiptAttachResult($response);
316316
$this->assertEquals($expectedReceiptAttachResult, $receiptAttachResult);

0 commit comments

Comments
 (0)