Skip to content

Commit dd438dd

Browse files
author
Martin Steel
committed
Add account type to balance call
1 parent 283df64 commit dd438dd

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

class-Clockwork.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* Clockwork PHP API
44
*
55
* @package Clockwork
6-
* @copyright Mediaburst Ltd 2012
7-
* @license ISC
6+
* @copyright Mediaburst Ltd 2015
7+
* @license MIT
88
* @link http://www.clockworksms.com
9-
* @version 1.3.0
9+
* @version 1.3.2
1010
*/
1111

1212
if ( !class_exists('ClockworkException') ) {
@@ -24,7 +24,7 @@ class Clockwork {
2424
/*
2525
* Version of this class
2626
*/
27-
const VERSION = '1.3.1';
27+
const VERSION = '1.3.2';
2828

2929
/**
3030
* All Clockwork API calls start with BASE_URL
@@ -382,6 +382,7 @@ public function checkBalance() {
382382
$balance = null;
383383
$err_no = null;
384384
$err_desc = null;
385+
$account_type = null;
385386

386387
foreach ($resp_doc->documentElement->childNodes as $doc_child) {
387388
switch ($doc_child->nodeName) {
@@ -400,6 +401,9 @@ public function checkBalance() {
400401
}
401402
}
402403
break;
404+
case "AccountType":
405+
$account_type = $doc_child->nodeValue;
406+
break;
403407
case "ErrNo":
404408
$err_no = $doc_child->nodeValue;
405409
break;
@@ -415,7 +419,7 @@ public function checkBalance() {
415419
throw new ClockworkException($err_desc, $err_no);
416420
}
417421

418-
return array( 'symbol' => $symbol, 'balance' => $balance, 'code' => $code );
422+
return array( 'symbol' => $symbol, 'balance' => $balance, 'code' => $code, 'account_type' => $account_type );
419423
}
420424

421425
/**

0 commit comments

Comments
 (0)