Skip to content

Commit

Permalink
Updates for v3
Browse files Browse the repository at this point in the history
  • Loading branch information
woutse committed Nov 13, 2024
1 parent c34ddb5 commit 80dfbe9
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions samples/OrderUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions src/Mapper/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
],
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Request/OrderApproveRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Request/OrderDeclineRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Request/OrderStatusRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Request/OrderUpdateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/Request/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ protected function getTransactionServicesConfig(): array
'transactionId' => '',
],
],
'orderUpdate' => [
'OrderUpdate' => [
'uri' => '/',
'method' => RequestInterface::METHOD_PATCH,
'requiredParams' => [
Expand Down Expand Up @@ -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' => [
Expand Down

0 comments on commit 80dfbe9

Please sign in to comment.