Skip to content

Commit

Permalink
Merge branch 'release/3.15.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
r-martins committed Aug 23, 2022
2 parents 2c182c8 + 59a4cb1 commit b747957
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/code/community/RicardoMartins/PagSeguro/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class RicardoMartins_PagSeguro_Helper_Data extends Mage_Core_Helper_Abstract
const XML_PATH_JSDELIVR_MINIFY = 'payment/rm_pagseguro/jsdelivr_minify';
const XML_PATH_STC_MIRROR = 'payment/rm_pagseguro/stc_mirror';
const XML_PATH_PAYMENT_PAGSEGURO_CC_MULTICC_ACTIVE = 'payment/rm_pagseguro_cc/multicc_active';
const MAX_ALLOWED_NOINTERESTINSTALLMENTQUANTITY = 18; //PagSeguro limitation

/**
* Returns session ID from PagSeguro that will be used on JavaScript methods.
Expand Down Expand Up @@ -674,6 +675,12 @@ public function getMaxInstallmentsNoInterest($amount)
$selectedMaxInstallmentNoInterest = $amount / $freeAmt;
$selectedMaxInstallmentNoInterest = (int)floor($selectedMaxInstallmentNoInterest);

//prevents internal server error from PagSeguro when receiving a value > 18
$selectedMaxInstallmentNoInterest = min(
$selectedMaxInstallmentNoInterest,
self::MAX_ALLOWED_NOINTERESTINSTALLMENTQUANTITY
);

return ($selectedMaxInstallmentNoInterest > 1) ? $selectedMaxInstallmentNoInterest : false; //prevents 0 or 1
}
}
2 changes: 1 addition & 1 deletion app/code/community/RicardoMartins/PagSeguro/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<RicardoMartins_PagSeguro>
<version>3.15.3</version>
<version>3.15.4</version>
</RicardoMartins_PagSeguro>
</modules>
<global>
Expand Down

0 comments on commit b747957

Please sign in to comment.