-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BA-243-iDEAL-Processing-not-working-properly-therefore-create-a-separate-method-for-iDEAL-Processing #169
Merged
vegimcarkaxhija
merged 1 commit into
develop
from
BA-243-iDEAL-Processing-not-working-properly-therefore-create-a-separate-method-for-iDEAL-Processing
Mar 12, 2024
Merged
BA-243-iDEAL-Processing-not-working-properly-therefore-create-a-separate-method-for-iDEAL-Processing #169
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the MIT License | ||
* It is available through the world-wide-web at this URL: | ||
* https://tldrlegal.com/license/mit-license | ||
* If you are unable to obtain it through the world-wide-web, please send an email | ||
* to support@buckaroo.nl so we can send you a copy immediately. | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade this module to newer | ||
* versions in the future. If you wish to customize this module for your | ||
* needs please contact support@buckaroo.nl for more information. | ||
* | ||
* @copyright Copyright (c) Buckaroo B.V. | ||
* @license https://tldrlegal.com/license/mit-license | ||
*/ | ||
|
||
namespace Buckaroo\PaymentMethods\iDealProcessing\Models; | ||
|
||
use Buckaroo\Models\ServiceParameter; | ||
|
||
class Pay extends ServiceParameter | ||
{ | ||
protected string $issuer; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php | ||
/* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the MIT License | ||
* It is available through the world-wide-web at this URL: | ||
* https://tldrlegal.com/license/mit-license | ||
* If you are unable to obtain it through the world-wide-web, please send an email | ||
* to support@buckaroo.nl so we can send you a copy immediately. | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade this module to newer | ||
* versions in the future. If you wish to customize this module for your | ||
* needs please contact support@buckaroo.nl for more information. | ||
* | ||
* @copyright Copyright (c) Buckaroo B.V. | ||
* @license https://tldrlegal.com/license/mit-license | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Buckaroo\PaymentMethods\iDealProcessing; | ||
|
||
use Buckaroo\Exceptions\BuckarooException; | ||
use Buckaroo\Models\Model; | ||
use Buckaroo\PaymentMethods\iDealProcessing\Models\Pay; | ||
use Buckaroo\PaymentMethods\PayablePaymentMethod; | ||
use Buckaroo\Services\TraitHelpers\HasIssuers; | ||
use Buckaroo\Transaction\Response\TransactionResponse; | ||
|
||
class iDealProcessing extends PayablePaymentMethod | ||
Check failure on line 32 in src/PaymentMethods/iDealProcessing/iDealProcessing.php GitHub Actions / PHP 7.4 - prefer-stable -
Check failure on line 32 in src/PaymentMethods/iDealProcessing/iDealProcessing.php GitHub Actions / PHP 8.2 - prefer-stable -
|
||
{ | ||
use HasIssuers { | ||
issuers as traitIssuers; | ||
} | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected string $paymentName = 'idealprocessing'; | ||
/** | ||
* @var array|string[] | ||
*/ | ||
protected array $requiredConfigFields = ['currency', 'returnURL', 'returnURLCancel', 'pushURL']; | ||
|
||
/** | ||
* @param Model|null $model | ||
* @return TransactionResponse | ||
*/ | ||
public function pay(?Model $model = null) | ||
{ | ||
return parent::pay($model ?? new Pay($this->payload)); | ||
} | ||
|
||
/** | ||
* @param Model|null $model | ||
* @return TransactionResponse | ||
*/ | ||
public function payRemainder(?Model $model = null): TransactionResponse | ||
{ | ||
return parent::payRemainder($model ?? new Pay($this->payload)); | ||
} | ||
|
||
/** | ||
* @return array | ||
* @throws BuckarooException | ||
*/ | ||
public function issuers(): array | ||
{ | ||
$this->serviceVersion = 2; | ||
|
||
return $this->traitIssuers(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?php | ||
/* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the MIT License | ||
* It is available through the world-wide-web at this URL: | ||
* https://tldrlegal.com/license/mit-license | ||
* If you are unable to obtain it through the world-wide-web, please send an email | ||
* to support@buckaroo.nl so we can send you a copy immediately. | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade this module to newer | ||
* versions in the future. If you wish to customize this module for your | ||
* needs please contact support@buckaroo.nl for more information. | ||
* | ||
* @copyright Copyright (c) Buckaroo B.V. | ||
* @license https://tldrlegal.com/license/mit-license | ||
*/ | ||
|
||
namespace Tests\Buckaroo\Payments; | ||
|
||
use Tests\Buckaroo\BuckarooTestCase; | ||
use Buckaroo\Config\Config; | ||
|
||
|
||
class CustomConfig extends Config | ||
{ | ||
public function __construct() | ||
{ | ||
$websiteKey = 'Set Key'; | ||
$secretKey = 'From other resources like DB/ENV/Platform Config'; | ||
|
||
parent::__construct($websiteKey, $secretKey); | ||
} | ||
} | ||
|
||
class IdealProcessingTest extends BuckarooTestCase | ||
{ | ||
protected array $paymentPayload; | ||
protected function setUp(): void | ||
{ | ||
$this->paymentPayload = [ | ||
'invoice' => uniqid(), | ||
'amountDebit' => 10.10, | ||
'issuer' => 'ABNANL2A', | ||
'pushURL' => 'https://buckaroo.dev/push', | ||
'returnURL' => 'https://buckaroo.dev/return', | ||
'clientIP' => [ | ||
'address' => '123.456.789.123', | ||
'type' => 0, | ||
], | ||
'customParameters' => [ | ||
'CustomerBillingFirstName' => 'test' | ||
], | ||
'additionalParameters' => [ | ||
'initiated_by_magento' => 1, | ||
'service_action' => 'something', | ||
], | ||
]; | ||
} | ||
|
||
/** | ||
* @return void | ||
* @test | ||
*/ | ||
public function it_get_idealprocessing_issuers() | ||
{ | ||
$response = $this->buckaroo->method('idealprocessing')->issuers(); | ||
|
||
$this->assertIsArray($response); | ||
foreach ($response as $item) | ||
{ | ||
$this->assertIsArray($item); | ||
$this->assertArrayHasKey('id', $item); | ||
$this->assertArrayHasKey('name', $item); | ||
} | ||
} | ||
|
||
/** | ||
* @return void | ||
* @test | ||
*/ | ||
public function it_creates_a_idealprocessing_payment() | ||
{ | ||
$response = $this->buckaroo->method('idealprocessing')->pay($this->paymentPayload); | ||
|
||
$this->assertTrue($response->isPendingProcessing()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was writen twice, you can check line 120 is still there