diff --git a/src/PaymentMethods/iDeal/iDeal.php b/src/PaymentMethods/iDeal/iDeal.php index dbd0761..4a19fac 100644 --- a/src/PaymentMethods/iDeal/iDeal.php +++ b/src/PaymentMethods/iDeal/iDeal.php @@ -53,6 +53,21 @@ 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->request->setData('order', ''); + + $this->setServiceList('PayFastCheckout', $model ?? new Pay($this->payload)); + + return $this->postRequest(); + } + /** * @param Model|null $model * @return TransactionResponse 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 */