From 492bebb8b11f301650f13aa0e8b2694a43a561db Mon Sep 17 00:00:00 2001 From: Shu Chen Date: Thu, 2 May 2024 13:33:22 +0800 Subject: [PATCH 1/3] Adding iDeal Fast Checkout --- src/PaymentMethods/iDeal/iDeal.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/PaymentMethods/iDeal/iDeal.php b/src/PaymentMethods/iDeal/iDeal.php index dbd0761..e0902c4 100644 --- a/src/PaymentMethods/iDeal/iDeal.php +++ b/src/PaymentMethods/iDeal/iDeal.php @@ -53,6 +53,19 @@ public function pay(?Model $model = null) return parent::pay($model ?? new Pay($this->payload)); } + /** + * @param Model|null $model + * @return TransactionResponse + */ + public function payFastCheckout(?Model $model = null) + { + $this->setPayPayload(); + + $this->setServiceList('PayFastCheckout', $model ?? new Pay($this->payload)); + + return $this->postRequest(); + } + /** * @param Model|null $model * @return TransactionResponse From f3d8db1403bc9ee4120d82e7d5cdc0c3c4ac7947 Mon Sep 17 00:00:00 2001 From: Shu Chen Date: Fri, 3 May 2024 13:02:24 +0800 Subject: [PATCH 2/3] Adding iDeal Fast Checkout --- src/PaymentMethods/iDeal/iDeal.php | 4 +++- tests/Buckaroo/Payments/IdealTest.php | 32 +++++++++++++++++++-------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/PaymentMethods/iDeal/iDeal.php b/src/PaymentMethods/iDeal/iDeal.php index e0902c4..60556d2 100644 --- a/src/PaymentMethods/iDeal/iDeal.php +++ b/src/PaymentMethods/iDeal/iDeal.php @@ -58,9 +58,11 @@ public function pay(?Model $model = null) * @return TransactionResponse */ public function payFastCheckout(?Model $model = null) - { + { $this->setPayPayload(); + $this->request->setData('order', ''); + $this->setServiceList('PayFastCheckout', $model ?? new Pay($this->payload)); return $this->postRequest(); diff --git a/tests/Buckaroo/Payments/IdealTest.php b/tests/Buckaroo/Payments/IdealTest.php index c7cb886..1d65fab 100644 --- a/tests/Buckaroo/Payments/IdealTest.php +++ b/tests/Buckaroo/Payments/IdealTest.php @@ -24,16 +24,16 @@ use Buckaroo\Config\Config; -class CustomConfig extends Config -{ - public function __construct() - { - $websiteKey = 'Set Key'; - $secretKey = 'From other resources like DB/ENV/Platform Config'; +// class CustomConfig extends Config +// { +// public function __construct() +// { +// $websiteKey = 'Set Key'; +// $secretKey = 'From other resources like DB/ENV/Platform Config'; - parent::__construct($websiteKey, $secretKey); - } -} +// parent::__construct($websiteKey, $secretKey); +// } +// } class IdealTest extends BuckarooTestCase { @@ -105,6 +105,20 @@ public function it_creates_a_ideal_payment() $this->assertTrue($response->isPendingProcessing()); } + /** + * @return void + * @test + */ + public function it_creates_a_ideal_fast_checkout_payment() + { + $response = $this->buckaroo->method('ideal')->payFastCheckout([ + 'amountDebit' => 10.10, + 'invoice' => uniqid(), + ]); + + $this->assertTrue($response->isWaitingOnUserInput()); + } + /** * @test */ From 4713afd780b86b5e8abd68a0aeee106d46e2239e Mon Sep 17 00:00:00 2001 From: Shu Chen Date: Fri, 3 May 2024 13:20:19 +0800 Subject: [PATCH 3/3] Remove whitespaces --- src/PaymentMethods/iDeal/iDeal.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PaymentMethods/iDeal/iDeal.php b/src/PaymentMethods/iDeal/iDeal.php index 60556d2..4a19fac 100644 --- a/src/PaymentMethods/iDeal/iDeal.php +++ b/src/PaymentMethods/iDeal/iDeal.php @@ -58,11 +58,11 @@ public function pay(?Model $model = null) * @return TransactionResponse */ public function payFastCheckout(?Model $model = null) - { + { $this->setPayPayload(); - + $this->request->setData('order', ''); - + $this->setServiceList('PayFastCheckout', $model ?? new Pay($this->payload)); return $this->postRequest();