UNPKG

node-ecpay-aio

Version:

A production-ready ECPay AIO SDK for Node.js with TypeScript support.

95 lines (94 loc) 4.51 kB
import { Merchant } from './Merchant'; import { BasePaymentParams, CreditOneTimePaymentParams, CreditDividePaymentParams, CreditPeriodPaymentParams, WebATMPaymentParams, ATMPaymentParams, CVSPaymentParams, BARCODEPaymentParams, AndroidPayPaymentParams, ALLPaymentParams, InvoiceParams, ECPayPaymentType, PaymentInfoData } from '../types'; export declare class Payment<T> { merchant: Merchant; apiUrl: string; baseParams: BasePaymentParams & { EncryptType: 1; ChoosePayment: ECPayPaymentType; InvoiceMark: 'N' | 'Y'; PaymentType: 'aio'; }; params: T; invoice?: InvoiceParams; constructor(merchant: Merchant, baseParams: BasePaymentParams, params: T); _prepareOrder(invoice?: InvoiceParams): { MerchantTradeNo: string; MerchantTradeDate: string; TotalAmount: number; TradeDesc: string; ItemName: string; ReturnURL?: string | undefined; StoreID?: string | undefined; ClientBackURL?: string | undefined; ItemURL?: string | undefined; Remark?: string | undefined; OrderResultURL?: string | undefined; NeedExtraPaidInfo?: "N" | "Y" | undefined; CustomField1?: string | undefined; CustomField2?: string | undefined; CustomField3?: string | undefined; CustomField4?: string | undefined; EncryptType: 1; ChoosePayment: ECPayPaymentType; InvoiceMark: "N" | "Y"; PaymentType: "aio"; MerchantID: string; } & T & { CheckMacValue: string; RelateNumber?: string | undefined; CustomerID?: string | undefined; CustomerIdentifier?: string | undefined; CustomerName?: string | undefined; CustomerAddr?: string | undefined; CustomerPhone?: string | undefined; CustomerEmail?: string | undefined; ClearanceMark?: "1" | "2" | undefined; TaxType?: "1" | "2" | "3" | "9" | undefined; CarruerType?: "" | "1" | "2" | "3" | undefined; CarruerNum?: string | undefined; Donation?: "0" | "1" | undefined; LoveCode?: string | undefined; Print?: "0" | "1" | undefined; InvoiceItemName?: string | undefined; InvoiceItemCount?: string | undefined; InvoiceItemWord?: string | undefined; InvoiceItemPrice?: string | undefined; InvoiceItemTaxType?: string | undefined; InvoiceRemark?: string | undefined; DelayDay?: number | undefined; InvType?: "07" | undefined; }; checkout(invoice?: InvoiceParams): Promise<string>; _placeOrder(invoice?: InvoiceParams): Promise<PaymentInfoData>; } export declare class CreditOneTimePayment extends Payment<CreditOneTimePaymentParams> { constructor(merchant: Merchant, baseParams: BasePaymentParams, params?: CreditOneTimePaymentParams); } export declare class CreditDividePayment extends Payment<CreditDividePaymentParams> { constructor(merchant: Merchant, baseParams: BasePaymentParams, params: CreditDividePaymentParams); } export declare class CreditPeriodPayment extends Payment<CreditPeriodPaymentParams> { constructor(merchant: Merchant, baseParams: BasePaymentParams, params: CreditPeriodPaymentParams); } export declare class WebATMPayment extends Payment<WebATMPaymentParams> { constructor(merchant: Merchant, baseParams: BasePaymentParams, params?: WebATMPaymentParams); } export declare class ATMPayment extends Payment<ATMPaymentParams> { constructor(merchant: Merchant, baseParams: BasePaymentParams, params?: ATMPaymentParams); placeOrder(invoice?: InvoiceParams): Promise<PaymentInfoData>; } export declare class CVSPayment extends Payment<CVSPaymentParams> { constructor(merchant: Merchant, baseParams: BasePaymentParams, params?: CVSPaymentParams); placeOrder(invoice?: InvoiceParams): Promise<PaymentInfoData>; } export declare class BARCODEPayment extends Payment<BARCODEPaymentParams> { constructor(merchant: Merchant, baseParams: BasePaymentParams, params?: BARCODEPaymentParams); placeOrder(invoice?: InvoiceParams): Promise<PaymentInfoData>; } export declare class AndroidPayPayment extends Payment<AndroidPayPaymentParams> { constructor(merchant: Merchant, baseParams: BasePaymentParams, params: AndroidPayPaymentParams); } export declare class ALLPayment extends Payment<Partial<ALLPaymentParams>> { constructor(merchant: Merchant, baseParams: BasePaymentParams, params: Partial<ALLPaymentParams>); }