ezpay-invoice-js
v1.0.12
Published
ezPay 發票 SDK
Downloads
231
Readme
ezPay Invoice SDK js
ezPay 發票 SDK
Installation
yarn add ezpay-invoice-js
Usage
Create SDK Instance (ES5)
const EzpayInvoiceClient = require("ezpay-invoice-js");
const client = new EzpayInvoiceClient({
merchantId: "ezPay Invoice Merchant ID",
hashKey: "ezPay Invoice Hash Key",
hashIV: "ezPay Invoice Hash IV",
env: "production", // 'sandbox' | 'production'
});
Create SDK Instance (ES6)
import EzpayInvoiceClient from "ezpay-invoice-js";
const client = new EzpayInvoiceClient({
merchantId: "ezPay Invoice Merchant ID",
hashKey: "ezPay Invoice Hash Key",
hashIV: "ezPay Invoice Hash IV",
env: "production", // 'sandbox' | 'production'
});
開立發票 Issue invoice
詳情請見官方文件:文件網址
await client.issueInvoice({
})
作廢發票 Revoke invoice
詳情請見官方文件:文件網址
await client.revokeInvoice(
'invoice number', // 發票號碼
'invoke reason' // 作廢原因
)
開立折讓 Issue allowance
詳情請見官方文件:文件網址
await client.issueAllowance({
})
作廢折讓 Revoke allowance
詳情請見官方文件:文件網址
await client.revokeAllowance(
'allowance number', // 折讓號碼
'invoke reason' // 作廢原因
)