javascript icon indicating copy to clipboard operation
javascript copied to clipboard

[Feature request] Get "boleto" information from digitable line

Open lucascarrias opened this issue 5 years ago • 3 comments

The "boleto"'s digitable line has some information about the charge, for example:

  • Expiration date
  • Charge Value
  • Associate Bank code
  • Currency code

With that considered, I suggest that we should create a single function to get all values as bellow:

{
  expirationDate: Date,
  valueInCents: number,
  bankCode: string,
  currency: string
}

An alternative feature is to create functions to get each "boleto" information:

  function getExpirationDate(boleto: string): Date
  function getValueInCents(boleto: string): number
  function getBankCode(boleto: string) : string
  function getCurrency(boleto: string): string

Reference: Campos dos boletos e linha digitável: o que significam? Código dos bancos associados - Febraban


Edit: Add functions declaration examples

lucascarrias avatar Jun 09 '21 18:06 lucascarrias

I like your suggestion! Can you help us to create this function? I think getBoletoInfo it's a good name for that.

hyanmandian avatar Jun 10 '21 18:06 hyanmandian

@hyanmandian I got ahead and already started working on that. I was just waiting some feedback before creating a PR.

So, I'll create the getBoletoInfo function.

lucascarrias avatar Jun 10 '21 18:06 lucascarrias

Done @lucascarrias it is merged and published! https://github.com/brazilian-utils/javascript/blob/main/src/get-boleto-info/get-boleto-info.ts

hyanmandian avatar Jan 21 '26 18:01 hyanmandian