@ignitech/modules-payment
v1.0.20
Published
Ignitech Modules - Payment and Checkout Components
Maintainers
Readme
@ignitech/modules-payment
Payment và Checkout module cho Ignitech websites.
Cài đặt
npm install @ignitech/modules-payment @ignitech/modules-utilsLưu ý: @ignitech/modules-utils là dependency bắt buộc.
Sử dụng
Payment Method
import { PaymentMethod } from '@ignitech/modules-payment';
<PaymentMethod
orderId="order-123"
websiteId="website-123"
apiBaseUrl="https://api.example.com"
onSuccess={(paymentCode) => console.log('Success:', paymentCode)}
/>Checkout Flow
import { CheckoutFlow } from '@ignitech/modules-payment';
<CheckoutFlow
websiteId="website-123"
apiBaseUrl="https://api.example.com"
currency="VND"
onComplete={(data) => console.log('Checkout complete:', data)}
/>Components
PaymentMethod- Payment method selection và processingCheckoutFlow- Complete checkout flow (one-page)ShippingAddress- Shipping address formShippingMethod- Shipping method selectionCartItemsList- Cart items displayOrderSummary- Order summary display
Hooks
usePayment- Hook để quản lý payment stateuseVietnameseAddress- Hook để lấy địa chỉ Việt Nam
Services
PaymentService- Service để xử lý paymentOrderService- Service để quản lý orders
Dependencies
@ignitech/modules-utils: Shared utilities và typeszod: ^3.22.4
Peer Dependencies
react: ^18.0.0react-dom: ^18.0.0
