Skip to content

Commit f1842ff

Browse files
committed
Update example; add required metadata to mobileData()
1 parent 9752364 commit f1842ff

File tree

4 files changed

+5
-358
lines changed

4 files changed

+5
-358
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Instantiating the class will give you an object with available methods
172172
- `quantity`: Mobile data amount. `REQUIRED`
173173
- `unit`: Mobile data unit. Can either be `MB` or `GB`. `REQUIRED`
174174
- `validity`: How long the mobile data is valid for. Must be one of `Daily`, `Weekly` and `Monthly`. `REQUIRED`
175-
- `metadata`: Additional data to associate with the tranasction.
175+
- `metadata`: Additional data to associate with the tranasction. `REQUIRED`
176176

177177
- **$options:** optional associative array with the following keys:
178178
- `idempotencyKey`: Key to use when making idempotent requests

example/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Simple SDK usage",
44
"require": {
55
"php": ">=5.3.0",
6-
"africastalking/africastalking": "2.2.0",
6+
"africastalking/africastalking": "dev-develop",
77
"altorouter/altorouter": "1.1.0"
88
}
99
}

example/composer.lock

Lines changed: 0 additions & 354 deletions
This file was deleted.

src/Payments.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,9 +579,10 @@ protected function doMobileData($parameters, $options = [])
579579
if (!isset($r['phoneNumber']) ||
580580
!isset($r['quantity']) ||
581581
!isset($r['unit']) ||
582-
!isset($r['validity'])) {
582+
!isset($r['validity']) ||
583+
!isset($r['metadata'])) {
583584

584-
return $this->error('recipients must be an array containing phoneNumber, quantity, unit, validity');
585+
return $this->error('recipients must be an array containing phoneNumber, quantity, unit, validity and metadata');
585586
}
586587

587588
if (isset($r['validity'])) {

0 commit comments

Comments
 (0)