Skip to content

Commit

Permalink
Merge pull request #1064 from buckaroo-it/develop
Browse files Browse the repository at this point in the history
Update, test & release (1.50.1)
  • Loading branch information
vegimcarkaxhija authored Sep 23, 2024
2 parents 44c1129 + 5c406a1 commit d0bf2ba
Show file tree
Hide file tree
Showing 15 changed files with 232 additions and 57 deletions.
40 changes: 0 additions & 40 deletions Model/Total/Quote/BuckarooAlreadyPay.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,46 +47,6 @@ public function __construct(
$this->giftcardCollection = $giftcardCollection;
}

/**
* Collect grand total address amount
*
* @param \Magento\Quote\Model\Quote $quote
* @param \Magento\Quote\Api\Data\ShippingAssignmentInterface $shippingAssignment
* @param \Magento\Quote\Model\Quote\Address\Total $total
* @return $this
*
* @throws \LogicException
*/
public function collect(
\Magento\Quote\Model\Quote $quote,
\Magento\Quote\Api\Data\ShippingAssignmentInterface $shippingAssignment,
\Magento\Quote\Model\Quote\Address\Total $total
) {
parent::collect($quote, $shippingAssignment, $total);

// Ensure that shipping assignment has items, otherwise skip processing.
if (!$shippingAssignment->getItems()) {
return $this;
}

$orderId = $quote->getReservedOrderId();
$alreadyPaidAmount = $this->groupTransaction->getAlreadyPaid($orderId);

// Ensure totals are properly initialized.
$total->setTotalAmount($this->getCode(), 0);
$total->setBaseTotalAmount($this->getCode(), 0);

// Adjust the grand total only if the already paid amount is greater than zero.
if ($alreadyPaidAmount > 0) {
$total->addTotalAmount($this->getCode(), -$alreadyPaidAmount);
$total->addBaseTotalAmount($this->getCode(), -$alreadyPaidAmount);

}

return $this;
}


/**
* Add buckaroo fee information to address
*
Expand Down
3 changes: 1 addition & 2 deletions Model/Total/Quote/BuckarooFee.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ public function collect(

// Check if already paid amount is affecting the calculation
if ($this->groupTransaction->getAlreadyPaid($orderId) > 0) {
// Optionally, you could log or debug here to ensure no early returns affect the fee calculation.
$this->logging->addDebug('Already paid detected, but continuing to add fee.');
return $this;
}

// Ensure payment method is set correctly
Expand Down
3 changes: 1 addition & 2 deletions Model/Total/Quote/BuckarooFeeHyva.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ public function collect(

// Check if already paid amount is affecting the calculation
if ($this->groupTransaction->getAlreadyPaid($orderId) > 0) {
// Optionally, you could log or debug here to ensure no early returns affect the fee calculation.
$this->logging->addDebug('Already paid detected, but continuing to add fee.');
return $this;
}

// Ensure payment method is set correctly
Expand Down
2 changes: 1 addition & 1 deletion Service/Software/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Data
const MODULE_CODE = 'Buckaroo_Magento2';

/** Version of Module */
const BUCKAROO_VERSION = '1.50.0';
const BUCKAROO_VERSION = '1.50.1';

/** @var ProductMetadataInterface */
private $productMetadata;
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"docs": "https://docs.buckaroo.io/"
},
"homepage": "https://www.buckaroo.nl",
"version" : "v1.50.0",
"version" : "v1.50.1",
"minimum-stability": "stable",
"autoload": {
"files": [
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Buckaroo_Magento2:etc/buckaroo_module.xsd">
<module name="Buckaroo_Magento2" setup_version="1.50.0" build_number="1769" stability="stable">
<module name="Buckaroo_Magento2" setup_version="1.50.1" build_number="1769" stability="stable">
<sequence>
<module name="Magento_Payment"/>
<module name="Magento_ReleaseNotification"/>
Expand Down
14 changes: 14 additions & 0 deletions i18n/be_FR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,17 @@
"Cannot create payment","Impossible de créer le paiement"
"Failed to create quote","Échec de la création du devis"
"Failed to add address to quote","Échec de l'ajout de l'adresse au devis"
"Feb","Fév"
"Mar","Mar"
"Apr","Avr"
"May","Mai"
"Aug","Aoû"
"Oct","Oct"
"Dec","Déc"
"Mo","Lu"
"Tu","Ma"
"We","Me"
"Th","Je"
"Fr","Ve"
"Sa","Sa"
"Su","Di"
11 changes: 11 additions & 0 deletions i18n/de_DE.csv
Original file line number Diff line number Diff line change
Expand Up @@ -478,3 +478,14 @@
"Cannot create payment","Zahlung kann nicht erstellt werden"
"Failed to create quote","Angebotserstellung fehlgeschlagen"
"Failed to add address to quote","Adresse konnte dem Angebot nicht hinzugefügt werden"
"Mar","Mär"
"May","Mai"
"Oct","Okt"
"Dec","Dez"
"Mo","Mo"
"Tu","Di"
"We","Mi"
"Th","Do"
"Fr","Fr"
"Sa","Sa"
"Su","So"
14 changes: 14 additions & 0 deletions i18n/fr_FR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -479,3 +479,17 @@
"Cannot create payment","Impossible de créer le paiement"
"Failed to create quote","Échec de la création du devis"
"Failed to add address to quote","Échec de l'ajout de l'adresse au devis"
"Feb","Fév"
"Mar","Mar"
"Apr","Avr"
"May","Mai"
"Aug","Aoû"
"Oct","Oct"
"Dec","Déc"
"Mo","Lu"
"Tu","Ma"
"We","Me"
"Th","Je"
"Fr","Ve"
"Sa","Sa"
"Su","Di"
10 changes: 10 additions & 0 deletions i18n/nl_BE.csv
Original file line number Diff line number Diff line change
Expand Up @@ -478,3 +478,13 @@
"Cannot create payment","Betaling kan niet worden aangemaakt"
"Failed to create quote","Offerte aanmaken mislukt"
"Failed to add address to quote","Adres kan niet aan offerte worden toegevoegd"
"Mar","Mrt"
"May","Mei"
"Oct","Okt"
"Mo","Ma"
"Tu","Di"
"We","Wo"
"Th","Do"
"Fr","Vr"
"Sa","Za"
"Su","Zo"
10 changes: 10 additions & 0 deletions i18n/nl_NL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -490,3 +490,13 @@
"Cannot create payment","Betaling kan niet worden aangemaakt"
"Failed to create quote","Offerte aanmaken mislukt"
"Failed to add address to quote","Adres kan niet aan offerte worden toegevoegd"
"Mar","Mrt"
"May","Mei"
"Oct","Okt"
"Mo","Ma"
"Tu","Di"
"We","Wo"
"Th","Do"
"Fr","Vr"
"Sa","Za"
"Su","Zo"
16 changes: 11 additions & 5 deletions view/frontend/layout/checkout_index_index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@
</item>
</item>
</item>
<item name="grand-total" xsi:type="array">
<item name="component" xsi:type="string">Buckaroo_Magento2/js/view/checkout/summary/grand-total</item>
<item name="config" xsi:type="array">
<item name="exclTaxLabel" xsi:type="string" translate="true">Order Total Excl. Tax</item>
<item name="inclTaxLabel" xsi:type="string" translate="true">Order Total Incl. Tax</item>
<item name="basicCurrencyMessage" xsi:type="string" translate="true">You will be charged for</item>
<item name="title" xsi:type="string" translate="true">Order Total</item>
</item>
</item>
</item>
</item>
</item>
Expand Down Expand Up @@ -133,13 +142,13 @@
<item name="isBillingAddressRequired" xsi:type="boolean">true</item>
</item>
<item name="buckaroo_magento2_eps" xsi:type="array">
<item name="isBillingAddressRequired" xsi:type="boolean">true</item>
<item name="isBillingAddressRequired" xsi:type="boolean">true</item>
</item>
<item name="buckaroo_magento2_giftcards" xsi:type="array">
<item name="isBillingAddressRequired" xsi:type="boolean">true</item>
<item name="children" xsi:type="array">
<item name="buckaroo_magento2_vvvgiftcard" xsi:type="array">
<item name="isBillingAddressRequired" xsi:type="boolean">true</item>
<item name="isBillingAddressRequired" xsi:type="boolean">true</item>
</item>
</item>
</item>
Expand Down Expand Up @@ -200,9 +209,6 @@
<item name="buckaroo_magento2_knaken" xsi:type="array">
<item name="isBillingAddressRequired" xsi:type="boolean">true</item>
</item>
<item name="buckaroo_magento2_blik" xsi:type="array">
<item name="isBillingAddressRequired" xsi:type="boolean">true</item>
</item>
</item>
</item>
</item>
Expand Down
16 changes: 12 additions & 4 deletions view/frontend/web/js/action/place-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,18 @@ define(
}]
});
$('.' + paymentData.method).remove();
} else if (redirectOnSuccess) {
window.location.replace(url.build('checkout/onepage/success/'));
} else {
if (jsonResponse.buckaroo_response) {
window.checkoutConfig.payment.buckaroo.response = jsonResponse.buckaroo_response;
} else {
window.checkoutConfig.payment.buckaroo.response = jsonResponse;
}

if (redirectOnSuccess) {
window.location.replace(url.build('checkout/onepage/success/'));
}
}
window.checkoutConfig.payment.buckaroo.response = jsonResponse.buckaroo_response;

fullScreenLoader.stopLoader();
}
).fail(
Expand All @@ -143,4 +151,4 @@ define(
);
};
}
);
);
30 changes: 29 additions & 1 deletion view/frontend/web/js/view/checkout/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,39 @@
*/
define(
[
'jquery'
'jquery',
'jquery/ui',
'mage/translate'
],
function ($) {
'use strict';

$.datepicker.setDefaults({
dayNamesMin: [
$.mage.__('Su'),
$.mage.__('Mo'),
$.mage.__('Tu'),
$.mage.__('We'),
$.mage.__('Th'),
$.mage.__('Fr'),
$.mage.__('Sa')
],
monthNamesShort: [
$.mage.__('Jan'),
$.mage.__('Feb'),
$.mage.__('Mar'),
$.mage.__('Apr'),
$.mage.__('May'),
$.mage.__('Jun'),
$.mage.__('Jul'),
$.mage.__('Aug'),
$.mage.__('Sep'),
$.mage.__('Okt'),
$.mage.__('Nov'),
$.mage.__('Dec')
]
});

return {
addPickerClass(input, inst) {
$(inst.dpDiv).addClass('bk-datepicker');
Expand Down
Loading

0 comments on commit d0bf2ba

Please sign in to comment.