Skip to content

Commit 14d6ad1

Browse files
contardiThiago Contardi
andauthored
fix: some cases the sum wasn't right (#11)
* feat: added new credit card form * feat: added setup for old settings and minor bugfixes * fix: error with 1i18n on setting's page * fix: allow all countris by default * i18n: add new terms for language file * feat: added max installments and minum installment value * feat: added reseller token to transactions * feat: added reseller token to transactions * feat: send tracking code to Vindi * fix: mask also reseller token and token account * fix: when the card number comes with 4 digits, don't add 20 before it * fix: when the card number comes with 4 digits, don't add 20 before it * doc: added pull request template * fix: observer to bankslippix * fix: cancel unapproved orders without config * feat: adjust with phpstan * fix: error monitoring transactions * fix: worng price additional --------- Co-authored-by: Thiago Contardi <thiago@bizcommerce.com.br>
1 parent 7a765c8 commit 14d6ad1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Gateway/Request/PaymentsRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ public function getDiscountAmount(Order $order, $orderAmount): float
163163
protected function getPriceAdditional(Order $order, float $orderAmount): float
164164
{
165165
$priceAdditional = 0;
166-
$transactionAmount = $order->getBaseSubtotal() + $order->getShippingAmount() + $order->getDiscountAmount();
166+
$transactionAmount = (float) $order->getBaseSubtotal() + (float) $order->getShippingAmount() + (float) $order->getDiscountAmount();
167167
if ($transactionAmount < $orderAmount) {
168168
$priceAdditional = $orderAmount - $transactionAmount;
169169
}
170-
return (float) $priceAdditional;
170+
return round((float) $priceAdditional, 2);
171171
}
172172

173173
public function getCustomerData(Order $order): array

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vindi/magento2-payments",
33
"description": "Vindi VP Payment Method for Magento 2.3+",
44
"type": "magento2-module",
5-
"version": "1.3.5",
5+
"version": "1.3.6",
66
"license": [
77
"OSL-3.0",
88
"AFL-3.0"

etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
-->
1515
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
16-
<module name="Vindi_VP" setup_version="1.3.5">
16+
<module name="Vindi_VP" setup_version="1.3.6">
1717
<sequence>
1818
<module name="Magento_Sales"/>
1919
<module name="Magento_Payment"/>

0 commit comments

Comments
 (0)