Skip to content

Commit

Permalink
Merge pull request #11 from mercadopago/release/1.6.2
Browse files Browse the repository at this point in the history
Release 1.6.2
  • Loading branch information
dmsantosd authored Jan 29, 2024
2 parents 9517d36 + 62e8d95 commit ec27fff
Show file tree
Hide file tree
Showing 14 changed files with 384 additions and 257 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ 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.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.6.2] - 2024-01-29
### Changed
- Get document types from payment methods to PSE.

### Fixed
- Translate fix.

## [1.6.1] - 2024-01-15
### Fixed
- Regular expression adjustment to accept alphanumeric in RUT type document.
Expand Down
30 changes: 30 additions & 0 deletions Gateway/Config/ConfigPse.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ class ConfigPse extends PaymentConfig
*/
public const PAYER_ENTITY_TYPES = 'payer_entity_types';

/**
* Allowed Identification Types
*/
public const ALLOWED_IDENTIFICATION_TYPES = 'allowed_identification_types';

/**
* @var ScopeConfigInterface
*/
Expand Down Expand Up @@ -299,4 +304,29 @@ public function getFingerPrintLink($storeId = null): string

return $this->fingerprint->getFingerPrintLink($mpSiteId);
}

/**
* Get List Document Types.
*
* @param int|null $storeId
*
* @return array
*/
public function getListDocumentTypes($storeId = null): array
{
$documentTypes = [];
$mpSiteId = $this->configBase->getMpSiteId($storeId);

if ($mpSiteId === 'MCO') {
$payments = $this->configBase->getMpPaymentMethods($storeId);

foreach ($payments['response'] as $payment) {
if ($payment['id'] === self::PAYMENT_METHOD_ID) {
$documentTypes = $payment[self::ALLOWED_IDENTIFICATION_TYPES];
}
}
}

return $documentTypes;
}
}
1 change: 1 addition & 0 deletions Model/Ui/ConfigProviderPse.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public function getConfig()
'logo' => $this->getLogo(),
'payment_method_id' => ConfigPse::PAYMENT_METHOD_ID,
'finance_inst_options' => $this->config->getListFinancialInstitution($storeId),
'document_types' => $this->config->getListDocumentTypes($storeId),
'payer_entity_types' => $this->config->getListPayerEntityTypes($storeId),
'fingerprint' => $this->config->getFingerPrintLink($storeId)
],
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mercadopago/adb-payment",
"description": "MercadoPago - Payment for Adobe Commerce",
"version": "1.6.1",
"version": "1.6.2",
"require": {
"php": "~7.3.0||~7.4.0||~8.1.0||~8.2.0",
"ext-json": "*",
Expand Down
Loading

0 comments on commit ec27fff

Please sign in to comment.