-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
064d499
commit 14891d9
Showing
55 changed files
with
2,422 additions
and
12 deletions.
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
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,17 @@ | ||
# Security Policy | ||
|
||
## Supported Versions | ||
|
||
Only the last two release streams are supported. | ||
|
||
| Version | Supported | | ||
| ------- | ------------------ | | ||
| 0.9.x | :white_check_mark: | | ||
| 0.8.x | :white_check_mark: | | ||
| < 0.8 | :x: | | ||
|
||
## Reporting a Vulnerability | ||
|
||
To report a security vulnerability, please use the | ||
[Tidelift security contact](https://tidelift.com/security). | ||
Tidelift will coordinate the fix and disclosure. |
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,23 @@ | ||
name: SonarQube PR Analysis | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop/ | ||
- 'bugfix/**' | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
sonarqube: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: SonarQube Scan | ||
uses: sonarsource/sonarqube-scan-action@master | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} |
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,21 @@ | ||
<?php | ||
|
||
require_once '../bootstrap.php'; | ||
|
||
use Buckaroo\BuckarooClient; | ||
|
||
$buckaroo = new BuckarooClient($_ENV['BPE_WEBSITE_KEY'], $_ENV['BPE_SECRET_KEY']); | ||
|
||
//Also accepts json | ||
//Pay | ||
$response = $buckaroo->method('mbway')->pay([ | ||
'invoice' => uniqid(), | ||
'amountDebit' => 10.10, | ||
]); | ||
|
||
//Refund | ||
$response = $buckaroo->method('mbway')->refund([ | ||
'invoice' => '', //Set invoice number of the transaction to refund | ||
'originalTransactionKey' => '', //Set transaction key of the transaction to refund | ||
'amountCredit' => 10.10, | ||
]); |
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,21 @@ | ||
<?php | ||
|
||
require_once '../bootstrap.php'; | ||
|
||
use Buckaroo\BuckarooClient; | ||
|
||
$buckaroo = new BuckarooClient($_ENV['BPE_WEBSITE_KEY'], $_ENV['BPE_SECRET_KEY']); | ||
|
||
//Also accepts json | ||
//Pay | ||
$response = $buckaroo->method('multibanco')->pay([ | ||
'invoice' => uniqid(), | ||
'amountDebit' => 10.10, | ||
]); | ||
|
||
//Refund | ||
$response = $buckaroo->method('multibanco')->refund([ | ||
'invoice' => '', //Set invoice number of the transaction to refund | ||
'originalTransactionKey' => '', //Set transaction key of the transaction to refund | ||
'amountCredit' => 10.10, | ||
]); |
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,9 @@ | ||
# Unique key for the project | ||
sonar.projectKey=buckaroo:php_sdk | ||
|
||
# Display name and version for the SonarQube UI | ||
sonar.projectName=Buckaroo PHP SDK | ||
sonar.projectVersion=1.0 | ||
|
||
# Path to the source code, relative to the sonar-project.properties file | ||
sonar.sources=. |
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,30 @@ | ||
<?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 [email protected] 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 [email protected] for more information. | ||
* | ||
* @copyright Copyright (c) Buckaroo B.V. | ||
* @license https://tldrlegal.com/license/mit-license | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Buckaroo\PaymentMethods\MBWay; | ||
|
||
use Buckaroo\PaymentMethods\PayablePaymentMethod; | ||
|
||
class MBWay extends PayablePaymentMethod | ||
{ | ||
protected string $paymentName = 'MBWay'; | ||
} |
30 changes: 30 additions & 0 deletions
30
vendor/buckaroo/sdk/src/PaymentMethods/Multibanco/Multibanco.php
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,30 @@ | ||
<?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 [email protected] 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 [email protected] for more information. | ||
* | ||
* @copyright Copyright (c) Buckaroo B.V. | ||
* @license https://tldrlegal.com/license/mit-license | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Buckaroo\PaymentMethods\Multibanco; | ||
|
||
use Buckaroo\PaymentMethods\PayablePaymentMethod; | ||
|
||
class Multibanco extends PayablePaymentMethod | ||
{ | ||
protected string $paymentName = 'Multibanco'; | ||
} |
59 changes: 59 additions & 0 deletions
59
vendor/buckaroo/sdk/src/Services/TraitHelpers/HasIssuers.php
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,59 @@ | ||
<?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 [email protected] 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 [email protected] for more information. | ||
* | ||
* @copyright Copyright (c) Buckaroo B.V. | ||
* @license https://tldrlegal.com/license/mit-license | ||
*/ | ||
|
||
namespace Buckaroo\Services\TraitHelpers; | ||
|
||
use Buckaroo\Exceptions\BuckarooException; | ||
use Buckaroo\Transaction\Request\TransactionRequest; | ||
|
||
trait HasIssuers | ||
{ | ||
/** | ||
* @return array | ||
* @throws BuckarooException | ||
*/ | ||
public function issuers(): array | ||
{ | ||
$request = new TransactionRequest; | ||
|
||
try | ||
{ | ||
$response = $this->client->specification($request, $this->paymentName, $this->serviceVersion()); | ||
} catch (BuckarooException $e) | ||
{ | ||
return []; | ||
} | ||
|
||
$issuerList = []; | ||
if (isset($response->data()['Actions']['0']['RequestParameters'][0]['ListItemDescriptions'])) | ||
{ | ||
$issuersData = $response->data()['Actions']['0']['RequestParameters'][0]['ListItemDescriptions']; | ||
if (count($issuersData) > 0) | ||
{ | ||
foreach ($issuersData as $issuer) | ||
{ | ||
$issuerList[] = ['id' => $issuer['Value'], 'name' => $issuer['Description']]; | ||
} | ||
} | ||
} | ||
|
||
return $issuerList; | ||
} | ||
} |
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,55 @@ | ||
<?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 [email protected] 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 [email protected] for more information. | ||
* | ||
* @copyright Copyright (c) Buckaroo B.V. | ||
* @license https://tldrlegal.com/license/mit-license | ||
*/ | ||
|
||
namespace Tests\Buckaroo\Payments; | ||
|
||
use Tests\Buckaroo\BuckarooTestCase; | ||
|
||
class MBWayTest extends BuckarooTestCase | ||
{ | ||
/** | ||
* @return void | ||
* @test | ||
*/ | ||
public function it_creates_a_mbway_payment() | ||
{ | ||
$response = $this->buckaroo->method('mbway')->pay([ | ||
'invoice' => uniqid(), | ||
'amountDebit' => 10.10, | ||
]); | ||
|
||
$this->assertTrue($response->isPendingProcessing()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function it_creates_a_mbway_refund() | ||
{ | ||
$response = $this->buckaroo->method('mbway')->refund([ | ||
'amountCredit' => 10, | ||
'invoice' => 'testinvoice 123', | ||
'description' => 'refund', | ||
'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', | ||
]); | ||
|
||
$this->assertTrue($response->isFailed()); | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
vendor/buckaroo/sdk/tests/Buckaroo/Payments/MultibancoTest.php
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,55 @@ | ||
<?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 [email protected] 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 [email protected] for more information. | ||
* | ||
* @copyright Copyright (c) Buckaroo B.V. | ||
* @license https://tldrlegal.com/license/mit-license | ||
*/ | ||
|
||
namespace Tests\Buckaroo\Payments; | ||
|
||
use Tests\Buckaroo\BuckarooTestCase; | ||
|
||
class MultibancoTest extends BuckarooTestCase | ||
{ | ||
/** | ||
* @return void | ||
* @test | ||
*/ | ||
public function it_creates_a_multibanco_payment() | ||
{ | ||
$response = $this->buckaroo->method('multibanco')->pay([ | ||
'invoice' => uniqid(), | ||
'amountDebit' => 10.10, | ||
]); | ||
|
||
$this->assertTrue($response->isPendingProcessing()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function it_creates_a_multibanco_refund() | ||
{ | ||
$response = $this->buckaroo->method('multibanco')->refund([ | ||
'amountCredit' => 10, | ||
'invoice' => 'testinvoice 123', | ||
'description' => 'refund', | ||
'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', | ||
]); | ||
|
||
$this->assertTrue($response->isFailed()); | ||
} | ||
} |
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
Oops, something went wrong.