Skip to content

Commit c12af4c

Browse files
2.5.37 (#146)
* Payment mappers refactorization and code improvements * small fix * bump up version * small fixes * small fix on total amount formating bump up version * fixed compatibility issues Other fixes and improvements * fixed compatibility issues Other fixes and improvements * Minor improvements * Minor improvements * Adyen v9 vault js mixin added for proper data collection * Adyen v9 vault js mixin added for proper data collection * Adyen v9 vault js mixin added for proper data collection * bump up version * bump up version
1 parent e4ef32b commit c12af4c

File tree

8 files changed

+48
-7
lines changed

8 files changed

+48
-7
lines changed

Model/ActionsHandler/Approve.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function __construct(
8080
public function handleApproveImmediatly($order)
8181
{
8282
try {
83-
$paymentBaseAmountAuthorized = $order->getPayment()->getBaseAmountAuthorized();
83+
$paymentBaseAmountAuthorized = $order->getPayment()->getBaseAmountAuthorized() ?? $order->getPayment()->getAmountAuthorized();
8484

8585
if (!$paymentBaseAmountAuthorized || !($paymentBaseAmountAuthorized > 0)) {
8686
return false;

Observer/OrderValidation/PaymentPlaceEnd.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,9 @@ public function handleResponse($forterDecision, $order, $forterEntity)
311311
$message->metaData->pendingOnHoldEnabled = $this->forterConfig->isPendingOnHoldEnabled();
312312
$this->forterLogger->SendLog($message);
313313
}
314+
315+
$forterEntity->setEntityType('order');
316+
$forterEntity->save();
314317
}
315318

316319
public function handleDecline($order, $forterEntity)
@@ -328,8 +331,10 @@ public function handleDecline($order, $forterEntity)
328331
if ($order->canHold()) {
329332
$order->setCanSendNewEmailFlag(false);
330333
$this->decline->holdOrder($order);
331-
$this->setMessage($order, 'decline', $forterEntity);
332334
}
335+
336+
$this->setMessage($order, 'decline', $forterEntity);
337+
333338
} elseif ($result == '2') {
334339
$order->setCanSendNewEmailFlag(false);
335340
$this->decline->markOrderPaymentReview($order);

Observer/ThirdParty/Adyen/AdyenCcDataAssignObserver.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class AdyenCcDataAssignObserver extends AbstractDataAssignObserver
1414
const CARD_BRAND = 'paymentMethod';
1515
const ADDITIONAL_DATA = 'additionalData';
1616

17+
const FORTER_STATE_DATA = 'forterData';
1718

1819
/**
1920
* Approved root level keys from additional data array
@@ -62,6 +63,7 @@ public function execute(Observer $observer)
6263
$additionalData,
6364
self::$approvedAdditionalDataKeys
6465
);
66+
$paymentInfo->unsAdditionalInformation(self::FORTER_STATE_DATA);
6567
$paymentInfo->setAdditionalInformation(self::ADDITIONAL_DATA, $additionalData);
6668
}
6769
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"license": [
1212
"proprietary"
1313
],
14-
"version": "2.5.36",
14+
"version": "2.5.37",
1515
"authors": [{
1616
"name": "Forter Dev",
1717
"email": "support@forter.com",

etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<label>Action On Decline (pre-authorization)</label>
6969
<source_model>Forter\Forter\Model\Config\Source\PreAuthDeclineOptions</source_model>
7070
<comment>
71-
On "Approve" or "Not Reviewed" we the action will be the payment gateway default
71+
On "Approve" or "Not Reviewed" the action will be the payment gateway default
7272
</comment>
7373
<depends>
7474
<field id="pre_post_select" separator=",">1,4</field>

etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
*/
88
-->
99
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
10-
<module name="Forter_Forter" setup_version="2.5.36"/>
10+
<module name="Forter_Forter" setup_version="2.5.37"/>
1111
</config>

view/base/requirejs-config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ var config = {
1111
'Forter_Forter/js/model/vault-mixin': true
1212
},
1313
'PayPal_Braintree/js/view/payment/method-renderer/cc-form': {
14-
'Forter_Forter/js/model/paypal-braintree-cc-mixin': true
15-
}
14+
'Forter_Forter/js/model/paypal-braintree-cc-mixin': true
15+
},
16+
'Adyen_Payment/js/view/payment/method-renderer/adyen-cc-vault-method': {
17+
'Forter_Forter/js/model/adyen-cc-vault-method-mixin': true
18+
},
1619
}
1720
}
1821
};
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
define([
2+
'jquery',
3+
'mage/utils/wrapper'
4+
], function ($, wrapper) {
5+
'use strict';
6+
7+
return function (target) {
8+
return target.extend({
9+
getData: function () {
10+
var data = this._super();
11+
12+
// Ensure additional_data exists
13+
if (!data.additional_data) {
14+
data.additional_data = {};
15+
}
16+
17+
// Check if methods exist before calling them
18+
if (typeof this.getExpirationDate === 'function') {
19+
data.additional_data.expiryDate = this.getExpirationDate();
20+
}
21+
if (typeof this.getMaskedCard === 'function') {
22+
data.additional_data.cardSummary = this.getMaskedCard();
23+
}
24+
if (typeof this.getCardType === 'function') {
25+
data.additional_data.cardBrand = this.getCardType();
26+
}
27+
return data;
28+
}
29+
});
30+
};
31+
});

0 commit comments

Comments
 (0)