Skip to content

Commit 1489979

Browse files
3.6.0
1 parent 85c7559 commit 1489979

File tree

20 files changed

+151
-236
lines changed

20 files changed

+151
-236
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ composer.lock
44
.php-cs-fixer.cache
55
.phpunit.cache/*
66
.phpunit.result.cache
7-
.phpunit.xml.bak
7+
.phpunit.xml.bak
8+
fintecture/*
9+
virementmaitrise/*

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

7+
## [3.6.0] - 2025-11-24
8+
9+
- Fix a typo on a Fintecture URL
10+
- Internal fixes
11+
712
## [3.5.5] - 2025-02-24
813

914
- Add `RequestToPay` webhook type in whitelist

Controller/WebhookAbstract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ abstract class WebhookAbstract implements CsrfAwareActionInterface
5252
'Refund',
5353
'BuyNowPayLater',
5454
'ManualTransfer',
55-
'RequestToPay'
55+
'RequestToPay',
5656
];
5757

5858
public function __construct(

Gateway/Config/BnplConfig.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
class BnplConfig extends BaseConfig
88
{
9-
const CODE = 'fintecture_bnpl';
9+
public const CODE = 'fintecture_bnpl';
1010

11-
const KEY_ACTIVE = 'active';
12-
const KEY_RECOMMEND_BNPL_BADGE = 'recommend_bnpl_badge';
11+
public const KEY_ACTIVE = 'active';
12+
public const KEY_RECOMMEND_BNPL_BADGE = 'recommend_bnpl_badge';
1313

1414
public function isActive(): bool
1515
{

Gateway/Config/Config.php

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,32 @@
66

77
class Config extends BaseConfig
88
{
9-
const CODE = 'fintecture';
10-
const VERSION = '3.5.5';
11-
12-
const KEY_SHOP_NAME = 'general/store_information/name';
13-
const KEY_ACTIVE = 'active';
14-
const KEY_ALLOW_SPECIFIC = 'allowspecific';
15-
const KEY_SPECIFIC_COUNTRY = 'specificcountry';
16-
const KEY_ENVIRONMENT = 'environment';
17-
const KEY_APP_ID_SANDBOX = 'fintecture_app_id_sandbox';
18-
const KEY_APP_ID_PRODUCTION = 'fintecture_app_id_production';
19-
const KEY_APP_SECRET_SANDBOX = 'fintecture_app_secret_sandbox';
20-
const KEY_APP_SECRET_PRODUCTION = 'fintecture_app_secret_production';
21-
const KEY_PRIVATE_KEY_SANDBOX = 'custom_file_upload_sandbox';
22-
const KEY_PRIVATE_KEY_PRODUCTION = 'custom_file_upload_production';
23-
const KEY_REFUND_STATUSES_ACTIVE = 'refund_statuses_active';
24-
const KEY_EXPIRATION_ACTIVE = 'expiration_active';
25-
const KEY_EXPIRATION_AFTER = 'expiration_after';
26-
const KEY_INVOICING_ACTIVE = 'invoicing_active';
27-
const KEY_ALTERNATIVE_METHOD_ACTIVE = 'alternative_method_active';
28-
const KEY_ALTERNATIVE_METHOD = 'alternative_method';
29-
const KEY_CHECKOUT_DESIGN_SELECTION = 'checkout_design_selection';
30-
const KEY_CUSTOM_RECONCILIATION_FIELD_ACTIVE = 'custom_reconciliation_field_active';
31-
const KEY_CUSTOM_RECONCILIATION_FIELD = 'custom_reconciliation_field';
32-
const KEY_RECOMMEND_IT_BADGE = 'recommend_it_badge';
33-
const KEY_FIRST_POSITION_ACTIVE = 'first_position_active';
34-
const KEY_FIRST_POSITION_AMOUNT = 'first_position_amount';
9+
public const CODE = 'fintecture';
10+
public const VERSION = '3.6.0';
11+
12+
public const KEY_SHOP_NAME = 'general/store_information/name';
13+
public const KEY_ACTIVE = 'active';
14+
public const KEY_ALLOW_SPECIFIC = 'allowspecific';
15+
public const KEY_SPECIFIC_COUNTRY = 'specificcountry';
16+
public const KEY_ENVIRONMENT = 'environment';
17+
public const KEY_APP_ID_SANDBOX = 'fintecture_app_id_sandbox';
18+
public const KEY_APP_ID_PRODUCTION = 'fintecture_app_id_production';
19+
public const KEY_APP_SECRET_SANDBOX = 'fintecture_app_secret_sandbox';
20+
public const KEY_APP_SECRET_PRODUCTION = 'fintecture_app_secret_production';
21+
public const KEY_PRIVATE_KEY_SANDBOX = 'custom_file_upload_sandbox';
22+
public const KEY_PRIVATE_KEY_PRODUCTION = 'custom_file_upload_production';
23+
public const KEY_REFUND_STATUSES_ACTIVE = 'refund_statuses_active';
24+
public const KEY_EXPIRATION_ACTIVE = 'expiration_active';
25+
public const KEY_EXPIRATION_AFTER = 'expiration_after';
26+
public const KEY_INVOICING_ACTIVE = 'invoicing_active';
27+
public const KEY_ALTERNATIVE_METHOD_ACTIVE = 'alternative_method_active';
28+
public const KEY_ALTERNATIVE_METHOD = 'alternative_method';
29+
public const KEY_CHECKOUT_DESIGN_SELECTION = 'checkout_design_selection';
30+
public const KEY_CUSTOM_RECONCILIATION_FIELD_ACTIVE = 'custom_reconciliation_field_active';
31+
public const KEY_CUSTOM_RECONCILIATION_FIELD = 'custom_reconciliation_field';
32+
public const KEY_RECOMMEND_IT_BADGE = 'recommend_it_badge';
33+
public const KEY_FIRST_POSITION_ACTIVE = 'first_position_active';
34+
public const KEY_FIRST_POSITION_AMOUNT = 'first_position_amount';
3535

3636
public function getShopName(): ?string
3737
{

Gateway/Http/Sdk.php

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -85,32 +85,44 @@ public function validateConfigValue(): bool
8585
*/
8686
public function getPaymentMethods()
8787
{
88+
if (!$this->isPisClientInstantiated()) {
89+
$this->fintectureLogger->warning('SDK not initialized; skip payment methods');
90+
91+
return false;
92+
}
93+
8894
$hasPaymentMethodsInCache = $this->operateCustomCache->get('payment_methods');
8995
if (!is_null($hasPaymentMethodsInCache)) {
9096
return $hasPaymentMethodsInCache;
9197
}
9298

93-
$pisToken = $this->pisClient->token->generate();
94-
if (!$pisToken->error) {
95-
$this->pisClient->setAccessToken($pisToken); // set token of PIS client
96-
} else {
97-
throw new \Exception($pisToken->errorMsg);
98-
}
99+
try {
100+
$pisToken = $this->pisClient->token->generate();
101+
if (!$pisToken->error) {
102+
$this->pisClient->setAccessToken($pisToken); // set token of PIS client
103+
} else {
104+
throw new \Exception($pisToken->errorMsg);
105+
}
99106

100-
$apiResponse = $this->pisClient->application->get(['with_payment_methods' => true]);
101-
if (!$apiResponse->error) {
102-
$paymentMethods = [];
103-
if (isset($apiResponse->result->data->attributes->payment_methods)) {
104-
foreach ($apiResponse->result->data->attributes->payment_methods as $paymentMethod) {
105-
$paymentMethods[] = $paymentMethod->id;
106-
}
107+
$apiResponse = $this->pisClient->application->get(['with_payment_methods' => true]);
108+
if (!$apiResponse->error) {
109+
$paymentMethods = [];
110+
if (isset($apiResponse->result->data->attributes->payment_methods)) {
111+
foreach ($apiResponse->result->data->attributes->payment_methods as $paymentMethod) {
112+
$paymentMethods[] = $paymentMethod->id;
113+
}
107114

108-
$this->operateCustomCache->save('payment_methods', $paymentMethods, 600);
115+
$this->operateCustomCache->save('payment_methods', $paymentMethods, 600);
109116

110-
return $paymentMethods;
117+
return $paymentMethods;
118+
}
111119
}
112-
}
113120

114-
return false;
121+
return false;
122+
} catch (\Exception $e) {
123+
$this->fintectureLogger->error('getPaymentMethods exception', ['exception' => $e]);
124+
125+
return false;
126+
}
115127
}
116128
}

Model/AlternativeMethod.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
class AlternativeMethod implements OptionSourceInterface
1010
{
11-
const ALTERNATIVE_METHOD_QRCODE = 'qrcode';
12-
const ALTERNATIVE_METHOD_SEND = 'send';
11+
public const ALTERNATIVE_METHOD_QRCODE = 'qrcode';
12+
public const ALTERNATIVE_METHOD_SEND = 'send';
1313

1414
public function toOptionArray(): array
1515
{

Model/Cache/Type.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
class Type extends \Magento\Framework\Cache\Frontend\Decorator\TagScope
88
{
9-
const TYPE_IDENTIFIER = 'fintecture_cache';
10-
const CACHE_TAG = 'FINTECTURE_CACHE';
9+
public const TYPE_IDENTIFIER = 'fintecture_cache';
10+
public const CACHE_TAG = 'FINTECTURE_CACHE';
1111

1212
/**
1313
* @param \Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Fintecture Payment module for Magento 2.4 & 2.3
1+
# Fintecture module for Magento 2.4 & 2.3
22

3-
[![Latest Stable Version](http://poser.pugx.org/fintecture/payment/v)](https://packagist.org/packages/fintecture/payment) [![Total Downloads](http://poser.pugx.org/fintecture/payment/downloads)](https://packagist.org/packages/fintecture/payment) [![Monthly Downloads](http://poser.pugx.org/fintecture/payment/d/monthly)](https://packagist.org/packages/fintecture/payment) [![License](http://poser.pugx.org/fintecture/payment/license)](https://packagist.org/packages/fintecture/payment) [![PHP Version Require](http://poser.pugx.org/fintecture/payment/require/php)](https://packagist.org/packages/fintecture/payment)
3+
[![Latest Stable Version](http://poser.pugx.org/fintecture/payment/v)](https://packagist.org/packages/fintecture/payment) [![Total Downloads](http://poser.pugx.org/fintecture/payment/downloads)](https://packagist.org/packages/fintecture/payment) [![Monthly Downloads](http://poser.pugx.org/fintecture/payment/d/monthly)](https://packagist.org/fintecture/payment/payment) [![License](http://poser.pugx.org/fintecture/payment/license)](https://packagist.org/packages/fintecture/payment) [![PHP Version Require](http://poser.pugx.org/fintecture/payment/require/php)](https://packagist.org/packages/fintecture/payment)
44

55
Fintecture is a Fintech that has a payment solution via bank transfer available at https://www.fintecture.com.
66

@@ -43,7 +43,7 @@ To enable it, you must install this dependency:
4343
Go to Stores > Configuration > Sales > Payment methods.
4444

4545
- Select environment (sandbox/production)
46-
- Fill APP ID, APP secret and private key based on the selected environment (https://console.fintecture.com/)
46+
- Fill APP ID, APP secret and private key based on the selected environment (https://console.fintecture.com)
4747
- Test your connection (if everything is ok you should have a green message)
4848
- Don't forget to enable the payment method unless it won't be displayed in the front end
4949

Setup/Patch/Data/RemoveFintectureBankTypeConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ public function getAliases()
4343

4444
public static function getVersion(): string
4545
{
46-
return '3.5.5';
46+
return '3.6.0';
4747
}
4848
}

0 commit comments

Comments
 (0)