From 8aed7a57fba863a2db0b0ee419b47f28eee5d4a7 Mon Sep 17 00:00:00 2001 From: Vildan Bina Date: Sat, 9 Nov 2024 20:54:27 +0100 Subject: [PATCH 1/3] remove sofort --- example/transactions/sofort.php | 22 -------- src/PaymentMethods/PaymentMethodFactory.php | 2 - src/PaymentMethods/Sofort/Sofort.php | 47 ---------------- tests/Buckaroo/Payments/SofortTest.php | 62 --------------------- 4 files changed, 133 deletions(-) delete mode 100644 example/transactions/sofort.php delete mode 100644 src/PaymentMethods/Sofort/Sofort.php delete mode 100644 tests/Buckaroo/Payments/SofortTest.php diff --git a/example/transactions/sofort.php b/example/transactions/sofort.php deleted file mode 100644 index 0db0a955..00000000 --- a/example/transactions/sofort.php +++ /dev/null @@ -1,22 +0,0 @@ -method('sofortueberweisung')->pay([ - 'invoice' => uniqid(), - 'amountDebit' => 10.10, -]); - - -//Refund -$response = $buckaroo->method('sofortueberweisung')->refund([ - 'invoice' => '', //Set invoice number of the transaction to refund - 'originalTransactionKey' => '', //Set transaction key of the transaction to refund - 'amountCredit' => 10.10, -]); diff --git a/src/PaymentMethods/PaymentMethodFactory.php b/src/PaymentMethods/PaymentMethodFactory.php index b03b2b2f..b0bcde8a 100644 --- a/src/PaymentMethods/PaymentMethodFactory.php +++ b/src/PaymentMethods/PaymentMethodFactory.php @@ -33,7 +33,6 @@ use Buckaroo\PaymentMethods\Alipay\Alipay; use Buckaroo\PaymentMethods\In3Old\In3Old; use Buckaroo\PaymentMethods\Paypal\Paypal; -use Buckaroo\PaymentMethods\Sofort\Sofort; use Buckaroo\PaymentMethods\Thunes\Thunes; use Buckaroo\PaymentMethods\Belfius\Belfius; use Buckaroo\PaymentMethods\Billink\Billink; @@ -112,7 +111,6 @@ class PaymentMethodFactory EPS::class => ['eps'], ExternalPayment::class => ['externalpayment'], Emandates::class => ['emandates'], - Sofort::class => ['sofort', 'sofortueberweisung'], Marketplaces::class => ['marketplaces'], NoServiceSpecifiedPayment::class => ['noservice'], Payconiq::class => ['payconiq'], diff --git a/src/PaymentMethods/Sofort/Sofort.php b/src/PaymentMethods/Sofort/Sofort.php deleted file mode 100644 index 68adc948..00000000 --- a/src/PaymentMethods/Sofort/Sofort.php +++ /dev/null @@ -1,47 +0,0 @@ -setRefundPayload(); - - $this->setServiceList('instantRefund', $model); - - return $this->postRequest(); - } -} diff --git a/tests/Buckaroo/Payments/SofortTest.php b/tests/Buckaroo/Payments/SofortTest.php deleted file mode 100644 index e0656911..00000000 --- a/tests/Buckaroo/Payments/SofortTest.php +++ /dev/null @@ -1,62 +0,0 @@ -paymentPayload = ([ - 'invoice' => uniqid(), - 'amountDebit' => 10.10, - ]); - } - - /** - * @return void - * @test - */ - public function it_creates_a_sofort_payment() - { - $response = $this->buckaroo->method('sofortueberweisung')->pay($this->paymentPayload); - - $this->assertTrue($response->isPendingProcessing()); - } - - - /** - * @return void - * @test - */ - public function it_creates_a_sofort_instant_refund() - { - $response = $this->buckaroo->method('sofortueberweisung')->instantRefund([ - 'invoice' => uniqid(), - 'amountCredit' => 10.10, - ]); - - $this->assertTrue($response->isValidationFailure()); - } -} From 087a327a6a704ab8e415fa0056dc8798d545bbb3 Mon Sep 17 00:00:00 2001 From: Vildan Bina Date: Wed, 4 Dec 2024 16:16:00 +0100 Subject: [PATCH 2/3] add JSON_PRESERVE_ZERO_FRACTION to json_encode options --- src/Handlers/HMAC/Hmac.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Handlers/HMAC/Hmac.php b/src/Handlers/HMAC/Hmac.php index 5b3befb6..09d16362 100644 --- a/src/Handlers/HMAC/Hmac.php +++ b/src/Handlers/HMAC/Hmac.php @@ -51,7 +51,7 @@ public function base64Data($data = null) if (is_array($data)) { $data = mb_convert_encoding( - json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), + json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION), 'UTF-8', 'auto' ); From 50d703c39a059afdff50f9b620418c0d6c184b8b Mon Sep 17 00:00:00 2001 From: Vildan Bina Date: Wed, 4 Dec 2024 16:18:28 +0100 Subject: [PATCH 3/3] update version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7cd2cc9c..f2fdcacd 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "buckaroo/sdk", "description": "Buckaroo payment SDK", "license": "MIT", - "version": "1.17.0", + "version": "1.17.1", "type": "library", "require": { "php": "^8.1",