update
This commit is contained in:
@@ -5,9 +5,7 @@
|
||||
* @author Przelewy24
|
||||
* @copyright Przelewy24
|
||||
* @license https://www.gnu.org/licenses/lgpl-3.0.en.html
|
||||
*
|
||||
*/
|
||||
|
||||
class Przelewy24InstallmentPayment
|
||||
{
|
||||
const INSTALLMENT_CALCULATOR_ENDPOINT = 'kalkulator_raty.php';
|
||||
@@ -23,19 +21,21 @@ class Przelewy24InstallmentPayment
|
||||
* Get installment payment data.
|
||||
*
|
||||
* @param float $amount
|
||||
*
|
||||
* @return array|null
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function getInstallmentPaymentData($amount)
|
||||
{
|
||||
$p24c = Przelewy24ClassStaticInterfaceFactory::getDefault();
|
||||
if ((1 !== (int)Configuration::get('PS_SSL_ENABLED')) ||
|
||||
(0 === (int)Configuration::get('P24_INSTALLMENT_PAYMENT_METHOD')) ||
|
||||
($amount < $p24c::getMinInstallmentValue())) {
|
||||
if ((1 !== (int) Configuration::get('PS_SSL_ENABLED'))
|
||||
|| (0 === (int) Configuration::get('P24_INSTALLMENT_PAYMENT_METHOD'))
|
||||
|| ($amount < $p24c::getMinInstallmentValue())) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$amountInt = (int)round($amount * 100);
|
||||
$amountInt = (int) round($amount * 100);
|
||||
$liveUrl = $p24c::getHostForEnvironment();
|
||||
$calculatorAlior = Przelewy24Helper::requestGet(
|
||||
$liveUrl . self::INSTALLMENT_CALCULATOR_ENDPOINT . '?'
|
||||
@@ -43,11 +43,11 @@ class Przelewy24InstallmentPayment
|
||||
);
|
||||
$resultTab = explode(self::RESULT_TAB_SEPARATOR, $calculatorAlior);
|
||||
|
||||
return array(
|
||||
return [
|
||||
self::LIVE_URL => $liveUrl,
|
||||
self::PART_COUNT => $resultTab[0],
|
||||
self::PART_COST => $resultTab[1],
|
||||
self::PRODUCT_AMOUNT => $amount,
|
||||
);
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user