Skip to content
Open

3.6.0 #100

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ composer.lock
.php-cs-fixer.cache
.phpunit.cache/*
.phpunit.result.cache
.phpunit.xml.bak
.phpunit.xml.bak
fintecture/*
virementmaitrise/*
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.

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

## [3.6.0] - 2025-11-24

- Fix a typo on a Fintecture URL
- Internal fixes

## [3.5.5] - 2025-02-24

- Add `RequestToPay` webhook type in whitelist
Expand Down
2 changes: 1 addition & 1 deletion Controller/WebhookAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ abstract class WebhookAbstract implements CsrfAwareActionInterface
'Refund',
'BuyNowPayLater',
'ManualTransfer',
'RequestToPay'
'RequestToPay',
];

public function __construct(
Expand Down
6 changes: 3 additions & 3 deletions Gateway/Config/BnplConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

class BnplConfig extends BaseConfig
{
const CODE = 'fintecture_bnpl';
public const CODE = 'fintecture_bnpl';

const KEY_ACTIVE = 'active';
const KEY_RECOMMEND_BNPL_BADGE = 'recommend_bnpl_badge';
public const KEY_ACTIVE = 'active';
public const KEY_RECOMMEND_BNPL_BADGE = 'recommend_bnpl_badge';

public function isActive(): bool
{
Expand Down
52 changes: 26 additions & 26 deletions Gateway/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@

class Config extends BaseConfig
{
const CODE = 'fintecture';
const VERSION = '3.5.5';

const KEY_SHOP_NAME = 'general/store_information/name';
const KEY_ACTIVE = 'active';
const KEY_ALLOW_SPECIFIC = 'allowspecific';
const KEY_SPECIFIC_COUNTRY = 'specificcountry';
const KEY_ENVIRONMENT = 'environment';
const KEY_APP_ID_SANDBOX = 'fintecture_app_id_sandbox';
const KEY_APP_ID_PRODUCTION = 'fintecture_app_id_production';
const KEY_APP_SECRET_SANDBOX = 'fintecture_app_secret_sandbox';
const KEY_APP_SECRET_PRODUCTION = 'fintecture_app_secret_production';
const KEY_PRIVATE_KEY_SANDBOX = 'custom_file_upload_sandbox';
const KEY_PRIVATE_KEY_PRODUCTION = 'custom_file_upload_production';
const KEY_REFUND_STATUSES_ACTIVE = 'refund_statuses_active';
const KEY_EXPIRATION_ACTIVE = 'expiration_active';
const KEY_EXPIRATION_AFTER = 'expiration_after';
const KEY_INVOICING_ACTIVE = 'invoicing_active';
const KEY_ALTERNATIVE_METHOD_ACTIVE = 'alternative_method_active';
const KEY_ALTERNATIVE_METHOD = 'alternative_method';
const KEY_CHECKOUT_DESIGN_SELECTION = 'checkout_design_selection';
const KEY_CUSTOM_RECONCILIATION_FIELD_ACTIVE = 'custom_reconciliation_field_active';
const KEY_CUSTOM_RECONCILIATION_FIELD = 'custom_reconciliation_field';
const KEY_RECOMMEND_IT_BADGE = 'recommend_it_badge';
const KEY_FIRST_POSITION_ACTIVE = 'first_position_active';
const KEY_FIRST_POSITION_AMOUNT = 'first_position_amount';
public const CODE = 'fintecture';
public const VERSION = '3.6.0';

public const KEY_SHOP_NAME = 'general/store_information/name';
public const KEY_ACTIVE = 'active';
public const KEY_ALLOW_SPECIFIC = 'allowspecific';
public const KEY_SPECIFIC_COUNTRY = 'specificcountry';
public const KEY_ENVIRONMENT = 'environment';
public const KEY_APP_ID_SANDBOX = 'fintecture_app_id_sandbox';
public const KEY_APP_ID_PRODUCTION = 'fintecture_app_id_production';
public const KEY_APP_SECRET_SANDBOX = 'fintecture_app_secret_sandbox';
public const KEY_APP_SECRET_PRODUCTION = 'fintecture_app_secret_production';
public const KEY_PRIVATE_KEY_SANDBOX = 'custom_file_upload_sandbox';
public const KEY_PRIVATE_KEY_PRODUCTION = 'custom_file_upload_production';
public const KEY_REFUND_STATUSES_ACTIVE = 'refund_statuses_active';
public const KEY_EXPIRATION_ACTIVE = 'expiration_active';
public const KEY_EXPIRATION_AFTER = 'expiration_after';
public const KEY_INVOICING_ACTIVE = 'invoicing_active';
public const KEY_ALTERNATIVE_METHOD_ACTIVE = 'alternative_method_active';
public const KEY_ALTERNATIVE_METHOD = 'alternative_method';
public const KEY_CHECKOUT_DESIGN_SELECTION = 'checkout_design_selection';
public const KEY_CUSTOM_RECONCILIATION_FIELD_ACTIVE = 'custom_reconciliation_field_active';
public const KEY_CUSTOM_RECONCILIATION_FIELD = 'custom_reconciliation_field';
public const KEY_RECOMMEND_IT_BADGE = 'recommend_it_badge';
public const KEY_FIRST_POSITION_ACTIVE = 'first_position_active';
public const KEY_FIRST_POSITION_AMOUNT = 'first_position_amount';

public function getShopName(): ?string
{
Expand Down
46 changes: 29 additions & 17 deletions Gateway/Http/Sdk.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,32 +85,44 @@ public function validateConfigValue(): bool
*/
public function getPaymentMethods()
{
if (!$this->isPisClientInstantiated()) {
$this->fintectureLogger->warning('SDK not initialized; skip payment methods');

return false;
}

$hasPaymentMethodsInCache = $this->operateCustomCache->get('payment_methods');
if (!is_null($hasPaymentMethodsInCache)) {
return $hasPaymentMethodsInCache;
}

$pisToken = $this->pisClient->token->generate();
if (!$pisToken->error) {
$this->pisClient->setAccessToken($pisToken); // set token of PIS client
} else {
throw new \Exception($pisToken->errorMsg);
}
try {
$pisToken = $this->pisClient->token->generate();
if (!$pisToken->error) {
$this->pisClient->setAccessToken($pisToken); // set token of PIS client
} else {
throw new \Exception($pisToken->errorMsg);
}

$apiResponse = $this->pisClient->application->get(['with_payment_methods' => true]);
if (!$apiResponse->error) {
$paymentMethods = [];
if (isset($apiResponse->result->data->attributes->payment_methods)) {
foreach ($apiResponse->result->data->attributes->payment_methods as $paymentMethod) {
$paymentMethods[] = $paymentMethod->id;
}
$apiResponse = $this->pisClient->application->get(['with_payment_methods' => true]);
if (!$apiResponse->error) {
$paymentMethods = [];
if (isset($apiResponse->result->data->attributes->payment_methods)) {
foreach ($apiResponse->result->data->attributes->payment_methods as $paymentMethod) {
$paymentMethods[] = $paymentMethod->id;
}

$this->operateCustomCache->save('payment_methods', $paymentMethods, 600);
$this->operateCustomCache->save('payment_methods', $paymentMethods, 600);

return $paymentMethods;
return $paymentMethods;
}
}
}

return false;
return false;
} catch (\Exception $e) {
$this->fintectureLogger->error('getPaymentMethods exception', ['exception' => $e]);

return false;
}
}
}
4 changes: 2 additions & 2 deletions Model/AlternativeMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

class AlternativeMethod implements OptionSourceInterface
{
const ALTERNATIVE_METHOD_QRCODE = 'qrcode';
const ALTERNATIVE_METHOD_SEND = 'send';
public const ALTERNATIVE_METHOD_QRCODE = 'qrcode';
public const ALTERNATIVE_METHOD_SEND = 'send';

public function toOptionArray(): array
{
Expand Down
4 changes: 2 additions & 2 deletions Model/Cache/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

class Type extends \Magento\Framework\Cache\Frontend\Decorator\TagScope
{
const TYPE_IDENTIFIER = 'fintecture_cache';
const CACHE_TAG = 'FINTECTURE_CACHE';
public const TYPE_IDENTIFIER = 'fintecture_cache';
public const CACHE_TAG = 'FINTECTURE_CACHE';

/**
* @param \Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Fintecture Payment module for Magento 2.4 & 2.3
# Fintecture module for Magento 2.4 & 2.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)

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

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

Expand Down
2 changes: 1 addition & 1 deletion Setup/Patch/Data/RemoveFintectureBankTypeConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ public function getAliases()

public static function getVersion(): string
{
return '3.5.5';
return '3.6.0';
}
}
111 changes: 57 additions & 54 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,61 @@
{
"name": "fintecture/payment",
"description": "Fintecture Payment",
"keywords": ["payment","bank"],
"homepage": "https://github.com/Fintecture/magento",
"support": {
"email": "contact@fintecture.com"
},
"type": "magento2-module",
"version": "3.5.5",
"license": [
"GPL-3.0"
],
"require": {
"php": ">=7.2",
"ext-json": "*",
"ext-openssl": "*",
"magento/framework": ">=100",
"magento/module-developer": ">=100",
"magento/module-payment": ">=100",
"magento/module-checkout": ">=100",
"magento/module-sales": ">=100",
"fintecture/fintecture-sdk-php": "^2.3",
"symfony/http-client": "*",
"nyholm/psr7": "*"
},
"require-dev": {
"phpstan/phpstan": "^1",
"bitexpert/phpstan-magento": "^0.30.0",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/extension-installer": "^1.1",
"phpunit/phpunit": "*"
},
"suggest": {
"chillerlan/php-qrcode": "QR Code library for payment with \"Login as Customer\" feature enabled"
},
"repositories": [
{
"type": "composer",
"url": "https://repo.magento.com/"
}
"name": "fintecture/payment",
"description": "Fintecture Payer par Banque (Pay by Bank) enables users to pay securely and directly from their bank account.",
"keywords": [
"payment",
"bank"
],
"homepage": "https://github.com/Fintecture/magento",
"support": {
"email": "contact@fintecture.com"
},
"type": "magento2-module",
"version": "3.6.0",
"license": [
"GPL-3.0"
],
"require": {
"php": ">=7.2",
"ext-json": "*",
"ext-openssl": "*",
"magento/framework": "^102.0 || ^103.0",
"magento/module-developer": ">=100",
"magento/module-payment": ">=100",
"magento/module-checkout": ">=100",
"magento/module-sales": ">=100",
"symfony/http-client": "*",
"nyholm/psr7": "*",
"fintecture/fintecture-sdk-php": "^2.3"
},
"require-dev": {
"phpstan/phpstan": "^1",
"bitexpert/phpstan-magento": "^0.30.0",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/extension-installer": "^1.1",
"phpunit/phpunit": "*"
},
"suggest": {
"chillerlan/php-qrcode": "QR Code library for payment with \"Login as Customer\" feature enabled"
},
"repositories": [
{
"type": "composer",
"url": "https://repo.magento.com/"
}
],
"autoload": {
"files": [
"registration.php"
],
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Fintecture\\Payment\\": "."
}
},
"config": {
"allow-plugins": {
"magento/composer-dependency-version-audit-plugin": true,
"phpstan/extension-installer": true,
"php-http/discovery": true
}
"psr-4": {
"Fintecture\\Payment\\": "."
}
},
"config": {
"allow-plugins": {
"magento/composer-dependency-version-audit-plugin": true,
"phpstan/extension-installer": true,
"php-http/discovery": true
}
}
}
Loading