Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

africastalking

Package Overview
Dependencies
Maintainers
4
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

africastalking - npm Package Compare versions

Comparing version 0.6.2 to 0.6.3

lib/utils.js

2

lib/actionbuilder.js
const validate = require('validate.js');
const _ = require('lodash');
const { phone: phoneValidator } = require('phone');
const { phoneValidator } = require('./utils');

@@ -6,0 +6,0 @@ class ActionBuilder {

'use strict';
const Joi = require('@hapi/joi');
const { phone: phoneValidator } = require('phone');
const { phoneValidator } = require('./utils');

@@ -6,0 +6,0 @@ const initializeAxios = require('./customAxios');

@@ -6,3 +6,3 @@ 'use strict';

const _ = require('lodash');
const { phone: phoneValidator } = require('phone');
const { phoneValidator } = require('./utils');

@@ -9,0 +9,0 @@

@@ -5,3 +5,3 @@ 'use strict';

const axios = require('axios');
const { phone: phoneValidator } = require('phone');
const { phoneValidator } = require('./utils');

@@ -8,0 +8,0 @@ const Common = require('./common');

{
"name": "africastalking",
"version": "0.6.2",
"version": "0.6.3",
"description": "Official AfricasTalking node.js API wrapper",

@@ -36,4 +36,4 @@ "main": "index.js",

"body-parser": "^1.19.1",
"google-libphonenumber": "^3.2.33",
"lodash": "^4.17.21",
"phone": "^3.1.29",
"querystring": "^0.2.0",

@@ -40,0 +40,0 @@ "validate.js": "^0.13.1"

@@ -9,3 +9,3 @@ # Africa's Talking Node.js SDK

Take a look at the [API docs here](http://developers.africastalking.com).
Take a look at the [API docs here](https://developers.africastalking.com).

@@ -15,3 +15,3 @@

You can install the package from [npm](npmjs.com/package/africastalking) by running:
You can install the package from [npm](https://npmjs.com/package/africastalking) by running:

@@ -66,4 +66,2 @@ ```bash

- [Payments Service](#paymentservice) : `AfricasTalking.PAYMENTS`
- [Voice Service](#voiceservice) : `AfricasTalking.VOICE`

@@ -87,3 +85,3 @@

For more information, please read [http://docs.africastalking.com/userdata/balance](http://docs.africastalking.com/userdata/balance)
For more information, please read [https://developers.africastalking.com/docs/application](https://developers.africastalking.com/docs/application)

@@ -123,3 +121,3 @@

For more information, please read [http://docs.africastalking.com/airtime/sending](http://docs.africastalking.com/airtime/sending)
For more information, please read [https://developers.africastalking.com/docs/airtime/sending](https://developers.africastalking.com/docs/airtime/sending)

@@ -201,142 +199,7 @@

For more information on:
- SMS service: [http://docs.africastalking.com/sms](http://docs.africastalking.com/sms)
- How to fetch subscriptions: [http://docs.africastalking.com/subscriptions/fetchsubscriptions](http://docs.africastalking.com/subscriptions/fetchsubscriptions)
- How to listen for subscription notifications: [http://docs.africastalking.com/subscriptions/callback](http://docs.africastalking.com/subscriptions/callback)
- SMS service: [https://developers.africastalking.com/docs/sms/overview](https://developers.africastalking.com/docs/sms/overview)
- How to fetch subscriptions: [https://developers.africastalking.com/docs/sms/premium_subscriptions/fetch](https://developers.africastalking.com/docs/sms/premium_subscriptions/fetch)
- How to listen for subscription notifications: [https://developers.africastalking.com/docs/sms/notifications](https://developers.africastalking.com/docs/sms/notifications)
### `PaymentService`
- `cardCheckoutCharge({ productName, paymentCard/checkoutToken, currencyCode, amount, narration, metadata })` Initiate a card checkout.
- `productName`: Your payment product. `REQUIRED`
- `paymentCard`: Card to charge.
- `checkoutToken`: Token from a previous successful transaction. Replaces `paymentCard`.
- `currencyCode`: 3-digit ISO format currency code. `REQUIRED`
- `amount`: Amount to charge. `REQUIRED`
- `narration`: Checkout description. `REQUIRED`
- `metadata`: Additional info to go with the checkout
- `cardCheckoutValidate({ transactionId, otp })` Validate a card checkout.
- `transactionId`: Transaction ID returned on charge request. `REQUIRED`
- `otp`: A user-provided OTP. `REQUIRED`
- `bankCheckoutCharge({ productName, bankAccount, currencyCode, amount, narration, metadata })` Initiate a bank checkout.
- `productName`: Your payment product. `REQUIRED`
- `bankAccount`: Bank account to charge. `REQUIRED`
- `currencyCode`: 3-digit ISO format currency code. `REQUIRED`
- `amount`: Amount to charge. `REQUIRED`
- `narration`: Checkout description. `REQUIRED`
- `metadata`: Additional info to go with the checkout
- `bankCheckoutValidate({ transactionId, otp })` Validate a bank checkout.
- `transactionId`: Transaction ID returned on charge request. `REQUIRED`
- `otp`: A user-provided OTP. `REQUIRED`
- `bankTransfer({ productName, recipients })` Initiate a bank transfer.
- `productName`: Your payment product. `REQUIRED`
- `recipients`: A list of banks to transfer to. `REQUIRED`
- `mobileCheckout({ productName, providerChannel, phoneNumber, currencyCode, amount, metadata })`: Initiate mobile checkout.
- `productName`: Your payment product. `REQUIRED`
- `providerChannel`: Provider channel to consider when charging.
- `phoneNumber`: Mobile wallet to charge. `REQUIRED`
- `currencyCode`: 3-digit ISO format currency code. `REQUIRED`
- `amount`: Amount to charge. `REQUIRED`
- `metadata`: Additional info to go with the checkout
- `mobileB2C({ productName, recipients })`: Send mobile money to consumer.
- `productName`: Your payment product. `REQUIRED`
- `recipients`: A list of consumers that will receive the money. `REQUIRED`
- `mobileB2B({ productName, provider, transferType, currencyCode, destinationChannel, destinationAccount, amount, requester, metadata })`: Send mobile money to busness.
- `productName`: Your payment product. `REQUIRED`
- `provider`: Provider used to process request. Checkout `payments.PROVIDER.*`. `REQUIRED`
- `transferType`: Checkout `payments.TRANSFER_TYPE.*`. `REQUIRED`
- `currencyCode`: 3-digit ISO format currency code. `REQUIRED`
- `destinationChannel`: Name or number of channel to receive payment. `REQUIRED`
- `destinationAccount`: Account name used to receive money. `REQUIRED`
- `amount`: Amount to transfer. `REQUIRED`
- `requester`: PhoneNumber through which KPLC will send tokens when using B2B to buy electricity tokens.
- `metadata`: Additional info to go with the transfer
- `mobileData(productName, recipients)`: Send mobile data to customers.
- `productName`: Payment product on Africa's Talking. `REQUIRED`
- `recipients`: A list of recipients. Each recipient has:
- `phoneNumber`: Customer phone number (in international format). `REQUIRED`
- `quantity`: Mobile data amount. `REQUIRED`
- `unit`: Mobile data unit. Can either be `MB` or `GB`. `REQUIRED`
- `validity`: How long the mobile data is valid for. Must be one of `Day`, `Week` and `Month`. `REQUIRED`
- `metadata`: Additional data to associate with the transaction. `REQUIRED`
- `walletTransfer({ productName, targetProductCode, currencyCode, amount, metadata })` Move money form one payment product to another.
- `productName`: Your payment product. `REQUIRED`
- `targetProductCode`: ID of recipient payment product on Africa's Talking. `REQUIRED`
- `currencyCode`: 3-digit ISO format currency code. `REQUIRED`
- `amount`: Amount to transfer. `REQUIRED`
- `metadata`: Additional info to go with the transfer. `REQUIRED`
- `topupStash({ productName, currencyCode, amount, metadata })` Move money from a Payment Product to an app's stash.
- `productName`: Your payment product. `REQUIRED`
- `currencyCode`: 3-digit ISO format currency code. `REQUIRED`
- `amount`: Amount to transfer. `REQUIRED`
- `metadata`: Additional info to go with the transfer. `REQUIRED`
- `fetchProductTransactions({ productName, filters })`: Fetch payment product transactions.
- `productName`: Your payment product. `REQUIRED`
- `filters`: Query filters. Includes:
- `pageNumber`: Page number to fetch results from. Starts from `1`. `REQUIRED`
- `count`: Number of results to fetch. `REQUIRED`
- `startDate`: Start Date to consider when fetching.
- `endDate`: End Date to consider when fetching.
- `category`: Category to consider when fetching.
- `prodiver`: Provider to consider when fetching.
- `status`: Status to consider when fetching.
- `source`: Source to consider when fetching.
- `destination`: Destination to consider when fetching.
- `providerChannel`: Provider channel to consider when fetching.
- `findTransaction({ transactionId })`: Find a particular transaction.
- `transactionId`: Transaction ID returned on charge request. `REQUIRED`
- `fetchWalletTransactions({ filters })`: Fetch wallet transactions.
- `filters`: Query filters. Includes:
- `pageNumber`: Page number to fetch results from. Starts from `1`. `REQUIRED`
- `count`: Number of results to fetch. `REQUIRED`
- `startDate`: Start Date to consider when fetching.
- `endDate`: End Date to consider when fetching.
- `categories`: Comma delimited list of categories to consider when fetching.
- `fetchWalletBalance()`: Fetch your wallet's balance
For more information, please read [http://docs.africastalking.com/payments](http://docs.africastalking.com/payments)
### `VoiceService`

@@ -366,3 +229,3 @@

For more information, please read [http://docs.africastalking.com/voice](http://docs.africastalking.com/voice) and [issue #15](https://github.com/AfricasTalkingLtd/africastalking-node.js/issues/15)
For more information, please read [https://developers.africastalking.com/docs/voice/overview](https://developers.africastalking.com/docs/voice/overview) and [issue #15](https://github.com/AfricasTalkingLtd/africastalking-node.js/issues/15)

@@ -378,3 +241,3 @@

For more information, please read [http://docs.africastalking.com/ussd](http://docs.africastalking.com/ussd)
For more information, please read [https://developers.africastalking.com/docs/ussd/overview](https://developers.africastalking.com/docs/ussd/overview)

@@ -381,0 +244,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc