Open oxenprogrammer opened 1 year ago
@DaggieBlanqx Is anything going to get done here?
### Airtime Am having issues on following the docs vs what the API is giving as feedback. The node js package which am using is also giving me a hard time since am using ES6. I would appreciate if the docs and packages can be updated as some of the dependencies are deprecated.
For someone using ES6. you can use the following code. You will need axios library, very awesome library in my opinion Say you have name the code below as Africastalking.js
`
import axios from "axios";
const AirtimeInstance = async () => {
return axios.create({ baseURL: 'https://api.africastalking.com', headers: { 'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded', 'apiKey':
${process.env.AfricasTalkingApiKey}
}, data : {'username' : 'bambaCredo'} }) }const sendAirtime = async (phone,amount) => { let request = await AirtimeInstance(); return request.post('version1/airtime/send', { username :
${process.env.AfricasTalkingUsername}
, maxNumRetry: 2, recipients : JSON.stringify([{phoneNumber: phone, amount:KES ${amount}
}]) }); }export default sendAirtime`
Then on calling the code, do
`import sendAirtime from "./Africastalking.js"
let result = await sendAirtime("+254105730XYZ","7"); console.log(result.data)`
Hope this helps someone. Its simple though
@oxenprogrammer the issue on callTo
parameter only initiating call to last number in array was resolved in v0.6.3. Kindly use the latest version.
Problem
Contributors to the AfricaIsTalking API would benefit from having clear and comprehensive guidelines on how to contribute effectively to the project. Currently, there is no contribution guide available, making it challenging for newcomers to get started and for existing contributors to follow best practices consistently.
Solution
We propose creating a Contribution Guide for the AfricaIsTalking API. This guide will provide step-by-step instructions and best practices for contributing to the project. It should cover topics such as:
Benefits
A well-structured contribution guide will have several advantages:
Onboarding New Contributors: Newcomers will find it easier to understand the project's workflow and coding standards, reducing the barrier to entry.
Consistency: Contributors will follow a consistent process when submitting contributions, making it easier for maintainers to review and merge changes.
Improved Code Quality: By providing guidelines for writing code and running tests, we can ensure that contributions meet the project's quality standards.
Community Growth: A clear contribution guide can attract more contributors, fostering a healthy and active open-source community.
Acceptance Criteria:
CONTRIBUTING.md
in the project repository.CONTRIBUTING.md
file.Additional Information:
We believe that providing a contribution guide will greatly enhance the development experience for all contributors and help the AfricaIsTalking API project thrive. Your input and contributions to creating this guide are highly appreciated.
Please feel free to discuss and offer suggestions related to this issue. Thank you for your support and dedication to the project!