Skip to content

Commit

Permalink
Merge pull request #17 from mercadopago/release/1.8.2
Browse files Browse the repository at this point in the history
V1.8.2
  • Loading branch information
ext-leacastr authored May 27, 2024
2 parents 898d643 + 28c5a22 commit 2da109a
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 94 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.8.2] - 2024-05-27
### Fixed
- Fixed intermittent error when saving payment details

## [1.8.1] - 2024-04-25
### Fixed
- Fix added existing value validation for the financial_institution field
Expand Down
8 changes: 4 additions & 4 deletions Model/Api/CreateVaultManagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,19 @@ public function createVault(
if ($createUser[self::RESULT_CODE] === 0) {
unset($token);
$mpUserId = $this->findUser($storeId, $quote);
$mpCustomerId = $mpUserId[self::USER_ID];
$mpCustomerId = isset($mpUserId[self::USER_ID]) ? $mpUserId[self::USER_ID] : "";
}

if ($createUser[self::RESULT_CODE] === 1) {
unset($token);
unset($vaultData['identificationNumber']);
$mpCustomerId = $createUser[self::USER_ID];
$mpCustomerId = isset($createUser[self::USER_ID]) ? $createUser[self::USER_ID] : "";
}

$saveCcNumber = $this->saveCcNumber($storeId, $mpCustomerId, $vaultData);
$token['tokenize'] = [
self::USER_ID => $mpCustomerId,
self::CARD_ID => $saveCcNumber[self::CARD_ID],
self::CARD_ID => isset($saveCcNumber[self::CARD_ID]) ? $saveCcNumber[self::CARD_ID] : "",
];

return $token;
Expand All @@ -159,7 +159,7 @@ public function createUser($storeId, $quote, $vaultData): array
'last_name' => $quote->getCustomerLastName(),
'identification' => [
'type' => $vaultData['identificationType'],
'number' => $vaultData['identificationNumber'],
'number' => isset($vaultData['identificationNumber']) ? $vaultData['identificationNumber'] : "",
],
];

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.8.1",
"version": "1.8.2",
"require": {
"php": "~7.3.0||~7.4.0||~8.1.0||~8.2.0||~8.3.0",
"ext-json": "*",
Expand Down
Loading

0 comments on commit 2da109a

Please sign in to comment.