2017 © Pedro PelĆ”ez
 

library installments

Biblioteca que facilita a manipulação de parcelamento de valores.

image

bubbstore/installments

Biblioteca que facilita a manipulação de parcelamento de valores.

  • Monday, January 22, 2018
  • by lucascolette
  • Repository
  • 1 Watchers
  • 2 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Installments

Biblioteca que facilita a manipulação de parcelamento de valores., (*1)

StyleCI, (*2)

Instalação via composer

$ composer require bubbstore/installments

Como utilizar

<?php

use bubbstore\Installments\Installments;
use bubbstore\Installments\Exceptions\InstallmentsException;

try {

    // Definimos um array com as taxas e descontos para cada nĆŗmero de parcela 
    $taxes = [
        ['installment' => 1, 'percent_discount' => 0, 'tax' => 0],
        ['installment' => 2, 'percent_discount' => 0, 'tax' => 0],
        ['installment' => 3, 'percent_discount' => 0, 'tax' => 0],
    ];

    $installments = new Installments;
    $result = $installments->setAmount(200)
                ->setTaxes($taxes)
                ->setMinInstallmentValue(15.00)
                ->get();

    exit(var_dump($result));

} catch (InstallmentsException $e) {
    echo $e->getMessage();
}

O resultado esperado serĆ”:, (*3)

{  
    "max_installment":3,
    "max_installment_value":66.67,
    "amount":200,
    "text":"3x de R$ 66,67 sem juros",
    "text_with_tax":"3x de R$ 66,67",
    "text_discount_percent":null,
    "text_discount":null,
    "installments":
    [  
        {  
            "amount":200,
            "amount_formated":"R$ 200,00",
            "base_value":200,
            "tax":0,
            "tax_value":0,
            "discount_percent":0,
            "discount_value":0,
            "discount_value_formated":"R$ 0,00",
            "installment":1,
            "installment_value":200,
            "installment_value_formated":"R$ 200,00",
            "text":"1x de R$ 200,00 sem juros",
            "text_with_tax":"1x de R$ 200,00",
            "text_discount_percent":null,
            "text_discount":null
        },
        {  
            "amount":200,
            "amount_formated":"R$ 200,00",
            "base_value":200,
            "tax":0,
            "tax_value":0,
            "discount_percent":0,
            "discount_value":0,
            "discount_value_formated":"R$ 0,00",
            "installment":2,
            "installment_value":100,
            "installment_value_formated":"R$ 100,00",
            "text":"2x de R$ 100,00 sem juros",
            "text_with_tax":"2x de R$ 100,00",
            "text_discount_percent":null,
            "text_discount":null
        },
        {  
            "amount":200,
            "amount_formated":"R$ 200,00",
            "base_value":200,
            "tax":0,
            "tax_value":0,
            "discount_percent":0,
            "discount_value":0,
            "discount_value_formated":"R$ 0,00",
            "installment":3,
            "installment_value":66.67,
            "installment_value_formated":"R$ 66,67",
            "text":"3x de R$ 66,67 sem juros",
            "text_with_tax":"3x de R$ 66,67",
            "text_discount_percent":null,
            "text_discount":null
        }
    ]
}

Change log

Consulte CHANGELOG para obter mais informaƧƵes sobre o que mudou recentemente., (*4)

Contribuindo

Consulte CONTRIBUTING para obter mais detalhes., (*5)

SeguranƧa

Se você descobrir quaisquer problemas relacionados à segurança, envie um e-mail para contato@bubbstore.com.br em vez de usar as issues., (*6)

The Versions

22/01 2018

dev-master

9999999-dev

Biblioteca que facilita a manipulação de parcelamento de valores.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Lucas Colette

dooki

22/01 2018

dev-dev

dev-dev

Biblioteca que facilita a manipulação de parcelamento de valores.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Lucas Colette

dooki