Skip to content

Commit 43e8494

Browse files
committed
v1.6.3
1 parent ec27fff commit 43e8494

File tree

12 files changed

+232
-153
lines changed

12 files changed

+232
-153
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ 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.3] - 2024-03-07
9+
### Changed
10+
- Adjusting Iframe creation with 3Ds.
11+
- PSJ/PCJ adequacy in online payment.
12+
- Adding the checkout_type of type two_cards to the metadata
13+
14+
### Fixed
15+
- Adding a translation fix in FetchPaymentHandler
16+
817
## [1.6.2] - 2024-01-29
918
### Changed
1019
- Get document types from payment methods to PSE.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
/**
3+
* Copyright © MercadoPago. All rights reserved.
4+
*
5+
* @author Mercado Pago
6+
* @license See LICENSE for license details.
7+
*/
8+
9+
namespace MercadoPago\AdbPayment\Gateway\Request;
10+
11+
use InvalidArgumentException;
12+
use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
13+
use Magento\Payment\Gateway\Request\BuilderInterface;
14+
15+
/**
16+
* Gateway requests for Payment Metadata by Two Cards.
17+
*/
18+
class MetadataTwoCcPaymentDataRequest implements BuilderInterface
19+
{
20+
/**
21+
* Checkout block name.
22+
*/
23+
public const CHECKOUT = 'checkout';
24+
25+
/**
26+
* Checkout Type block name.
27+
*/
28+
public const CHECKOUT_TYPE = 'checkout_type';
29+
30+
/**
31+
* Build.
32+
*
33+
* @param array $buildSubject
34+
*/
35+
public function build(array $buildSubject)
36+
{
37+
if (!isset($buildSubject['payment'])
38+
|| !$buildSubject['payment'] instanceof PaymentDataObjectInterface
39+
) {
40+
throw new InvalidArgumentException('Payment data object should be provided');
41+
}
42+
$result = [];
43+
44+
$result[MetadataPaymentDataRequest::METADATA] = [
45+
self::CHECKOUT => 'custom',
46+
self::CHECKOUT_TYPE => 'two_cards',
47+
];
48+
49+
$result[MetadataPaymentDataRequest::METADATA][MetadataPaymentDataRequest::CPP_EXTRA] = [
50+
self::CHECKOUT => 'custom',
51+
self::CHECKOUT_TYPE => 'two_cards',
52+
];
53+
54+
return $result;
55+
}
56+
}

Gateway/Response/FetchPaymentHandler.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class FetchPaymentHandler implements HandlerInterface
9292
* Response Pay Status Refunded - Value.
9393
*/
9494
public const RESPONSE_STATUS_REFUNDED = 'refunded';
95-
95+
9696
/**
9797
* Response Pay Status Cancelled - Value.
9898
*/
@@ -112,7 +112,7 @@ class FetchPaymentHandler implements HandlerInterface
112112
* Response Payment Details - Value.
113113
*/
114114
public const PAYMENT_DETAILS = 'payments_details';
115-
115+
116116
/**
117117
* Response Total Amount - Value.
118118
*/
@@ -147,7 +147,7 @@ class FetchPaymentHandler implements HandlerInterface
147147
* Payment Installments - Payment Addtional Information.
148148
*/
149149
public const PAYMENT_INSTALLMENTS = 'payment_%_installments';
150-
150+
151151
/**
152152
* Payment Total Amount - Payment Addtional Information.
153153
*/
@@ -280,7 +280,7 @@ private function createInvoice($order, $payment, $paidAmount)
280280
$invoice->setSubtotal($paidAmount);
281281
$invoice->setBaseSubtotal($paidAmount);
282282

283-
$invoice->addComment(_('Captured by collector from Mercado Pago API'));
283+
$invoice->addComment(__('Captured by collector from Mercado Pago API'));
284284

285285
$order->addRelatedObject($invoice);
286286
$payment->setCreatedInvoice($invoice);
@@ -291,13 +291,13 @@ private function createInvoice($order, $payment, $paidAmount)
291291
* Get index of payment by payment id.
292292
* @param $payment
293293
* @param $paymentId
294-
*
294+
*
295295
* @return int|null
296296
*/
297297
public function getIndexPayment(
298298
$payment,
299299
$paymentId
300-
) {
300+
) {
301301
$i = 0;
302302
while ($i < 2) {
303303
if($payment->getAdditionalInformation(str_replace('%', $i, self::PAYMENT_ID)) == $paymentId){
@@ -313,7 +313,7 @@ public function getIndexPayment(
313313
* @param $payment
314314
* @param $index
315315
* @param $mpPayment
316-
*
316+
*
317317
* Return void.
318318
*/
319319
public function updatePaymentByIndex(
@@ -346,7 +346,7 @@ public function updatePaymentByIndex(
346346
$cardTotalAmount,
347347
$mpPayment[self::TOTAL_AMOUNT]
348348
);
349-
349+
350350
$payment->setAdditionalInformation(
351351
$cardPaidAmount,
352352
$mpPayment[self::PAID_AMOUNT]

bin/install-mg2.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mv magento2-2.4.5-p1 magento2
1010
cd magento2
1111

1212
echo "Installing..."
13-
composer require mp-plugins/php-sdk
13+
composer require mp-plugins/php-sdk:1.12.0
1414
composer update
1515
composer install
1616

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "mercadopago/adb-payment",
33
"description": "MercadoPago - Payment for Adobe Commerce",
4-
"version": "1.6.2",
4+
"version": "1.6.3",
55
"require": {
66
"php": "~7.3.0||~7.4.0||~8.1.0||~8.2.0",
77
"ext-json": "*",
88
"ext-gd": "*",
99
"ext-zip": "*",
10-
"mp-plugins/php-sdk": "~1.7"
10+
"mp-plugins/php-sdk": "1.12.*"
1111
},
1212
"type": "magento2-module",
1313
"authors": [

0 commit comments

Comments
 (0)