Skip to content

Commit eae8a18

Browse files
Merge pull request #82 from hugofintecture/3.2.0
3.2.0
2 parents 1c5792d + 45a7de5 commit eae8a18

File tree

26 files changed

+191
-92
lines changed

26 files changed

+191
-92
lines changed

Block/System/Config/Button.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function getButtonHtml(): string
5353
$button = $this->getLayout()->createBlock(WidgetButton::class);
5454
$button->setData([
5555
'id' => 'connection-test',
56-
'label' => __('Test Connection'),
56+
'label' => __('Test connection'),
5757
]);
5858

5959
return $button->toHtml();

Controller/Adminhtml/Settings/ConnectionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function execute()
8282
throw new LocalizedException(__('Some fields are empty'));
8383
}
8484

85-
// Handle already saved app secret
85+
// Handle already saved APP secret
8686
if ($jsParams['appSecret'] === '******') {
8787
$jsParams['appSecret'] = $this->config->getAppSecret($jsParams['environment'], $scopeId);
8888
}

Gateway/Config/BnplConfig.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@ class BnplConfig extends BaseConfig
99
const CODE = 'fintecture_bnpl';
1010

1111
const KEY_ACTIVE = 'active';
12+
const KEY_RECOMMEND_BNPL_BADGE = 'recommend_bnpl_badge';
1213

1314
public function isActive(): bool
1415
{
1516
return (bool) $this->getValue(self::KEY_ACTIVE);
1617
}
18+
19+
public function isRecommendedBnplBadgeActive(): bool
20+
{
21+
return (bool) $this->getValue(self::KEY_RECOMMEND_BNPL_BADGE);
22+
}
1723
}

Gateway/Config/Config.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class Config extends BaseConfig
88
{
99
const CODE = 'fintecture';
10-
const VERSION = '3.1.0';
10+
const VERSION = '3.2.0';
1111

1212
const KEY_SHOP_NAME = 'general/store_information/name';
1313
const KEY_ACTIVE = 'active';
@@ -30,6 +30,7 @@ class Config extends BaseConfig
3030
const KEY_CHECKOUT_DESIGN_SELECTION = 'checkout_design_selection';
3131
const KEY_CUSTOM_RECONCILIATION_FIELD_ACTIVE = 'custom_reconciliation_field_active';
3232
const KEY_CUSTOM_RECONCILIATION_FIELD = 'custom_reconciliation_field';
33+
const KEY_RECOMMEND_IT_BADGE = 'recommend_it_badge';
3334

3435
public function getShopName(): ?string
3536
{
@@ -153,6 +154,11 @@ public function getCustomReconciliationField(): ?string
153154
return $this->getValue(self::KEY_CUSTOM_RECONCILIATION_FIELD);
154155
}
155156

157+
public function isRecommendedItBadgeActive(): bool
158+
{
159+
return (bool) $this->getValue(self::KEY_RECOMMEND_IT_BADGE);
160+
}
161+
156162
public function getNewOrderStatus(): string
157163
{
158164
$status = $this->getValue('payment/fintecture/new_order_status');

Helper/Stats.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Fintecture\Payment\Helper;
66

7+
use Fintecture\Payment\Gateway\Config\BnplConfig;
78
use Fintecture\Payment\Gateway\Config\Config;
89
use Fintecture\Payment\Logger\Logger as FintectureLogger;
910
use Fintecture\Payment\Model\Environment;
@@ -17,6 +18,9 @@ class Stats
1718
/** @var Config */
1819
protected $config;
1920

21+
/** @var BnplConfig */
22+
protected $bnplConfig;
23+
2024
/** @var FintectureLogger */
2125
protected $fintectureLogger;
2226

@@ -34,13 +38,15 @@ class Stats
3438

3539
public function __construct(
3640
Config $config,
41+
BnplConfig $bnplConfig,
3742
FintectureLogger $fintectureLogger,
3843
ResourceConnection $resourceConnection,
3944
ProductMetadataInterface $productMetadata,
4045
PaymentConfig $paymentConfig,
4146
StoreManagerInterface $storeManager
4247
) {
4348
$this->config = $config;
49+
$this->bnplConfig = $bnplConfig;
4450
$this->fintectureLogger = $fintectureLogger;
4551
$this->resourceConnection = $resourceConnection;
4652
$this->productMetadata = $productMetadata;
@@ -99,6 +105,8 @@ public function getConfigurationSummary(): array
99105
'module_production_app_id' => $this->config->getAppId(Environment::ENVIRONMENT_PRODUCTION),
100106
'module_branding' => $this->config->isShowLogo(),
101107
'module_checkout_design' => $this->config->getCheckoutDesign(),
108+
'module_recommended_it' => $this->config->isRecommendedItBadgeActive(),
109+
'module_recommended_bnpl' => $this->bnplConfig->isRecommendedBnplBadgeActive(),
102110
];
103111
}
104112
}
File renamed without changes.

Model/Config/File/PemFile.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ protected function _getDeleteCheckbox()
1111
$value = $this->getValue();
1212
if ($value) {
1313
if (substr_compare($value, '.pem', -strlen('.pem')) === 0) {
14-
return '<div><br>' . __('Please re-upload Private Key file') . '</div>';
14+
return '<div><br>' . __('Please re-upload private key file') . '</div>';
1515
} else {
16-
return '<div><br>' . __('Private Key file already saved') . '</div>';
16+
return '<div><br>' . __('Private key file already saved') . '</div>';
1717
}
1818
} else {
19-
return '<div><br>' . __('Please upload Private Key file') . '</div>';
19+
return '<div><br>' . __('Please upload private key file') . '</div>';
2020
}
2121
}
2222
}

Model/Config/Options/CheckoutDesignSelectionOptions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ public function toOptionArray()
99
return [
1010
['value' => 'it', 'label' => __('Immediate Transfer')],
1111
['value' => 'ist', 'label' => __('Immediate Transfer & Smart Transfer')],
12-
['value' => 'ist_long', 'label' => __('Long Version')],
13-
['value' => 'ist_short', 'label' => __('Short Version')],
12+
['value' => 'ist_long', 'label' => __('Long version')],
13+
['value' => 'ist_short', 'label' => __('Short version')],
1414
];
1515
}
1616
}

Model/Ui/BnplConfigProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function getConfig()
3737
'active' => $this->gatewayConfig->isActive(),
3838
'todayDate' => $this->beautifulDate->formatDatetime($today),
3939
'laterDate' => $this->beautifulDate->formatDatetime($later),
40+
'recommendBnplBadge' => $this->gatewayConfig->isRecommendedBnplBadgeActive(),
4041
],
4142
],
4243
];

Model/Ui/ConfigProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function getConfig()
2424
Config::CODE => [
2525
'active' => $this->gatewayConfig->isActive(),
2626
'checkoutDesign' => $this->gatewayConfig->getCheckoutDesign(),
27+
'recommendItBadge' => $this->gatewayConfig->isRecommendedItBadgeActive(),
2728
],
2829
],
2930
];

0 commit comments

Comments
 (0)