VNPAY Smart POS Provider
The VNPAY Smart POS provider integrates with VNPAY's Smart POS terminals - Android-based payment terminals with built-in card readers, printers, and connectivity.
Overview
| Attribute | Value |
|---|---|
| Provider Key | VNPAY_SMART_POS |
| Payment Method | 400_CARD |
| Settlement | T+1 |
| Hardware | VNPAY Smart Terminal |
Features
- All-in-one device - Card reader, printer, scanner
- Multiple card types - Chip, contactless, magnetic stripe
- Offline transactions - Store-and-forward capability
- Receipt printing - Built-in thermal printer
Terminal Models
| Model | Display | Connectivity | Card Support |
|---|---|---|---|
| SP600 | 5.5" Touch | 4G/WiFi/BT | Chip, NFC, MSR |
| SP800 | 8" Touch | 4G/WiFi/BT/Ethernet | Chip, NFC, MSR |
| SP200 | 2.4" | 4G/WiFi | Chip, NFC |
Configuration
Application Configuration
typescript
import { MQPayComponent, MQPayBindingKeys, IMQPayOptions } from '@nx-3rd/mq-pay';
class MyApplication extends BaseApplication {
preConfigure() {
this.bind<IMQPayOptions>({ key: MQPayBindingKeys.MQ_PAY_CLIENT_OPTIONS })
.toValue({
vnpaySmartPos: {
enable: true,
isDefault: false,
enableController: true,
// Required: VNPAY merchant code
merchantCode: 'your-merchant-code',
// Required: Terminal code
terminalCode: 'your-terminal-code',
// Required: Secret keys for checksum
secretKey: {
api: 'secret-for-api-requests', // For merchantorder, getorderdetail, cancelorder
ipn: 'secret-for-ipn-verification', // For IPN signature verification
},
// Environment flag
isProduction: process.env.NODE_ENV === 'production',
// Optional: Request timeout in ms (default: 90000)
timeout: 90000,
// Optional: Custom notification handler
onPaymentNotification: async (ipnData) => {
console.log('SmartPOS payment:', ipnData);
},
},
});
this.component(MQPayComponent);
}
}Configuration Options
| Option | Type | Required | Description |
|---|---|---|---|
enable | boolean | Yes | Enable this provider |
isDefault | boolean | Yes | Use as default provider |
enableController | boolean | Yes | Auto-register IPN endpoint |
merchantCode | string | Yes | VNPAY merchant code |
terminalCode | string | Yes | VNPAY terminal code |
secretKey.api | string | Yes | Secret for API requests |
secretKey.ipn | string | Yes | Secret for IPN verification |
isProduction | boolean | Yes | true for production environment |
timeout | number | No | Request timeout in ms (default: 90000) |
onPaymentNotification | function | No | Custom IPN handler callback |
Payment Flow
API Usage
typescript
const response = await paymentService.checkout({
source: { type: 'Order', id: 'order-uuid' },
payment: {
provider: 'VNPAY_SMART_POS',
method: '400_CARD',
total: 250000,
currency: 'VND',
},
});Card Networks
| Network | Chip | NFC | MSR |
|---|---|---|---|
| Visa | Yes | Yes | Yes |
| Mastercard | Yes | Yes | Yes |
| JCB | Yes | Yes | Yes |
| UnionPay | Yes | Yes | Yes |
| Napas | Yes | Yes | Yes |