Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customer.create not supported? #4

Open
cypris75 opened this issue Oct 18, 2016 · 2 comments
Open

customer.create not supported? #4

cypris75 opened this issue Oct 18, 2016 · 2 comments

Comments

@cypris75
Copy link

cypris75 commented Oct 18, 2016

Demo:

fastbill = require('fastbill-client');
fastbill.bootstrap('xxx', 'xxx');

customer = 
  "CUSTOMER_TYPE": "business"
  "ORGANIZATION": "Test Inc. Corp."
  "LAST_NAME": "Doe"

fastbill.api.customer.create customer
.then (result) ->
  console.log 'Success', result
(err) ->
  console.log 'Error', err

Error:

undefined:1                                                                                                                                                                                           
[object Object]                                                                                                                                                                                       
 ^                                                                                                                                                                                                    

SyntaxError: Unexpected token o in JSON at position 1                                                                                                                                                 
  at Object.parse (native)                                                                                                                                                                            
  at Request._callback (C:\...\node_modules\fastbill-client\lib\fastbill-client.coffee:51:41)  
@soulchild
Copy link
Contributor

It's been a while, so I'm not quite sure if this is related to the problem I fixed in 7de9d0c. It looks similar, but given that my PR was merged in January 2016 and assuming you're using the latest version, I suppose you're running into a different problem...

Nevertheless, I can confirm that the creation of customers basically works with this client because we're using it in production.

@soulchild
Copy link
Contributor

Okay, there's definitely something wrong with the current 0.1.1 version on npm. You may want to try my fork which fixes the problem you're describing:

npm install --save "https://github.com/soulchild/fastbill-client.git"

@passionkind, did you release a new version to npm after merging my pull request?

@github-staff github-staff deleted a comment Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants