africastalking
Advanced tools
Comparing version 0.5.9 to 0.6.0
@@ -30,6 +30,11 @@ 'use strict'; | ||
customAxios.airtime.sendAirtimeRequest({ | ||
recipients: JSON.stringify(recipients), | ||
maxNumRetry: options.maxNumRetry? Number(options.maxNumRetry) : "None" | ||
}) | ||
const requestBody = { | ||
recipients: JSON.stringify(recipients) | ||
}; | ||
if(options.maxNumRetry && (options.maxNumRetry > 0) ){ | ||
requestBody['maxNumRetry'] = Number(options.maxNumRetry); | ||
}; | ||
customAxios.airtime.sendAirtimeRequest(requestBody) | ||
.then(function (response) { | ||
@@ -36,0 +41,0 @@ if (response.status === 201) { |
{ | ||
"name": "africastalking", | ||
"version": "0.5.9", | ||
"version": "0.6.0", | ||
"description": "Official AfricasTalking node.js API wrapper", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -90,8 +90,11 @@ # Africa's Talking Node.js SDK | ||
- `airtime.send({ recipients })`: Send airtime to a bunch of phone numbers. `recipients`: An array of objects containing the following keys: | ||
- `airtime.send({ recipients })`: Send airtime to a bunch of phone numbers. | ||
- `recipients`: An array of objects containing the following keys: | ||
- `phoneNumber`: Recipient of airtime. `REQUIRED`. | ||
- `currencyCode`: 3-digit ISO format currency code. `REQUIRED`. | ||
- `amount`: Amount to charge. `REQUIRED`. | ||
- `maxNumRetry`: This is the number of times a request will be retried. It is equivalent to **minutes**. If you set a maxNumRetry of 4 that means your transaction will be retried 4 times consecutively in the next 4 minutes because retries are done after every minute. If you don't set maxNumRetry, the request will **NOT** be retried. `OPTIONAL`. | ||
- `maxNumRetry`: This allows you to specify the maximum number of retries in case of failed airtime deliveries due to various reasons such as telco unavailability. The default retry period is 8 hours and retries occur every 60seconds. For example, setting `maxNumRetry=4` means the transaction will be retried every 60seconds for the next 4 hours.`OPTIONAL`. | ||
- Example: | ||
@@ -113,3 +116,3 @@ | ||
], | ||
maxNumRetry: 4 // will be retried 4 times consecutively in the next 4 minutes | ||
maxNumRetry: 3, // Will retry the transaction every 60seconds for the next 3 hours. | ||
}); | ||
@@ -116,0 +119,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
134276
3346
395