-
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
5f8512d
commit 49f0529
Showing
14 changed files
with
283 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Academic Free License (AFL 3.0) | ||
* It is available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/afl-3.0.php | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade this file | ||
* | ||
* @author Buckaroo.nl <[email protected]> | ||
* @copyright Copyright (c) Buckaroo B.V. | ||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | ||
*/ | ||
if (!defined('_PS_VERSION_')) { | ||
exit; | ||
} | ||
|
||
require_once dirname(__FILE__) . '/../paymentmethod.php'; | ||
class Blik extends PaymentMethod | ||
{ | ||
public function __construct() | ||
{ | ||
$this->type = 'blik'; | ||
$this->version = 1; | ||
} | ||
} |
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,25 @@ | ||
<?php | ||
/** | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Academic Free License (AFL 3.0) | ||
* It is available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/afl-3.0.php | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade this file | ||
* | ||
* @author Buckaroo.nl <[email protected]> | ||
* @copyright Copyright (c) Buckaroo B.V. | ||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | ||
*/ | ||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); | ||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); | ||
|
||
header('Cache-Control: no-store, no-cache, must-revalidate'); | ||
header('Cache-Control: post-check=0, pre-check=0', false); | ||
header('Pragma: no-cache'); | ||
|
||
header('Location: ../'); | ||
exit; |
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
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,51 @@ | ||
<?php | ||
/** | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Academic Free License (AFL 3.0) | ||
* It is available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/afl-3.0.php | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade this file | ||
* | ||
* @author Buckaroo.nl <[email protected]> | ||
* @copyright Copyright (c) Buckaroo B.V. | ||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | ||
*/ | ||
include_once _PS_MODULE_DIR_ . 'buckaroo3/library/checkout/checkout.php'; | ||
|
||
if (!defined('_PS_VERSION_')) { | ||
exit; | ||
} | ||
|
||
class BlikCheckout extends Checkout | ||
{ | ||
protected $customVars = []; | ||
|
||
final public function setCheckout() | ||
{ | ||
parent::setCheckout(); | ||
} | ||
|
||
public function startPayment() | ||
{ | ||
$this->payment_response = $this->payment_request->pay($this->customVars); | ||
} | ||
|
||
public function isRedirectRequired() | ||
{ | ||
return true; | ||
} | ||
|
||
public function isVerifyRequired() | ||
{ | ||
return false; | ||
} | ||
|
||
protected function initialize() | ||
{ | ||
$this->payment_request = PaymentRequestFactory::create(PaymentRequestFactory::REQUEST_TYPE_BLIK); | ||
} | ||
} |
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,48 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Buckaroo\PaymentMethods\Blik; | ||
|
||
use Buckaroo\Models\Model; | ||
use Buckaroo\PaymentMethods\Blik\Models\Refund; | ||
use Buckaroo\PaymentMethods\Blik\Models\Pay; | ||
use Buckaroo\PaymentMethods\Interfaces\Combinable; | ||
use Buckaroo\PaymentMethods\PayablePaymentMethod; | ||
use Buckaroo\Transaction\Response\TransactionResponse; | ||
|
||
/** | ||
* | ||
*/ | ||
class Blik extends PayablePaymentMethod implements Combinable | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected string $paymentName = 'blik'; | ||
/** | ||
* @var int | ||
*/ | ||
protected int $serviceVersion = 0; | ||
|
||
/** | ||
* @param Model|null $model | ||
* @return TransactionResponse | ||
*/ | ||
public function pay(?Model $model = null): TransactionResponse | ||
{ | ||
return parent::pay($model ?? new Pay($this->payload)); | ||
} | ||
|
||
// /** | ||
// * @param Model|null $model | ||
// * @return TransactionResponse | ||
// */ | ||
// public function refund(?Model $model = null): TransactionResponse | ||
// { | ||
// return parent::refund($model ?? new Refund($this->payload)); | ||
// } | ||
// | ||
|
||
|
||
} |
28 changes: 28 additions & 0 deletions
28
vendor/buckaroo/sdk/src/PaymentMethods/Blik/Models/Pay.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,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 [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\PaymentMethods\Blik\Models; | ||
|
||
use Buckaroo\Models\ServiceParameter; | ||
|
||
class Pay extends ServiceParameter | ||
{ | ||
protected bool $saveToken; | ||
} |
58 changes: 58 additions & 0 deletions
58
vendor/buckaroo/sdk/src/PaymentMethods/Blik/Models/Refund.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,58 @@ | ||
<?php | ||
|
||
namespace Buckaroo\PaymentMethods\Blik\Models; | ||
|
||
use Buckaroo\Models\ServiceParameter; | ||
use Buckaroo\PaymentMethods\Afterpay\Service\ParameterKeys\ArticleAdapter; | ||
use Buckaroo\PaymentMethods\Traits\CountableGroupKey; | ||
|
||
class Refund extends ServiceParameter | ||
{ | ||
use CountableGroupKey; | ||
|
||
/** | ||
* @var array|string[] | ||
*/ | ||
private array $countableProperties = ['articles']; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected string $merchantImageUrl; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected string $summaryImageUrl; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
protected array $articles = []; | ||
|
||
/** | ||
* @var array|\string[][] | ||
*/ | ||
protected array $groupData = [ | ||
'articles' => [ | ||
'groupType' => 'Article', | ||
], | ||
]; | ||
|
||
/** | ||
* @param array|null $articles | ||
* @return array | ||
*/ | ||
public function articles(?array $articles = null) | ||
{ | ||
if (is_array($articles)) | ||
{ | ||
foreach ($articles as $article) | ||
{ | ||
$this->articles[] = new ArticleAdapter(new Article($article)); | ||
} | ||
} | ||
|
||
return $this->articles; | ||
} | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.