Git Product home page Git Product logo

boletocoding's Introduction

Boleto Coding

Uma biblioteca PHP para extração de informações de um código de barras. Atualmente, consegue-se extrair as seguintes informações:

  • Data de vencimento
  • Valor do documento

E suporta os seguintes formatos de boletos:

  • Concessionárias (Luz, telefone, gás, etc.) - Linha digitável de 48 digitos
  • Boleto bancário - Linha digitável de 47 digitos
  • Código de barras - 44 digitos

Forma de usar

Inicializando:

include_once "BoletoCoding\Boleto.php"; //Ou um autoload, se preferir

$linha_digitavel = "34191670060463564064460910580004739290000307014";
$boleto = new Boleto($linha_digitavel);

Ou com a linha digitável de um boleto de concessionária:

$linha_digitavel = "828300000007943901072010710010111362699201709063";
$boleto = new Boleto($linha_digitavel);

A partir deste momento, estará disponível métodos de manipulação dos dados do código de barra.

if ($boleto->is_valid()) {
    echo "Valor do documento: " . $boleto->get_subtotal(); // 3070.14
    echo "Data de vencimento: " . $boleto->get_due_date("d/m/Y");// 10/07/2008
}

Atualizações

  • 1.0 - Primeira release
  • 1.0.1 - Adicionado mais um método de validação.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.