VietQR is a Golang library that simplifies the generation of QR codes for NAPAS payment integration in Vietnam. It provides a clean and efficient way to create payment QR codes that comply with the NAPAS VietQR standard.
- 🚀 Simple and intuitive API
- 💰 Support for all NAPAS VietQR payment fields
- 🔒 Type-safe implementation
- 📝 Comprehensive field validation
- 🎯 QR code generation for various payment scenarios
- 🔍 QR code parsing and validation
- 📚 Well-documented code
go get github.com/ducnpdev/vietqrpackage main
import (
"fmt"
"github.com/ducnpdev/vietqr"
)
func main() {
// Create a VietQR payment request
qrRequest := vietqr.RequestGenerateViQR{
MerchantAccountInformation: vietqr.MerchantAccountInformation{
AccountNo: "999990335280715",
},
TransactionAmount: "505000",
AdditionalDataFieldTemplate: vietqr.AdditionalDataFieldTemplate{
Description: "Payment for services",
},
Mcc: "5139",
ReceiverName: "Company ABC",
}
// Generate the VietQR code
qrContent := vietqr.GenerateViQR(qrRequest)
fmt.Println("Generated VietQR Content:", qrContent)
}qrRequest := vietqr.RequestGenerateViQR{
MerchantAccountInformation: vietqr.MerchantAccountInformation{
AccountNo: "999990335280715",
},
TransactionAmount: "100000",
AdditionalDataFieldTemplate: vietqr.AdditionalDataFieldTemplate{
Description: "Basic payment",
},
Mcc: "5139",
ReceiverName: "Merchant Name",
}qrRequest := vietqr.RequestGenerateViQR{
MerchantAccountInformation: vietqr.MerchantAccountInformation{
AccountNo: "999990335280715",
},
TransactionAmount: "200000",
AdditionalDataFieldTemplate: vietqr.AdditionalDataFieldTemplate{
Description: "Detailed payment information",
// Add more fields as needed
},
Mcc: "5139",
ReceiverName: "Merchant Name",
}The VietQR code follows the NAPAS standard structure. Here's an example of the QR code field breakdown:
- golang vietqr detech qr.
0002
01
0102
12
3859
0010
A000000727
0129
0006
970437
0115
999990335280715
0208
QRIBFTTA
5204
5139
5303
704
5406
50500
5802
VN
6217
0813
test noi dung
5907
Cty ABC
6304
33C4For detailed documentation about the VietQR standard, please refer to the official NAPAS documentation:
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
