sme-pos-printer-plugin
v1.0.9
Published
Capacitor's printer plugin for POS
Downloads
21
Readme
sme-pos-printer-plugin
Capacitor's printer plugin for POS
Install
npm install sme-pos-printer-plugin
npx sme-pos-printer-plugin-setup
npx cap syncAPI
changeLanguage(...)changePrintSetting(...)clearReversal()completePreAuth(...)initialize()injectKey()logon()motoTransaction(...)payment(...)preAuthTransaction(...)printInvoice(...)voidPreAuth(...)settleTransaction()voidTransaction(...)voidTransactionByTrace(...)getActiveStatus()getDataInit()getDeviceInfo()getErrorTransaction()getListPreAuth()getSettledBatchDetail(...)getSettledBatches()getTransDetail(...)printLatestInvoice()rePrintInvoiceBill(...)syncData()getListUnsettledTrans()goToSettledBatches()goToUnsettledTransactions()gotoErrorTransactions()getTheme()setTheme(...)- Interfaces
- Type Aliases
- Enums
changeLanguage(...)
changeLanguage(options: { language: ATLanguages; }) => Promise<void>| Param | Type |
| ------------- | ------------------------------------------------------------------ |
| options | { language: ATLanguages; } |
changePrintSetting(...)
changePrintSetting(options: { printSettings: ATPrintSetting; }) => Promise<void>| Param | Type |
| ------------- | ----------------------------------------------------------------------------- |
| options | { printSettings: ATPrintSetting; } |
clearReversal()
clearReversal() => Promise<BaseResponse<string>>Returns: Promise<BaseResponse<string>>
completePreAuth(...)
completePreAuth(options: { paymentType: ATPaymentTypes; invoiceNo: string; id: string; routingBankCode: string; requestAmount: string; extraData?: string; }) => Promise<BaseResponse<string>>| Param | Type |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| options | { paymentType: ATPaymentTypes; invoiceNo: string; id: string; routingBankCode: string; requestAmount: string; extraData?: string; } |
Returns: Promise<BaseResponse<string>>
initialize()
initialize() => Promise<void>injectKey()
injectKey() => Promise<BaseResponse<string>>Returns: Promise<BaseResponse<string>>
logon()
logon() => Promise<BaseResponse<string>>Returns: Promise<BaseResponse<string>>
motoTransaction(...)
motoTransaction(options: { paymentType: ATPaymentTypes; amount: string; extraData?: string; }) => Promise<BaseResponse<string>>| Param | Type |
| ------------- | --------------------------------------------------------------------------------------------------------------- |
| options | { paymentType: ATPaymentTypes; amount: string; extraData?: string; } |
Returns: Promise<BaseResponse<string>>
payment(...)
payment(options: { paymentType: ATPaymentTypes; amount: string; tip: string; extraData?: string; orderId: string; }) => Promise<BaseResponse<string>>| Param | Type |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| options | { paymentType: ATPaymentTypes; amount: string; tip: string; extraData?: string; orderId: string; } |
Returns: Promise<BaseResponse<string>>
preAuthTransaction(...)
preAuthTransaction(options: { theme?: ATTheme; paymentType: ATPaymentTypes; amount: string; extraData?: string; }) => Promise<BaseResponse<string>>| Param | Type |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| options | { theme?: ATTheme; paymentType: ATPaymentTypes; amount: string; extraData?: string; } |
Returns: Promise<BaseResponse<string>>
printInvoice(...)
printInvoice(options: { base64: string; theme?: ATTheme; }) => Promise<BaseResponse<string>>| Param | Type |
| ------------- | ------------------------------------------------------------------------ |
| options | { base64: string; theme?: ATTheme; } |
Returns: Promise<BaseResponse<string>>
voidPreAuth(...)
voidPreAuth(options: { theme?: ATTheme; id: string; invoiceNo: string; requestAmount: string; routingBankCode: string; }) => Promise<BaseResponse<string>>| Param | Type |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| options | { theme?: ATTheme; id: string; invoiceNo: string; requestAmount: string; routingBankCode: string; } |
Returns: Promise<BaseResponse<string>>
settleTransaction()
settleTransaction() => Promise<BaseResponse<string>>Returns: Promise<BaseResponse<string>>
voidTransaction(...)
voidTransaction(options: { invoiceNo: string; acquirerId: string; transactionType: string; }) => Promise<BaseResponse<string>>| Param | Type |
| ------------- | -------------------------------------------------------------------------------- |
| options | { invoiceNo: string; acquirerId: string; transactionType: string; } |
Returns: Promise<BaseResponse<string>>
voidTransactionByTrace(...)
voidTransactionByTrace(options: { traceNo: string; refNo: string; transactionType: string; }) => Promise<BaseResponse<string>>| Param | Type |
| ------------- | ------------------------------------------------------------------------- |
| options | { traceNo: string; refNo: string; transactionType: string; } |
Returns: Promise<BaseResponse<string>>
getActiveStatus()
getActiveStatus() => Promise<BaseResponse<boolean>>Returns: Promise<BaseResponse<boolean>>
getDataInit()
getDataInit() => Promise<BaseResponse<ATDataInitResponse>>Returns: Promise<BaseResponse<ATDataInitResponse>>
getDeviceInfo()
getDeviceInfo() => Promise<{ name: string; osVersion: string; serialNumber: string; }>Returns: Promise<{ name: string; osVersion: string; serialNumber: string; }>
getErrorTransaction()
getErrorTransaction() => Promise<BaseResponse<ATTransactionError[]>>Returns: Promise<BaseResponse<ATTransactionError[]>>
getListPreAuth()
getListPreAuth() => Promise<BaseResponse<ATPreAuthTransaction[]>>Returns: Promise<BaseResponse<ATPreAuthTransaction[]>>
getSettledBatchDetail(...)
getSettledBatchDetail(options: { batchNo: string; bankCode: string; tid: string; mid: string; }) => Promise<BaseResponse<ATSettledTransEntity[]>>| Param | Type |
| ------------- | ----------------------------------------------------------------------------- |
| options | { batchNo: string; bankCode: string; tid: string; mid: string; } |
Returns: Promise<BaseResponse<ATSettledTransEntity[]>>
getSettledBatches()
getSettledBatches() => Promise<BaseResponse<ATTransSettledInfo[]>>Returns: Promise<BaseResponse<ATTransSettledInfo[]>>
getTransDetail(...)
getTransDetail(options: { invoiceNo: string; }) => Promise<BaseResponse<ATTransactionInfo>>| Param | Type |
| ------------- | ----------------------------------- |
| options | { invoiceNo: string; } |
Returns: Promise<BaseResponse<ATTransactionInfo>>
printLatestInvoice()
printLatestInvoice() => Promise<BaseResponse<boolean>>Returns: Promise<BaseResponse<boolean>>
rePrintInvoiceBill(...)
rePrintInvoiceBill(options: { invoiceNo: string; serialName: string; acquirerCode: string; }) => Promise<BaseResponse<boolean>>| Param | Type |
| ------------- | ----------------------------------------------------------------------------- |
| options | { invoiceNo: string; serialName: string; acquirerCode: string; } |
Returns: Promise<BaseResponse<boolean>>
syncData()
syncData() => Promise<BaseResponse<boolean>>Returns: Promise<BaseResponse<boolean>>
getListUnsettledTrans()
getListUnsettledTrans() => Promise<BaseResponse<ATUnsettledTransactionInfo>>Returns: Promise<BaseResponse<ATUnsettledTransactionInfo>>
goToSettledBatches()
goToSettledBatches() => Promise<BaseResponse<string>>Returns: Promise<BaseResponse<string>>
goToUnsettledTransactions()
goToUnsettledTransactions() => Promise<BaseResponse<string>>Returns: Promise<BaseResponse<string>>
gotoErrorTransactions()
gotoErrorTransactions() => Promise<BaseResponse<string>>Returns: Promise<BaseResponse<string>>
getTheme()
getTheme() => Promise<{ theme: string; }>Returns: Promise<{ theme: string; }>
setTheme(...)
setTheme(options: { theme: string; }) => Promise<void>| Param | Type |
| ------------- | ------------------------------- |
| options | { theme: string; } |
Interfaces
ATTransactionInfo
| Prop | Type |
| --------------------- | ------------------- |
| issuerBankCode | string |
| cardNumber | string |
| batchNo | string |
| traceNo | string |
| invoiceNo | string |
| transDateTime | string |
| transactionType | string |
| readCardMethod | string |
| tid | string |
| mid | string |
| cardIssuer | string |
| refNo | string |
| approveCode | string |
| acquirer | string |
| totalAmount | string |
| tip | string |
| customerBillUrl | string |
ATUnsettledTransactionInfo
| Prop | Type |
| --------------- | ------------------------------------- |
| listTrans | ATUnsettledTransEntity[] |
| canSettle | boolean |
ATUnsettledTransEntity
| Prop | Type |
| --------------------- | ------------------- |
| transactionId | string |
| invoiceNo | string |
| transactionType | string |
| totalAmount | string |
| tip | string |
| cashBack | string |
| baseAmount | string |
| transDateTime | string |
| acquirer | string |
Type Aliases
BaseResponse
{ data?: T; code?: number; error?: string }
ATDataInitResponse
{ apiKey: string; code: string; message: string; mmsUrl: string; data: ATDataInit; }
ATDataInit
{ features: ATPaymentMethod[]; is_active: boolean; merchant: string; merchantId: number; posId: number; receivedDate?: string | null; vat?: string | null; returnedDate?: string | null; serial_number: string; merchantAddress: ATAddress; industryId: number; logoUrl?: string | null; billName: string; staff: ATStaff; portalApi: string; msp: string; virtualAccount?: string | null; binCode: string; routingRule?: string[] | null; defaultRoutingRule?: string[] | null; merchantFee?: string[] | null; mccCode?: string | null; mms_url?: string | null; api_key?: string | null; bill_imgage_url_custom?: string | null; }
ATPaymentMethod
{ appliedTo: string; name: string; isInclude: boolean; }
ATAddress
{ city: string; country: string; state: string | null; street: string; street2: string | null; zip: string | null; }
ATStaff
{ mobile: string; name: string; phone: string; }
ATTransactionError
{ timeStamp: string; errorCode: string; amount: string; cardNumber: string; cardIssuer: string; bankCode: string; }
ATPreAuthTransaction
{ id: string; createdUnixTime: string; invoiceNo: string; requestAmount: number; routingBankCode: string; cardNo?: string | null; }
ATSettledTransEntity
{ transactionId: string; invoiceNo: string; transactionType: string; totalAmount: string; tip: string; cashBack: string; baseAmount: string; transDateTime: string; acquirer: string; }
ATTransSettledInfo
{ timeStamp: string; batchNo: string; bankCode: string; tid: string; mid: string; totalAmountSuccess: number; totalTransSuccess: number; totalAmountVoid: number; totalTransVoid: number; totalAmountRefund: number; totalTransRefund: number; }
Enums
ATLanguages
| Members | Value |
| ---------------- | ----------------- |
| VIETNAMESE | 'vi' |
| ENGLISH | 'en' |
ATPrintSetting
| Members | Value |
| ----------------- | ---------------- |
| DISABLE | '0' |
| PRINT_ONE | '1' |
| PRINT_TWO | '2' |
| PRINT_THREE | '3' |
ATPaymentTypes
| Members | Value |
| ----------------------- | -------------------------------- |
| INSTALLMENT | 'INSTALLMENT' |
| MOTO | 'MOTO' |
| NORMAL | 'NORMAL' |
| PRE_AUTH | 'PRE_AUTH' |
| PRE_AUTH_COMPLETE | 'PRE_AUTH_COMPLETE' |
| SETTLE_TRANS | 'SETTLE_TRANS' |
| THIRD_PARTY | 'THIRD_PARTY' |
| VOID_TRANS | 'VOID_TRANS' |
ATTheme
| Members | Value |
| ------------- | ---------------------- |
| BV_BANK | 'BV_BANK' |
| DEFAULT | 'DEFAULT' |
| DEMO | 'DEMO' |
| KFC | 'KFC' |
| OC_BANK | 'OC_BANK' |
| PAY_DI | 'PAY_DI' |
| VP_BANK | 'VP_BANK' |
| default | 'default' |
