Skip to content

Commit ec27fff

Browse files
authored
Merge pull request #11 from mercadopago/release/1.6.2
Release 1.6.2
2 parents 9517d36 + 62e8d95 commit ec27fff

File tree

14 files changed

+384
-257
lines changed

14 files changed

+384
-257
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.6.2] - 2024-01-29
9+
### Changed
10+
- Get document types from payment methods to PSE.
11+
12+
### Fixed
13+
- Translate fix.
14+
815
## [1.6.1] - 2024-01-15
916
### Fixed
1017
- Regular expression adjustment to accept alphanumeric in RUT type document.

Gateway/Config/ConfigPse.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ class ConfigPse extends PaymentConfig
6161
*/
6262
public const PAYER_ENTITY_TYPES = 'payer_entity_types';
6363

64+
/**
65+
* Allowed Identification Types
66+
*/
67+
public const ALLOWED_IDENTIFICATION_TYPES = 'allowed_identification_types';
68+
6469
/**
6570
* @var ScopeConfigInterface
6671
*/
@@ -299,4 +304,29 @@ public function getFingerPrintLink($storeId = null): string
299304

300305
return $this->fingerprint->getFingerPrintLink($mpSiteId);
301306
}
307+
308+
/**
309+
* Get List Document Types.
310+
*
311+
* @param int|null $storeId
312+
*
313+
* @return array
314+
*/
315+
public function getListDocumentTypes($storeId = null): array
316+
{
317+
$documentTypes = [];
318+
$mpSiteId = $this->configBase->getMpSiteId($storeId);
319+
320+
if ($mpSiteId === 'MCO') {
321+
$payments = $this->configBase->getMpPaymentMethods($storeId);
322+
323+
foreach ($payments['response'] as $payment) {
324+
if ($payment['id'] === self::PAYMENT_METHOD_ID) {
325+
$documentTypes = $payment[self::ALLOWED_IDENTIFICATION_TYPES];
326+
}
327+
}
328+
}
329+
330+
return $documentTypes;
331+
}
302332
}

Model/Ui/ConfigProviderPse.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ public function getConfig()
9797
'logo' => $this->getLogo(),
9898
'payment_method_id' => ConfigPse::PAYMENT_METHOD_ID,
9999
'finance_inst_options' => $this->config->getListFinancialInstitution($storeId),
100+
'document_types' => $this->config->getListDocumentTypes($storeId),
100101
'payer_entity_types' => $this->config->getListPayerEntityTypes($storeId),
101102
'fingerprint' => $this->config->getFingerPrintLink($storeId)
102103
],

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mercadopago/adb-payment",
33
"description": "MercadoPago - Payment for Adobe Commerce",
4-
"version": "1.6.1",
4+
"version": "1.6.2",
55
"require": {
66
"php": "~7.3.0||~7.4.0||~8.1.0||~8.2.0",
77
"ext-json": "*",

0 commit comments

Comments
 (0)