Go
Zeno Package for Go (Golang)
Effortlessly Integrate Payments with Zenopay
This package is an elegant solution for developers in the Golang community, designed and maintained by Dilunga the Great. The package simplifies interaction with the Zenopay API, making it easy to create payment orders and manage their statuses.
Features
Effortless integration with Zenopay API.
Background polling to check payment statuses.
Customizable callbacks for handling successful or failed payments.
Open-source and community-driven by Dilunga the Great.
Meet the Author
Dilunga the Great is a Tanzanian software engineer passionate about empowering people with tools that simplify their work. With expertise in Golang and a strong focus on simplifying tasks through code, he delivers this package to the Golang community to facilitate seamless payment workflows.
Contact Details:
WhatsApp: +255785453830
Email: thegreatdilunga@gmail.com
GitHub: github.com/dilungasr
Feel free to reach out for assistance, feedback, or collaboration opportunities!
How It Works
Step 1: Registration with ZenopayTo start using this package, register and verify your account with Zenopay. After successful registration, you'll receive the following credentials:
Account ID
API Key
Secret Key
Step 2: Install the Package
Quick Start Guide
1. Configure Zenopay API Credentials
Before creating a payment, configure the package with your API credentials.
2. Create a Payment Order
Use the Pay
function to create a payment order. It accepts payment details and a callback function for handling success or failure.
Detailed Function Documentation
ConfigAPI
Configures the Zenopay API with your credentials.
Parameters:
accountID
: Your Zenopay account ID.APIKey
: Your Zenopay API key.secreteKey
: Your Zenopay secret key.
Pay
Creates a payment order.
Parameters:
amount
: Payment amount (string).name
: Buyer's name.phone
: Buyer's phone number.email
: Buyer's email.callback
: Function called when the payment status is determined.
Returns:
orderID
: Unique identifier for the payment order.err
: Error, if any.
Polling in the Background
The package automatically polls the Zenopay API to check the payment status.
Polling Interval: Every 5 seconds.
Timeout: 50 seconds (aligns with Zenopay's USSD session expiry).
The
callback
function is invoked when:The payment succeeds (
ok = true
).The payment fails (
ok = false
).
Best Practices
Ensure your callback function handles both success and failure scenarios.
Use secure storage for your API credentials.
Polling runs in the background, so you can scale your HTTP handlers without blocking.
Why 50-Second Polling Timeout?
Zenopay automatically expires a user's USSD prompt session after 50 seconds. Polling every 5 seconds is the optimal interval to balance system performance and ensure timely updates.
Support and Contact
This package is written by Dilunga the Great for the Golang community and is open source.
GitHub Repository: github.com/dilungasr/zeno
Zenopay Official Website: https://zenopay.net/
Contact:
WhatsApp: +255742920510
Email: support@zenopay.net
Feel free to contribute, report issues, or contact me for further assistance.
License
This package is open-source, created for the Go community by Dilunga the Great. Feel free to contribute, report issues, or suggest enhancements on GitHub.
"Code is poetry, and simplicity is key." — Dilunga the Great
Happy Coding! 🎉
ZenoPay-Go
Last updated