From 78b5d0cbc6f18d1b9ecae977685327eab3c7a27d Mon Sep 17 00:00:00 2001 From: woutse Date: Sun, 10 Nov 2024 14:50:59 +0100 Subject: [PATCH 01/10] Updates for v3 --- samples/Exchange.php | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/Exchange.php b/samples/Exchange.php index 71d6031..46f6426 100644 --- a/samples/Exchange.php +++ b/samples/Exchange.php @@ -11,6 +11,7 @@ $exchange = new Exchange(); + try { # Process the exchange request $payOrder = $exchange->process(); From 943f2ddc114839ff254eabe4360f1b0465303578 Mon Sep 17 00:00:00 2001 From: woutse Date: Sun, 10 Nov 2024 14:58:53 +0100 Subject: [PATCH 02/10] Updates for v3 --- samples/Exchange.php | 8 +++++--- src/Model/CheckoutOptions.php | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/samples/Exchange.php b/samples/Exchange.php index 46f6426..04ffe4e 100644 --- a/samples/Exchange.php +++ b/samples/Exchange.php @@ -12,11 +12,13 @@ $exchange = new Exchange(); -try { + try { + # Process the exchange request - $payOrder = $exchange->process(); + $payOrder = $exchange->process(); - switch ($payOrder->getStateId()) { + switch ($payOrder->getStateId()) + { case PayStatus::PENDING : $responseResult = yourCodeToProcessPendingOrder($payOrder->getReference()); $responseMessage = 'Processed pending'; diff --git a/src/Model/CheckoutOptions.php b/src/Model/CheckoutOptions.php index 5002b91..6937958 100644 --- a/src/Model/CheckoutOptions.php +++ b/src/Model/CheckoutOptions.php @@ -6,6 +6,7 @@ use PayNL\Sdk\Common\AbstractTotalCollection; + /** * Class CheckoutOptions * From 8471c63316e8278c273c457825f4e0278bc049c0 Mon Sep 17 00:00:00 2001 From: woutse Date: Sun, 10 Nov 2024 15:05:55 +0100 Subject: [PATCH 03/10] Updates for v3 --- src/Model/CheckoutOptions.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Model/CheckoutOptions.php b/src/Model/CheckoutOptions.php index 6937958..ec8b99c 100644 --- a/src/Model/CheckoutOptions.php +++ b/src/Model/CheckoutOptions.php @@ -14,12 +14,18 @@ */ class CheckoutOptions extends AbstractTotalCollection implements ModelInterface { + + + + /** * @return array */ public function getCheckoutOptions(): array { - return $this->toArray(); + + return $this->toArray(); + } /** @@ -31,6 +37,11 @@ public function setCheckoutOptions(array $checkoutoptions): self { $this->clear(); + + if(1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1) + { + echo 'oi;'; + } if (0 === count($checkoutoptions)) { return $this; } From a4d9eeb5baef8c0198321ec665392301430063d4 Mon Sep 17 00:00:00 2001 From: woutse Date: Sun, 10 Nov 2024 15:12:32 +0100 Subject: [PATCH 04/10] Updates for v3 --- .github/workflows/phplint.yml | 2 +- src/Model/CheckoutOptions.php | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/phplint.yml b/.github/workflows/phplint.yml index 4cc7ede..df416f9 100644 --- a/.github/workflows/phplint.yml +++ b/.github/workflows/phplint.yml @@ -16,7 +16,7 @@ jobs: - name: Lint Code Base uses: github/super-linter/slim@v4 env: - DEFAULT_BRANCH: master + DEFAULT_BRANCH: main GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }} VALIDATE_PHP: true diff --git a/src/Model/CheckoutOptions.php b/src/Model/CheckoutOptions.php index ec8b99c..55625d6 100644 --- a/src/Model/CheckoutOptions.php +++ b/src/Model/CheckoutOptions.php @@ -18,9 +18,6 @@ class CheckoutOptions extends AbstractTotalCollection implements ModelInterface - /** - * @return array - */ public function getCheckoutOptions(): array { From 66c30e6d40c45fe8916d25a9b1886a4e2103e4d2 Mon Sep 17 00:00:00 2001 From: woutse Date: Sun, 10 Nov 2024 15:15:15 +0100 Subject: [PATCH 05/10] Updates for v3 --- samples/Exchange.php | 20 +++++++++++++------- src/Model/CheckoutOptions.php | 15 ++++----------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/samples/Exchange.php b/samples/Exchange.php index 04ffe4e..bec1227 100644 --- a/samples/Exchange.php +++ b/samples/Exchange.php @@ -12,13 +12,12 @@ $exchange = new Exchange(); - try { - +try { + # Process the exchange request - $payOrder = $exchange->process(); + $payOrder = $exchange->process(); - switch ($payOrder->getStateId()) - { + switch ($payOrder->getStateId()) { case PayStatus::PENDING : $responseResult = yourCodeToProcessPendingOrder($payOrder->getReference()); $responseMessage = 'Processed pending'; @@ -36,7 +35,14 @@ $responseMessage = $exception->getMessage(); } -function yourCodeToProcessPendingOrder($orderId) { return true; } -function yourCodeToProcessPaidOrder($orderId) { return true; } +function yourCodeToProcessPendingOrder($orderId) +{ + return true; +} + +function yourCodeToProcessPaidOrder($orderId) +{ + return true; +} $exchange->setResponse($responseResult, $responseMessage); \ No newline at end of file diff --git a/src/Model/CheckoutOptions.php b/src/Model/CheckoutOptions.php index 55625d6..7413768 100644 --- a/src/Model/CheckoutOptions.php +++ b/src/Model/CheckoutOptions.php @@ -15,14 +15,12 @@ class CheckoutOptions extends AbstractTotalCollection implements ModelInterface { - - - + /** + * @return array + */ public function getCheckoutOptions(): array { - - return $this->toArray(); - + return $this->toArray(); } /** @@ -34,11 +32,6 @@ public function setCheckoutOptions(array $checkoutoptions): self { $this->clear(); - - if(1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1 && 1==1) - { - echo 'oi;'; - } if (0 === count($checkoutoptions)) { return $this; } From fcceb88ed5a91453467b7e26547145876b6d689d Mon Sep 17 00:00:00 2001 From: woutse Date: Sun, 10 Nov 2024 15:24:55 +0100 Subject: [PATCH 06/10] Updates for v3 --- samples/Exchange.php | 18 ++++++++++++------ src/Model/CheckoutOptions.php | 4 +--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/samples/Exchange.php b/samples/Exchange.php index bec1227..d0bc42d 100644 --- a/samples/Exchange.php +++ b/samples/Exchange.php @@ -13,16 +13,15 @@ try { - # Process the exchange request $payOrder = $exchange->process(); switch ($payOrder->getStateId()) { - case PayStatus::PENDING : + case PayStatus::PENDING: $responseResult = yourCodeToProcessPendingOrder($payOrder->getReference()); $responseMessage = 'Processed pending'; break; - case PayStatus::PAID : + case PayStatus::PAID: $responseResult = yourCodeToProcessPaidOrder($payOrder->getReference()); $responseMessage = 'Processed paid. Order: ' . $payOrder->getReference(); break; @@ -35,14 +34,21 @@ $responseMessage = $exception->getMessage(); } -function yourCodeToProcessPendingOrder($orderId) -{ +/** + * @param $orderId + * @return true + */ +function yourCodeToProcessPendingOrder($orderId) { return true; } +/** + * @param $orderId + * @return true + */ function yourCodeToProcessPaidOrder($orderId) { return true; } -$exchange->setResponse($responseResult, $responseMessage); \ No newline at end of file +$exchange->setResponse($responseResult, $responseMessage); diff --git a/src/Model/CheckoutOptions.php b/src/Model/CheckoutOptions.php index 7413768..2e42fce 100644 --- a/src/Model/CheckoutOptions.php +++ b/src/Model/CheckoutOptions.php @@ -6,7 +6,6 @@ use PayNL\Sdk\Common\AbstractTotalCollection; - /** * Class CheckoutOptions * @@ -14,7 +13,6 @@ */ class CheckoutOptions extends AbstractTotalCollection implements ModelInterface { - /** * @return array */ @@ -57,7 +55,7 @@ public function addCheckoutOption(CheckoutOption $checkoutoption): self /** * @inheritDoc */ - public function getCollectionName(): string + public function getCollectionName(): string // phpcs:ignore { return 'checkoutoptions'; } From 90a4ff7933cd677625d9b025aa191aed25edc353 Mon Sep 17 00:00:00 2001 From: woutse Date: Sun, 10 Nov 2024 15:29:09 +0100 Subject: [PATCH 07/10] Updates for v3 --- samples/Exchange.php | 8 +++++--- src/Model/CheckoutOptions.php | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/samples/Exchange.php b/samples/Exchange.php index d0bc42d..c5880e9 100644 --- a/samples/Exchange.php +++ b/samples/Exchange.php @@ -1,5 +1,5 @@ getReference()); $responseMessage = 'Processed paid. Order: ' . $payOrder->getReference(); break; - default : + default: $responseResult = true; $responseMessage = 'No action defined for payment state ' . $payOrder->getStateId(); } @@ -35,7 +35,8 @@ } /** - * @param $orderId + * @phpcs:ignore + * @param string $orderId * @return true */ function yourCodeToProcessPendingOrder($orderId) { @@ -43,6 +44,7 @@ function yourCodeToProcessPendingOrder($orderId) { } /** + * @phpcs:ignore * @param $orderId * @return true */ diff --git a/src/Model/CheckoutOptions.php b/src/Model/CheckoutOptions.php index 2e42fce..590e3bc 100644 --- a/src/Model/CheckoutOptions.php +++ b/src/Model/CheckoutOptions.php @@ -53,6 +53,7 @@ public function addCheckoutOption(CheckoutOption $checkoutoption): self } /** + * @phpcs:ignore * @inheritDoc */ public function getCollectionName(): string // phpcs:ignore From e22cb96d234c6f2c54e5ea415d8220bfaa2c5315 Mon Sep 17 00:00:00 2001 From: woutse Date: Sun, 10 Nov 2024 15:36:00 +0100 Subject: [PATCH 08/10] Updates for v3 --- samples/Exchange.php | 7 ++++--- src/Model/CheckoutOptions.php | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/samples/Exchange.php b/samples/Exchange.php index c5880e9..d2f4fbe 100644 --- a/samples/Exchange.php +++ b/samples/Exchange.php @@ -39,16 +39,17 @@ * @param string $orderId * @return true */ -function yourCodeToProcessPendingOrder($orderId) { +function yourCodeToProcessPendingOrder($orderId) +{ return true; } /** * @phpcs:ignore - * @param $orderId + * @param string $orderId * @return true */ -function yourCodeToProcessPaidOrder($orderId) +function yourCodeToProcessPaidOrder(string $orderId) { return true; } diff --git a/src/Model/CheckoutOptions.php b/src/Model/CheckoutOptions.php index 590e3bc..caaf924 100644 --- a/src/Model/CheckoutOptions.php +++ b/src/Model/CheckoutOptions.php @@ -53,11 +53,12 @@ public function addCheckoutOption(CheckoutOption $checkoutoption): self } /** - * @phpcs:ignore + * @phpcs:disable * @inheritDoc */ - public function getCollectionName(): string // phpcs:ignore + public function getCollectionName(): string { return 'checkoutoptions'; } + /** @phpcs:enable */ } From 108a2f14cc18e88901b5caa18dd8b7b5190b642f Mon Sep 17 00:00:00 2001 From: woutse Date: Sun, 10 Nov 2024 15:39:42 +0100 Subject: [PATCH 09/10] Updates for v3 --- samples/Exchange.php | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/Exchange.php b/samples/Exchange.php index d2f4fbe..39e765d 100644 --- a/samples/Exchange.php +++ b/samples/Exchange.php @@ -1,4 +1,5 @@ Date: Sun, 10 Nov 2024 15:43:55 +0100 Subject: [PATCH 10/10] Updates for v3 --- samples/Exchange.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Exchange.php b/samples/Exchange.php index 39e765d..f3bbd7c 100644 --- a/samples/Exchange.php +++ b/samples/Exchange.php @@ -1,6 +1,6 @@