private static function _getPayArray($sum, $pclass, $flags)
    {
        $monthsfee = 0;
        if ($flags === KlarnaFlags::CHECKOUT_PAGE) {
            $monthsfee = $pclass->getInvoiceFee();
        }
        $startfee = 0;
        if ($flags === KlarnaFlags::CHECKOUT_PAGE) {
            $startfee = $pclass->getStartFee();
        }

        //Include start fee in sum
        $sum += $startfee;

        $base = ($pclass->getType() === KlarnaPClass::ACCOUNT);
        $lowest = self::get_lowest_payment_for_account($pclass->getCountry());

        if ($flags == KlarnaFlags::CHECKOUT_PAGE) {
            $minpay = ($pclass->getType() === KlarnaPClass::ACCOUNT) ? $lowest : 0;
        } else {
            $minpay = 0;
        }

        $payment = self::_annuity(
            $sum,
            $pclass->getMonths(),
            $pclass->getInterestRate()
        );

        //Add monthly fee
        $payment += $monthsfee;

        return  self::_fulpacc(
            $sum,
            $pclass->getInterestRate(),
            $monthsfee,
            $minpay,
            $payment,
            $pclass->getMonths(),
            $base
        );
    }
private static function _getPayArray($sum, $pclass, $flags)
    {
        $monthsfee = 0;
        if ($flags === KlarnaFlags::CHECKOUT_PAGE) {
            $monthsfee = $pclass->getInvoiceFee();
        }
        $startfee = 0;
        if ($flags === KlarnaFlags::CHECKOUT_PAGE) {
            $startfee = $pclass->getStartFee();
        }

        //Include start fee in sum
        $sum += $startfee;

        $base = ($pclass->getType() === KlarnaPClass::ACCOUNT);
        $lowest = self::get_lowest_payment_for_account($pclass->getCountry());

        if ($flags == KlarnaFlags::CHECKOUT_PAGE) {
            $minpay = ($pclass->getType() === KlarnaPClass::ACCOUNT) ? $lowest : 0;
        } else {
            $minpay = 0;
        }

        $payment = self::_annuity(
            $sum,
            $pclass->getMonths(),
            $pclass->getInterestRate()
        );

        //Add monthly fee
        $payment += $monthsfee;

        return  self::_fulpacc(
            $sum,
            $pclass->getInterestRate(),
            $monthsfee,
            $minpay,
            $payment,
            $pclass->getMonths(),
            $base
        );
    }
private static function _getPayArray ( $ sum , $ pclass , $ flags ) { $ monthsfee = 0 ; if ( $ flags === KlarnaFlags :: CHECKOUT_PAGE ) { $ monthsfee = $ pclass -> getInvoiceFee ( ) ; } $ startfee = 0 ; if ( $ flags === KlarnaFlags :: CHECKOUT_PAGE ) { $ startfee = $ pclass -> getStartFee ( ) ; } //Include start fee in sum $ sum += $ startfee ; $ base = ( $ pclass -> getType ( ) === KlarnaPClass :: ACCOUNT ) ; $ lowest = self :: get_lowest_payment_for_account ( $ pclass -> getCountry ( ) ) ; if ( $ flags == KlarnaFlags :: CHECKOUT_PAGE ) { $ minpay = ( $ pclass -> getType ( ) === KlarnaPClass :: ACCOUNT ) ? $ lowest : 0 ; } else { $ minpay = 0 ; } $ payment = self :: _annuity ( $ sum , $ pclass -> getMonths ( ) , $ pclass -> getInterestRate ( ) ) ; //Add monthly fee $ payment += $ monthsfee ; return self :: _fulpacc ( $ sum , $ pclass -> getInterestRate ( ) , $ monthsfee , $ minpay , $ payment , $ pclass -> getMonths ( ) , $ base ) ; }
Grabs the array of all monthly payments for specified PClass.

<b>Flags can be either</b>:<br>
{@link KlarnaFlags::CHECKOUT_PAGE}<br>
{@link KlarnaFlags::PRODUCT_PAGE}<br>

@param float        $sum    The sum for the order/product.
@param KlarnaPClass $pclass KlarnaPClass used to calculate the APR.
@param int          $flags  Checkout or Product page.

@throws KlarnaException
@return array An array of monthly payments.
Grabs the array of all monthly payments for specified PClass .