0.1.2 • Published 4 years ago

cetustek-invoice-nodejs v0.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

About

Cetustek Invoice NodeJS (CIN) is a module/example for calling Cetustek Invoice APIs with NodeJS, which allows you to call the APIs by the mudule.

CIN code base reference from IOTA/IAC repo.

See a more please contact Cetustek.

This is beta software, so there may be performance and stability issues. Please report any issues in our issue tracker.

Prerequisites

To use CIN in your own applications, you need Node.js installed on your device.

To check if you have Node.js installed, run the following command:

node -v

If Node.js is installed, you should see the version that's installed.

Installation

To install this package, use one of the following commands:

  • npm install cetustek-invoice-nodejs
  • yarn add cetustek-invoice-nodejs

Getting started

To jump in now, see the following code sample:

const cetustekInvoice = require('cetustek-invoice-nodejs');

const config = {
  user: '',
  password: '',
  endpoint: '',
};

const invoiceData = {
 OrderId: `A2020063000001`,
 OrderDate: '2020/07/06'
 BuyerIdentifier: '53118823',
 BuyerName: '測試',
 BuyerAddress: 'OOXX 的地址',
 BuyerPersonInCharge: 'Joe',
 BuyerTelephoneNumber: '0800888123',
 BuyerFacsimileNumber: '02-33332222',
 BuyerEmailAddress: 'test@test.com',
 BuyerCustomerNumber: 'VIG01AA39090',
 DonateMark: 0,
 InvoiceType: '05',
 NPOBAN: '',
 PayWay: 2,
 TaxType: 1,
 TaxRate: 0.05,
 Remark: ''
};
console.log("Cetustek Invoice Data:", invoiceData);

const invoiceItems = [
 {
	 ProductionCode: 'AAA123',
	 Description: 'OOXX',
	 Quantity: 17,
	 Unit: '月',
	 UnitPrice: 50000
 }
];
console.log("Cetustek Invoice Items:", invoiceItems);

const response = cetustekInvoice.create(invoiceData, invoiceItems);
console.log("Cetustek Invoice Respone", response);

Will output:

Cetustek Invoice Data {
 OrderId: `A2020063000001`,
 OrderDate: '2020/07/06'
 BuyerIdentifier: '53118823',
 BuyerName: '測試',
 BuyerAddress: 'OOXX 的地址',
 BuyerPersonInCharge: 'Joe',
 BuyerTelephoneNumber: '0800888123',
 BuyerFacsimileNumber: '02-33332222',
 BuyerEmailAddress: 'test@test.com',
 BuyerCustomerNumber: 'VIG01AA39090',
 DonateMark: 0,
 InvoiceType: '05',
 NPOBAN: '',
 PayWay: 2,
 TaxType: 1,
 TaxRate: 0.05,
 Remark: ''
}

Cetustek Invoice Items [
 {
	 ProductionCode: 'AAA123',
	 Description: 'OOXX',
	 Quantity: 17,
	 Unit: '月',
	 UnitPrice: 50000
 }
]

Response

API Reference

See the JavaScript API reference.

Supporting the project

If you want to contribute, consider submitting a bug report, feature request or a pull request.

See our contributing guidelines for more information.

Joining the discussion

If you want to get involved in the community, need help with getting set up, have any issues or just want to discuss with other people, feel free to join our Telegram.