chargebee / chargebee-node

Node.js library for the Chargebee API.
https://apidocs.chargebee.com/docs/api?lang=node
MIT License
46 stars 30 forks source link

plan w/ price that is decimal, is returned without the dot #14

Closed shierro closed 5 years ago

shierro commented 5 years ago

Hi,

i'm not sure if it's the actual API that returned a price that is w/o the dot, or there's a parsing issue with the library. But regardless, i'd like to let you know so maybe there's something that we can do about it here on the library.

sample plan price on dashboard interface AUD 114.32

what const { list } = await chargebee.plan.list({ limit: 100 }).request(); returns:

[
{
  plan: {
    ...
    id: 'test-ID',
    price: 11432, // w/o decimal :(
  }
}
]
shierro commented 5 years ago

according to support: all prices are returned with decimal(w/o the dot) so it is safe to divide price values by 100.