Skip to content

Commit

Permalink
Update example; add required metadata to mobileData()
Browse files Browse the repository at this point in the history
  • Loading branch information
aksalj committed Jul 26, 2019
1 parent 9752364 commit f1842ff
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 358 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Instantiating the class will give you an object with available methods
- `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 `Daily`, `Weekly` and `Monthly`. `REQUIRED`
- `metadata`: Additional data to associate with the tranasction.
- `metadata`: Additional data to associate with the tranasction. `REQUIRED`

- **$options:** optional associative array with the following keys:
- `idempotencyKey`: Key to use when making idempotent requests
Expand Down
2 changes: 1 addition & 1 deletion example/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Simple SDK usage",
"require": {
"php": ">=5.3.0",
"africastalking/africastalking": "2.2.0",
"africastalking/africastalking": "dev-develop",
"altorouter/altorouter": "1.1.0"
}
}
354 changes: 0 additions & 354 deletions example/composer.lock

This file was deleted.

5 changes: 3 additions & 2 deletions src/Payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,10 @@ protected function doMobileData($parameters, $options = [])
if (!isset($r['phoneNumber']) ||
!isset($r['quantity']) ||
!isset($r['unit']) ||
!isset($r['validity'])) {
!isset($r['validity']) ||
!isset($r['metadata'])) {

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

if (isset($r['validity'])) {
Expand Down

0 comments on commit f1842ff

Please sign in to comment.