@litepos/payment
v1.0.9
Published
LitePOS payment gateway SDK - Core package
Readme
@litepos/payment
LitePOS Payment Gateway SDK - Core package
Overview
This is the core package of LitePOS payment gateway SDK. It provides unified interfaces and types for payment gateway integrations.
Features
- Unified payment interface for multiple gateways
- Type-safe payment operations
- Configuration validation
- Built-in simulator for testing
- Extensible adapter system
Installation
pnpm add @litepos/paymentUsage
import { LitePosPayment } from '@litepos/payment'
const payment = new LitePosPayment({
// Configuration will be added when integrations are implemented
})
// Charge payment
const result = await payment.charge({
method: 'fiuu-card',
amount: 100,
currency: 'MYR',
orderId: 'ORDER-001'
})
// Query payment status
const status = await payment.queryPayment('fiuu-card', result.transactionId)Architecture
This package provides:
- Core interfaces (
IPaymentAdapter) - Type definitions (
PaymentRequest,PaymentResponse, etc.) - Simulator for testing
- Main client class (
LitePosPayment) with built-in routing
Payment gateway specific implementations are provided by adapter packages (e.g., @litepos/payment-fiuu).
Development
# 在当前包目录
pnpm build # Build package
pnpm test # Run tests
# 从根目录运行
pnpm test # 测试所有包Status
Current version: 0.0.0 (Initial development)
The core package is ready. Payment gateway integrations will be added as separate adapter packages.
