npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ecpay-invoice-node

v1.0.3

Published

Ecpay Invoice SDK for Node based on ECPay/Invoice_Node.js

Downloads

19

Readme

ECPay Invoice For Node.js


The differences

This repository forked from ECPay/Invoice_Node.js, but there're two major differences:

  1. Using parameters injection instead of XML configuration.

  2. Transforming the response format from string to JSON.

Install

yarn add ecpay-invoice-node

OR

npm install ecpay-invoice-node

How to use

import ecpayInvoice from 'ecpay-invoice-node'

let base_param = {
    RelateNumber:"asc12323aasddFY", // 請帶30碼uid, ex: werntfg9os48trhw34etrwerh8ew2r
    CustomerID:"12124", // 客戶代號,長度為20字元
    CustomerIdentifier:"12345678", // 統一編號,長度為8字元
    CustomerName:"綠先生", // 客戶名稱,長度為20字元
    CustomerAddr:"台北市南港區三重路19-2號6-2樓()", // 客戶地址,長度為100字元
    CustomerPhone:"0912345678", // 客戶電話,長度為20字元
    CustomerEmail:"[email protected]", // 客戶信箱,長度為80字元
    ClearanceMark:"", // 通關方式,僅可帶入'1'、'2'、''
    Print:"1", // 列印註記,僅可帶入'0'、'1'
    Donation:"0", // 捐贈註記,僅可帶入'1'、'0'
    LoveCode:"", // 愛心碼,長度為7字元
    CarruerType:"", // 載具類別,僅可帶入'1'、'2'、'3'、''
    CarruerNum:"", // 載具編號,當載具類別為'2'時,長度為16字元,當載具類別為'3'時,長度為7字元
    TaxType:"1", // 課稅類別,僅可帶入'1'、'2'、'3'、'9'
    SalesAmount:"200", // 發票金額
    InvoiceRemark:"", // 備註
    ItemName:"洗衣精|洗髮乳", // 商品名稱,如果超過一樣商品時請以|(為半形不可使用全形)分隔
    ItemCount:"1|1", // 商品數量,如果超過一樣商品時請以|(為半形不可使用全形)分隔
    ItemWord:"瓶|罐", // 商品單位,如果超過一樣商品時請以|(為半形不可使用全形)分隔
    ItemPrice:"100|100", // 商品價格,如果超過一樣商品時請以|(為半形不可使用全形)分隔
    ItemTaxType:"", // 商品課稅別,如果超過一樣商品時請以|(為半形不可使用全形)分隔,如果TaxType為9請帶值,其餘為空
    ItemAmount:"100|100", // 商品合計,如果超過一樣商品時請以|(為半形不可使用全形)分隔
    ItemRemark:"test item|test item", // 商品備註,如果超過一樣商品時請以|(為半形不可使用全形)分隔
    InvType:"07", // 字軌類別,、'07'一般稅額
    vat:"1" // 商品單價是否含稅,'1'為含稅價'、'2'為未稅價
};

async function issueInvoice() {
    let create = new ecpayInvoice({
        operationMode: "Test",
        isProjectContractor: "N",
        ignorePayment: [],
        merchantInfo: {
            merchantID: "2000132",
            hashKey: "ejCk326UnaZWKisg",
            hashIV: "q9jcZX8Ib9LM8wYk"
        }
    });
    try {
        let res = await create.invoice_client.ecpay_invoice_issue(parameters = base_param);
        console.log(res);
    } catch (error) {
        throw error
    }
}
issueInvoice();