Skip to content

Commit

Permalink
Merge pull request #177 from buckaroo-it/BA-269
Browse files Browse the repository at this point in the history
BA-269 - Add iDEAL Fast Checkout
  • Loading branch information
vildanbina authored May 16, 2024
2 parents b5b6a0d + 4713afd commit bc04115
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 9 deletions.
15 changes: 15 additions & 0 deletions src/PaymentMethods/iDeal/iDeal.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 23 additions & 9 deletions tests/Buckaroo/Payments/IdealTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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
*/
Expand Down

0 comments on commit bc04115

Please sign in to comment.