Evc-Plus is a robust Node.js package that simplifies mobile payment processing through WaafiPay and provides utilities for Somali phone number formatting. Perfect for e-commerce applications and payment integrations in Somalia.
- 📱 Smart Phone Number Formatting: Automatically handles Somali phone number formats
- 💳 WaafiPay Integration: Seamless payment processing with WaafiPay
- ⚡ Promise-based API: Modern async/await support
- 🔒 Secure: Built with security best practices
- 🛠️ Easy Configuration: Simple setup with your WaafiPay credentials
Install via npm:
npm install evc-plus
Use the formatMerchantPhone
function to format Somali phone numbers to the standard format.
Use the payByWaafiPay
function to process payments through WaafiPay.
Create a .env
file in your project root with:
- MERCHANT_UID
- API_USER_ID
- API_KEY
Formats Somali phone numbers to the standard format.
Parameters:
phone
(string): Phone number in any format
Returns:
- Formatted phone number string
Processes a payment through WaafiPay.
Parameters:
options
(object):phone
(string): Customer's phone numberamount
(number): Payment amountmerchantUid
(string): Your merchant UIDapiUserId
(string): Your API user IDapiKey
(string): Your API keydescription?
(string): Payment descriptioninvoiceId?
(string): Invoice IDreferenceId?
(string): Reference IDcurrency?
(string): Currency code (default: "USD")
Returns:
- Promise resolving to
{ status: boolean, message?: string, error?: string }
The package includes comprehensive error handling:
- Invalid phone numbers
- API authentication errors
- Payment rejection scenarios
- Network issues
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
For support or inquiries:
- 📧 Email: abdilaahimowliid@gmail.com
- 🐛 Issues: GitHub Issues
Abdilaahi Dhaqane
- GitHub: @Dhaqane-00