diff --git a/composer.json b/composer.json index fc972a9..c09d622 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "buckaroo/sdk", "description": "Buckaroo payment SDK", "license": "MIT", - "version": "1.9.1", + "version": "1.10.0", "type": "library", "require": { "php": ">=7.4|^8.0", diff --git a/src/PaymentMethods/KnakenPay/KnakenPay.php b/src/PaymentMethods/KnakenPay/KnakenPay.php new file mode 100644 index 0000000..1ceb155 --- /dev/null +++ b/src/PaymentMethods/KnakenPay/KnakenPay.php @@ -0,0 +1,47 @@ +payload)); + } +} diff --git a/src/PaymentMethods/KnakenPay/Models/Pay.php b/src/PaymentMethods/KnakenPay/Models/Pay.php new file mode 100644 index 0000000..8d0f15d --- /dev/null +++ b/src/PaymentMethods/KnakenPay/Models/Pay.php @@ -0,0 +1,28 @@ + ['in3old'], KlarnaPay::class => ['klarna', 'klarnain'], KlarnaKP::class => ['klarnakp'], + KnakenPay::class => ['knaken', 'knakenpay'], Multibanco::class => ['multibanco'], MBWay::class => ['mbway'], Surepay::class => ['surepay'], diff --git a/tests/Buckaroo/Payments/KnakenPayTest.php b/tests/Buckaroo/Payments/KnakenPayTest.php new file mode 100644 index 0000000..71e57f9 --- /dev/null +++ b/tests/Buckaroo/Payments/KnakenPayTest.php @@ -0,0 +1,61 @@ +buckaroo->method('knaken')->pay([ + 'invoice' => uniqid(), + 'amountDebit' => 10.99, + 'returnURL' => 'https://buckaroo.dev./return', + 'returnURLCancel' => 'https://buckaroo.dev/cancel', + 'returnURLError' => 'https://buckaroo.dev/error', + 'returnURLReject' => 'https://buckaroo.dev/reject', + 'pushURL' => 'https://buckaroo.dev/push', + 'pushURLFailure' => 'https://buckaroo.dev/push-failure', + ]); + + $this->assertTrue($response->isPendingProcessing()); + } + + /** + * @test + */ + public function it_creates_a_knaken_refund() + { + $response = $this->buckaroo->method('knaken')->refund([ + 'invoice' => '2024020209061234', //Set invoice number of the transaction to refund + 'originalTransactionKey' => '2FBB9F43A0AF4AC8B49F9073C0EC828B', + //Set transaction key of the transaction to refund + 'amountCredit' => 0.01 + ]); + + $this->assertTrue($response->isFailed()); + } +}