From 80dfbe9aa6221d6143ad60d6b0dcc4ad4955cc49 Mon Sep 17 00:00:00 2001 From: woutse Date: Wed, 13 Nov 2024 13:24:06 +0100 Subject: [PATCH] Updates for v3 --- samples/OrderUpdate.php | 12 ++++++------ src/Mapper/ConfigProvider.php | 8 ++++---- src/Model/Request/OrderApproveRequest.php | 2 +- src/Model/Request/OrderDeclineRequest.php | 2 +- src/Model/Request/OrderStatusRequest.php | 2 +- src/Model/Request/OrderUpdateRequest.php | 2 +- src/Request/ConfigProvider.php | 8 ++++---- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/samples/OrderUpdate.php b/samples/OrderUpdate.php index a8be269..8fede28 100644 --- a/samples/OrderUpdate.php +++ b/samples/OrderUpdate.php @@ -9,16 +9,16 @@ use PayNL\Sdk\Exception\PayException; use PayNL\Sdk\Config\Config; -$transactionId = $_REQUEST['pay_order_id'] ?? exit('Pass transactionId'); - -$orderApproveRequest = new OrderUpdateRequest($transactionId); -$orderApproveRequest->setDescription('abc'); -$orderApproveRequest->setReference('ab2711'); - $config = new Config(); $config->setUsername($_REQUEST['username'] ?? ''); $config->setPassword($_REQUEST['password'] ?? ''); +$transactionId = $_REQUEST['pay_order_id'] ?? exit('Pass transactionId'); + +$orderApproveRequest = new OrderUpdateRequest($transactionId); +$orderApproveRequest->setDescription('desc12345'); +$orderApproveRequest->setReference('12345'); + try { $payOrder = $orderApproveRequest->setConfig($config)->start(); } catch (PayException $e) { diff --git a/src/Mapper/ConfigProvider.php b/src/Mapper/ConfigProvider.php index 6454529..ded3a4e 100644 --- a/src/Mapper/ConfigProvider.php +++ b/src/Mapper/ConfigProvider.php @@ -89,10 +89,10 @@ public function getMap(): array 'OrderCapture' => 'PayOrder', 'OrderVoid' => 'PayOrder', 'OrderAbort' => 'PayOrder', - 'orderStatus' => 'PayOrder', - 'orderUpdate' => 'PayOrder', - 'orderApprove' => 'PayOrder', - 'orderDecline' => 'PayOrder', + 'OrderStatus' => 'PayOrder', + 'OrderUpdate' => 'PayOrder', + 'OrderApprove' => 'PayOrder', + 'OrderDecline' => 'PayOrder', 'TerminalsGet' => 'Terminal', 'TerminalsBrowse' => 'Terminals' ], diff --git a/src/Model/Request/OrderApproveRequest.php b/src/Model/Request/OrderApproveRequest.php index 09d0cef..e2f016a 100644 --- a/src/Model/Request/OrderApproveRequest.php +++ b/src/Model/Request/OrderApproveRequest.php @@ -24,7 +24,7 @@ class OrderApproveRequest extends RequestData public function __construct($transactionId) { $this->transactionId = $transactionId; - parent::__construct('orderApprove', '/orders/%transactionId%/approve', RequestInterface::METHOD_PATCH); + parent::__construct('OrderApprove', '/orders/%transactionId%/approve', RequestInterface::METHOD_PATCH); } /** diff --git a/src/Model/Request/OrderDeclineRequest.php b/src/Model/Request/OrderDeclineRequest.php index ccb0170..346a913 100644 --- a/src/Model/Request/OrderDeclineRequest.php +++ b/src/Model/Request/OrderDeclineRequest.php @@ -24,7 +24,7 @@ class OrderDeclineRequest extends RequestData public function __construct($transactionId) { $this->transactionId = $transactionId; - parent::__construct('orderDecline', '/orders/%transactionId%/decline', RequestInterface::METHOD_PATCH); + parent::__construct('OrderDecline', '/orders/%transactionId%/decline', RequestInterface::METHOD_PATCH); } /** diff --git a/src/Model/Request/OrderStatusRequest.php b/src/Model/Request/OrderStatusRequest.php index 7ebd508..32bf92f 100644 --- a/src/Model/Request/OrderStatusRequest.php +++ b/src/Model/Request/OrderStatusRequest.php @@ -26,7 +26,7 @@ class OrderStatusRequest extends RequestData public function __construct(string $orderId) { $this->orderId = $orderId; - parent::__construct('orderStatus', '/orders/%transactionId%/status', RequestInterface::METHOD_GET); + parent::__construct('OrderStatus', '/orders/%transactionId%/status', RequestInterface::METHOD_GET); } public function getPathParameters(): array diff --git a/src/Model/Request/OrderUpdateRequest.php b/src/Model/Request/OrderUpdateRequest.php index a37bf53..3a70b2a 100644 --- a/src/Model/Request/OrderUpdateRequest.php +++ b/src/Model/Request/OrderUpdateRequest.php @@ -27,7 +27,7 @@ public function __construct($transactionId) { $this->transactionId = $transactionId; $this->description = ''; - parent::__construct('orderUpdate', '/orders/%transactionId%', RequestInterface::METHOD_PATCH); + parent::__construct('OrderUpdate', '/orders/%transactionId%', RequestInterface::METHOD_PATCH); } /** diff --git a/src/Request/ConfigProvider.php b/src/Request/ConfigProvider.php index 7d7af8b..e6eb622 100644 --- a/src/Request/ConfigProvider.php +++ b/src/Request/ConfigProvider.php @@ -206,7 +206,7 @@ protected function getTransactionServicesConfig(): array 'transactionId' => '', ], ], - 'orderUpdate' => [ + 'OrderUpdate' => [ 'uri' => '/', 'method' => RequestInterface::METHOD_PATCH, 'requiredParams' => [ @@ -243,21 +243,21 @@ protected function getTransactionServicesConfig(): array 'transactionId' => '', ], ], - 'orderStatus' => [ + 'OrderStatus' => [ 'uri' => '/transactions/%transactionId%/status', 'method' => RequestInterface::METHOD_GET, 'requiredParams' => [ 'transactionId' => '', ], ], - 'orderApprove' => [ + 'OrderApprove' => [ 'uri' => '/', 'method' => RequestInterface::METHOD_PATCH, 'requiredParams' => [ 'transactionId' => '', ], ], - 'orderDecline' => [ + 'OrderDecline' => [ 'uri' => '/', 'method' => RequestInterface::METHOD_PATCH, 'requiredParams' => [