Skip to content

Commit

Permalink
Merge pull request #300 from plivo/SMS-4946
Browse files Browse the repository at this point in the history
SMS-4946/SMS-4848: Add Is Domestic to Get and List Messages
  • Loading branch information
narayana-plivo authored Mar 7, 2023
2 parents 8d659f7 + cadeb05 commit 8f4d4b7
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 22 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Change Log
## [v4.43.0](https://github.com/plivo/plivo-php/tree/v4.43.0) (2023-03-03)
- Add `isDomestic` to the response for the [list all messages API](https://www.plivo.com/docs/sms/api/message/list-all-messages/) and the [get message details API](https://www.plivo.com/docs/sms/api/message#retrieve-a-message)

## [4.42.1](https://github.com/plivo/plivo-php/tree/v4.42.1) (2023-02-28)
-Added Exception handling for Retrieve all Calls API [Retrieve details of all calls](https://www.plivo.com/docs/voice/api/call#retrieve-all-calls)

Expand Down
6 changes: 6 additions & 0 deletions src/Plivo/Resources/Message/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* @property ?string $errorCode
* @property ?string $powerpackID
* @property ?string $requesterIP
* @property ?bool $isDomestic
*/
class Message extends Resource
{
Expand Down Expand Up @@ -70,10 +71,15 @@ public function __construct(
if (!empty($response['tendlc_campaign_id'])) {
$this->properties['tendlc_campaign_id'] = $response['tendlc_campaign_id'];
}

if (!empty($response['tendlc_registration_status'])) {
$this->properties['tendlc_registration_status'] = $response['tendlc_registration_status'];
}

if (isset($response['is_domestic'])){
$this->properties['isDomestic'] = $response['is_domestic'];
}

$this->pathParams = [
'authId' => $authId,
'messageUuid' => $response['message_uuid']
Expand Down
2 changes: 1 addition & 1 deletion src/Plivo/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Version
/**
* @const int PHP helper library minor version number
*/
const MINOR = 42;
const MINOR = 43;

/**
* @const int PHP helper library patch number
Expand Down
3 changes: 2 additions & 1 deletion tests/Mocks/messageGetResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"total_rate": "0.00250",
"units": 1,
"powerpack_id": "15c01cc2-4b9f-4d3b-bd15-3c4b38984cc4",
"requester_ip": "192.168.1.1"
"requester_ip": "192.168.1.1",
"is_domestic": false
}
60 changes: 40 additions & 20 deletions tests/Mocks/messageListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.1"
"requester_ip": "192.168.1.1",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -35,7 +36,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.2"
"requester_ip": "192.168.1.2",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -50,7 +52,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.3"
"requester_ip": "192.168.1.3",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -65,7 +68,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.4"
"requester_ip": "192.168.1.4",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -80,7 +84,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.5"
"requester_ip": "192.168.1.5",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -95,7 +100,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.6"
"requester_ip": "192.168.1.6",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -110,7 +116,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.7"
"requester_ip": "192.168.1.7",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -125,7 +132,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.8"
"requester_ip": "192.168.1.8",
"is_domestic": false
},
{
"error_code": "000",
Expand All @@ -140,7 +148,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.9"
"requester_ip": "192.168.1.9",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -155,7 +164,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.10"
"requester_ip": "192.168.1.10",
"is_domestic": false
},
{
"error_code": "000",
Expand All @@ -170,7 +180,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.11"
"requester_ip": "192.168.1.11",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -185,7 +196,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.12"
"requester_ip": "192.168.1.12",
"is_domestic": false
},
{
"error_code": "000",
Expand All @@ -200,7 +212,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.13"
"requester_ip": "192.168.1.13",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -215,7 +228,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.14"
"requester_ip": "192.168.1.14",
"is_domestic": false
},
{
"error_code": "000",
Expand All @@ -230,7 +244,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.15"
"requester_ip": "192.168.1.15",
"is_domestic": false
},
{
"error_code": null,
Expand All @@ -245,7 +260,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.16"
"requester_ip": "192.168.1.16",
"is_domestic": false
},
{
"error_code": "000",
Expand All @@ -260,7 +276,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.17"
"requester_ip": "192.168.1.17",
"is_domestic": false
},
{
"error_code": "000",
Expand All @@ -275,7 +292,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.18"
"requester_ip": "192.168.1.18",
"is_domestic": false
},
{
"error_code": "000",
Expand All @@ -290,7 +308,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.19"
"requester_ip": "192.168.1.19",
"is_domestic": false
},
{
"error_code": "000",
Expand All @@ -305,7 +324,8 @@
"total_amount": "0.00250",
"total_rate": "0.00250",
"units": 1,
"requester_ip": "192.168.1.20"
"requester_ip": "192.168.1.20",
"is_domestic": false
}
]
}

0 comments on commit 8f4d4b7

Please sign in to comment.