Skip to content

Commit

Permalink
Merge pull request #9 from mercadopago/release/1.6.1
Browse files Browse the repository at this point in the history
Release 1.6.1
  • Loading branch information
luiztucillo authored Jan 19, 2024
2 parents b808a41 + 93d60b0 commit 9517d36
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ 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.1] - 2024-01-15
### Fixed
- Regular expression adjustment to accept alphanumeric in RUT type document.

## [1.6.0] - 2024-01-03
### Added
- Added plugin version + site id information on admin
Expand Down
16 changes: 8 additions & 8 deletions Gateway/Request/AdditionalInfoPayerDataRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,10 @@ public function build(array $buildSubject): array
);

$typeDocument = $payment->getAdditionalInformation('payer_document_type');

$docIdentification = $this->documentIdentification->getFiscalNumber($payment, $orderAdapter);
if ($docIdentification) {
$docIdentification = preg_replace('/[^0-9]/', '', $docIdentification);
$docIdentification = preg_replace('/[^0-9A-Za-z]/', '', $docIdentification);
}

$billingAddress = $orderAdapter->getBillingAddress();
Expand All @@ -262,12 +262,12 @@ public function build(array $buildSubject): array
if ($customerId) {
// Load customer model by customer ID
$customer = $this->customerFactory->create()->load($customerId);

$registrationDate = $customer->getCreatedAt();

// Get last order of the customer
$lastOrder = $customer->getLastOrder();

if ($lastOrder) {
// Get last order's creation date
$lastPurchaseDate = $lastOrder->getCreatedAt();
Expand Down Expand Up @@ -295,8 +295,8 @@ public function build(array $buildSubject): array
self::LAST_NAME => $payerLastName,
self::REGISTRATION_DATE => $registrationDate,
self::REGISTERED_USER => $customerId ? true : false,
self::DEVICE_ID => null,
self::PLATFORM_EMAIL => $platform_email,
self::DEVICE_ID => null,
self::PLATFORM_EMAIL => $platform_email,
self::REGISTER_UPDATED_AT => null,
self::USER_EMAIL => $user_email,
self::AUTHENTICATION_TYPE => null,
Expand Down Expand Up @@ -328,8 +328,8 @@ public function build(array $buildSubject): array
];

$result[AdditionalInfoDataRequest::ADDITIONAL_INFO][self::PAYER][self::MOBILE] = [
self::PHONE_AREA_CODE => $phoneAreaCode,
self::PHONE_NUMBER => $phoneNumber,
self::PHONE_AREA_CODE => $phoneAreaCode,
self::PHONE_NUMBER => $phoneNumber,
];

$result[AdditionalInfoDataRequest::ADDITIONAL_INFO][self::PAYER][self::IDENTIFICATION] = [
Expand Down
2 changes: 1 addition & 1 deletion Gateway/Request/DocumentIdentificationDataRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function build(array $buildSubject)
$docIdentification = $this->getFiscalNumber($payment, $orderAdapter);

if ($docIdentification) {
$docIdentification = preg_replace('/[^0-9]/', '', $docIdentification);
$docIdentification = preg_replace('/[^0-9A-Za-z]/', '', $docIdentification);
}

if ($typeDocument) {
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.0",
"version": "1.6.1",
"require": {
"php": "~7.3.0||~7.4.0||~8.1.0||~8.2.0",
"ext-json": "*",
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="MercadoPago_AdbPayment" setup_version="1.6.0">
<module name="MercadoPago_AdbPayment" setup_version="1.6.1">
<sequence>
<module name="Magento_Customer"/>
<module name="Magento_Payment"/>
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/web/js/view/payment/mp-sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ define([
}

if (self.mpPayerDocument()) {
self.mpPayerDocument(self.mpPayerDocument().replace(/\D/g, ''));
self.mpPayerDocument(self.mpPayerDocument().replace(/\W/g, ''));
}

fullScreenLoader.startLoader();
Expand Down

0 comments on commit 9517d36

Please sign in to comment.