Skip to content

Commit a24a337

Browse files
committed
Updates for v3
1 parent 2951b7a commit a24a337

File tree

3 files changed

+25
-39
lines changed

3 files changed

+25
-39
lines changed

samples/TransactionStatus.php

Lines changed: 21 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
$config = (new Config())->setUsername($_REQUEST['username'] ?? '')->setPassword($_REQUEST['password'] ?? '');
1515

1616
try {
17-
$transaction = (new TransactionStatusRequest($orderId))->setConfig($config)->start();
17+
$payOrder = (new TransactionStatusRequest($orderId))->setConfig($config)->start();
1818
} catch (PayException $e) {
1919
echo '<pre>';
2020
echo 'Technical message: ' . $e->getMessage() . PHP_EOL;
@@ -27,37 +27,23 @@
2727
echo '<pre>';
2828
echo 'Success, values:' . PHP_EOL.PHP_EOL;
2929

30-
echo 'isPending: ' . ($transaction->isPending() ? 'YES' : 'no') . PHP_EOL;
31-
echo 'isPaid: ' . ($transaction->isPaid() ? 'YES' : 'no') . PHP_EOL;
32-
echo 'isAuthorized: ' . ($transaction->isAuthorized() ? 'YES' : 'no') . PHP_EOL;
33-
echo 'isCancelled: ' . ($transaction->isCancelled() ? 'YES' : 'no') . PHP_EOL;
34-
echo 'isBeingVerified: ' . ($transaction->isBeingVerified() ? 'YES' : 'no') . PHP_EOL;
35-
echo 'isChargeBack: ' . ($transaction->isChargeBack() ? 'YES' : 'no') . PHP_EOL;
36-
echo 'isPartialPayment: ' . ($transaction->isPartialPayment() ? 'YES' : 'no') . PHP_EOL;
37-
echo 'isRefunded: ' . ($transaction->isRefunded() ? 'YES' : 'no') . PHP_EOL;
38-
echo 'isPartiallyRefunded: ' . ($transaction->isPartiallyRefunded() ? 'YES' : 'no') . PHP_EOL . PHP_EOL;
39-
40-
echo 'getStatusCode: ' . $transaction->getStatusCode() . PHP_EOL;
41-
echo 'getStatusName: ' . $transaction->getStatusName() . PHP_EOL;
42-
echo 'getId: ' . $transaction->getId() . PHP_EOL;
43-
echo 'getOrderId: ' . $transaction->getOrderId() . PHP_EOL;
44-
echo 'getServiceCode: ' . $transaction->getServiceCode() . PHP_EOL;
45-
echo 'getDescription: ' . $transaction->getDescription() . PHP_EOL;
46-
echo 'getReference: ' . $transaction->getReference() . PHP_EOL;
47-
echo 'getIpAddress: ' . $transaction->getIpAddress() . PHP_EOL.PHP_EOL;
48-
echo 'getAmount: ' . $transaction->getAmount() . PHP_EOL;
49-
echo 'getCurrency: ' . $transaction->getCurrency() . PHP_EOL;
50-
51-
echo 'getAmountConverted: ' . $transaction->getAmountConverted() . PHP_EOL;
52-
echo 'getAmountConvertedCurrency: ' . $transaction->getAmountConvertedCurrency() . PHP_EOL;
53-
echo 'getAmountPaid: ' . $transaction->getAmountPaid() . PHP_EOL;
54-
echo 'getAmountPaidCurrency: ' . $transaction->getAmountPaidCurrency() . PHP_EOL;
55-
echo 'getAmountRefunded: ' . $transaction->getAmountRefunded() . PHP_EOL;
56-
echo 'getAmountRefundedCurrency: ' . $transaction->getAmountRefundedCurrency() . PHP_EOL.PHP_EOL;
57-
58-
echo 'paymentMethod: ' . $transaction->getPaymentMethod()['id'] . PHP_EOL;
59-
echo 'getPaymentProfileId: ' . $transaction->getPaymentProfileId() . PHP_EOL;
60-
echo 'integration: ' . ($transaction->getIntegration()['testMode'] === true ? '1' : 0) . PHP_EOL;
61-
echo 'expiresAt: ' . $transaction->getExpiresAt() . PHP_EOL;
62-
echo 'createdAt: ' . $transaction->getCreatedAt() . PHP_EOL;
63-
print_r($transaction->getPaymentData());
30+
echo 'isPending: ' . ($payOrder->isPending() ? 'YES' : 'no') . PHP_EOL;
31+
echo 'isPaid: ' . ($payOrder->isPaid() ? 'YES' : 'no') . PHP_EOL;
32+
echo 'isAuthorized: ' . ($payOrder->isAuthorized() ? 'YES' : 'no') . PHP_EOL;
33+
echo 'isCancelled: ' . ($payOrder->isCancelled() ? 'YES' : 'no') . PHP_EOL;
34+
echo 'isBeingVerified: ' . ($payOrder->isBeingVerified() ? 'YES' : 'no') . PHP_EOL;
35+
echo 'isChargeBack: ' . ($payOrder->isChargeBack() ? 'YES' : 'no') . PHP_EOL;
36+
echo 'isPartialPayment: ' . ($payOrder->isPartialPayment() ? 'YES' : 'no') . PHP_EOL;
37+
echo 'isRefunded: ' . ($payOrder->isRefunded() ? 'YES' : 'no') . PHP_EOL;
38+
echo 'isPartiallyRefunded: ' . ($payOrder->isRefundedPartial() ? 'YES' : 'no') . PHP_EOL . PHP_EOL;
39+
echo 'getStatusCode: ' . $payOrder->getStatusCode() . PHP_EOL;
40+
echo 'getStatusName: ' . $payOrder->getStatusName() . PHP_EOL;
41+
echo 'getId: ' . $payOrder->getId() . PHP_EOL;
42+
echo 'getOrderId: ' . $payOrder->getOrderId() . PHP_EOL;
43+
echo 'getDescription: ' . $payOrder->getDescription() . PHP_EOL;
44+
echo 'getReference: ' . $payOrder->getReference() . PHP_EOL;
45+
echo 'getAmount: ' . $payOrder->getAmount() . PHP_EOL;
46+
echo 'getCurrency: ' . $payOrder->getCurrency() . PHP_EOL;
47+
echo 'integration: ' . ($payOrder->getIntegration()['testMode'] === true ? '1' : 0) . PHP_EOL;
48+
echo 'expiresAt: ' . $payOrder->getExpiresAt() . PHP_EOL;
49+
echo 'createdAt: ' . $payOrder->getCreatedAt() . PHP_EOL;

src/Mapper/ConfigProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function getMap(): array
8686
'DeclineTransaction' => 'Transaction',
8787
'TokenizeTransaction' => 'Transaction',
8888
'TransactionRefund' => 'TransactionRefundResponse',
89-
'TransactionStatus' => 'TransactionStatusResponse',
89+
'TransactionStatus' => 'PayOrder',
9090
'OrderCreate' => 'PayOrder',
9191
'OrderCapture' => 'PayOrder',
9292
'OrderVoid' => 'PayOrder',

src/Model/Request/TransactionStatusRequest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use PayNL\Sdk\Exception\PayException;
88
use PayNL\Sdk\Request\RequestData;
9-
use PayNL\Sdk\Model\Response\TransactionStatusResponse;
9+
use PayNL\Sdk\Model\Pay\PayOrder;
1010
use PayNL\Sdk\Request\RequestInterface;
1111

1212
/**
@@ -41,10 +41,10 @@ public function getBodyParameters(): array
4141
}
4242

4343
/**
44-
* @return TransactionStatusResponse
44+
* @return PayOrder
4545
* @throws PayException
4646
*/
47-
public function start(): TransactionStatusResponse
47+
public function start(): PayOrder
4848
{
4949
# Always use rest.pay.nl for this status request
5050
$this->config->setCore('https://rest.pay.nl');

0 commit comments

Comments
 (0)