-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1056 from buckaroo-it/develop
BP-3754-Update-test-release-1.50.0
- Loading branch information
Showing
46 changed files
with
1,741 additions
and
529 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
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
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,87 @@ | ||
<?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\Magento2\Model\ConfigProvider\Method; | ||
|
||
class Blik extends AbstractConfigProvider | ||
{ | ||
const XPATH_BLIK_PAYMENT_FEE = 'payment/buckaroo_magento2_blik/payment_fee'; | ||
const XPATH_BLIK_PAYMENT_FEE_LABEL = 'payment/buckaroo_magento2_blik/payment_fee_label'; | ||
const XPATH_BLIK_ACTIVE = 'payment/buckaroo_magento2_blik/active'; | ||
const XPATH_BLIK_SUBTEXT = 'payment/buckaroo_magento2_blik/subtext'; | ||
const XPATH_BLIK_SUBTEXT_STYLE = 'payment/buckaroo_magento2_blik/subtext_style'; | ||
const XPATH_BLIK_SUBTEXT_COLOR = 'payment/buckaroo_magento2_blik/subtext_color'; | ||
const XPATH_BLIK_ACTIVE_STATUS = 'payment/buckaroo_magento2_blik/active_status'; | ||
const XPATH_BLIK_ORDER_STATUS_SUCCESS = 'payment/buckaroo_magento2_blik/order_status_success'; | ||
const XPATH_BLIK_ORDER_STATUS_FAILED = 'payment/buckaroo_magento2_blik/order_status_failed'; | ||
const XPATH_BLIK_AVAILABLE_IN_BACKEND = 'payment/buckaroo_magento2_blik/available_in_backend'; | ||
|
||
const XPATH_ALLOWED_CURRENCIES = 'payment/buckaroo_magento2_blik/allowed_currencies'; | ||
|
||
const XPATH_ALLOW_SPECIFIC = 'payment/buckaroo_magento2_blik/allowspecific'; | ||
const XPATH_SPECIFIC_COUNTRY = 'payment/buckaroo_magento2_blik/specificcountry'; | ||
const XPATH_SPECIFIC_CUSTOMER_GROUP = 'payment/buckaroo_magento2_blik/specificcustomergroup'; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
protected $allowedCurrencies = [ | ||
'PLN' | ||
]; | ||
/** | ||
* @return array|void | ||
*/ | ||
public function getConfig() | ||
{ | ||
$paymentFeeLabel = $this->getBuckarooPaymentFeeLabel( | ||
\Buckaroo\Magento2\Model\Method\Blik::PAYMENT_METHOD_CODE | ||
); | ||
|
||
return [ | ||
'payment' => [ | ||
'buckaroo' => [ | ||
'blik' => [ | ||
'paymentFeeLabel' => $paymentFeeLabel, | ||
'subtext' => $this->getSubtext(), | ||
'subtext_style' => $this->getSubtextStyle(), | ||
'subtext_color' => $this->getSubtextColor(), | ||
'allowedCurrencies' => $this->getAllowedCurrencies(), | ||
], | ||
], | ||
], | ||
]; | ||
} | ||
|
||
/** | ||
* @param null|int $storeId | ||
* | ||
* @return float | ||
*/ | ||
public function getPaymentFee($storeId = null) | ||
{ | ||
$paymentFee = $this->scopeConfig->getValue( | ||
self::XPATH_BLIK_PAYMENT_FEE, | ||
\Magento\Store\Model\ScopeInterface::SCOPE_STORE, | ||
$storeId | ||
); | ||
|
||
return $paymentFee ? $paymentFee : false; | ||
} | ||
} |
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,103 @@ | ||
<?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\Magento2\Model\Method; | ||
|
||
class Blik extends AbstractMethod | ||
{ | ||
/** | ||
* Payment Code | ||
*/ | ||
const PAYMENT_METHOD_CODE = 'buckaroo_magento2_blik'; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $buckarooPaymentMethodCode = 'blik'; | ||
|
||
/** | ||
* Payment method code | ||
* | ||
* @var string | ||
*/ | ||
protected $_code = self::PAYMENT_METHOD_CODE; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getOrderTransactionBuilder($payment) | ||
{ | ||
$transactionBuilder = $this->transactionBuilderFactory->get('order'); | ||
|
||
$services = [ | ||
'Name' => 'blik', | ||
'Action' => 'Pay', | ||
'Version' => 0, | ||
]; | ||
|
||
/** | ||
* @noinspection PhpUndefinedMethodInspection | ||
*/ | ||
$transactionBuilder->setOrder($payment->getOrder()) | ||
->setServices($services) | ||
->setMethod('TransactionRequest'); | ||
|
||
return $transactionBuilder; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getCaptureTransactionBuilder($payment) | ||
{ | ||
return false; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getAuthorizeTransactionBuilder($payment) | ||
{ | ||
return false; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getVoidTransactionBuilder($payment) | ||
{ | ||
return true; | ||
} | ||
|
||
/** | ||
* @param \Magento\Sales\Api\Data\OrderPaymentInterface|\Magento\Payment\Model\InfoInterface $payment | ||
* | ||
* @return bool|string | ||
*/ | ||
public function getPaymentMethodName($payment) | ||
{ | ||
return 'blik'; | ||
} | ||
|
||
protected function getRefundTransactionBuilderChannel() | ||
{ | ||
return 'Web'; | ||
} | ||
} |
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.