Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
Airtime
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Schedules
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
opensources
Airtime
Commits
fb3ab65c
Commit
fb3ab65c
authored
May 22, 2017
by
Camoo Sarl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Balance Module added
parent
f1e53dcc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
3 deletions
+59
-3
example-balance.php
examples/example-balance.php
+11
-0
Token.php
src/CAMOO/Authentifications/Token.php
+1
-1
Balance.php
src/CAMOO/Balance/Balance.php
+45
-0
Base.php
src/CAMOO/Base.php
+1
-1
CamooHttpClient.php
src/CAMOO/HttpClients/CamooHttpClient.php
+1
-1
No files found.
examples/example-balance.php
0 → 100644
View file @
fb3ab65c
<?php
require_once
(
'src/autoload.php'
);
$oBalance
=
new
\CAMOO\Balance\Balance
(
'592595095gh57'
,
'4e32da5979879b89479847b9798479494984'
);
// get current CAMOO Balance
var_dump
(
$oBalance
->
current
());
// recharge account via MTN Mobile Money Cameroon
$hData
=
[
'phonenumber'
=>
'671234567'
,
'amount'
=>
1000
];
var_dump
(
$oBalance
->
add
(
$hData
));
src/CAMOO/Authentifications/Token.php
View file @
fb3ab65c
...
...
@@ -6,7 +6,7 @@ namespace CAMOO\Authentifications;
* @copyright (c) camoo.cm
* @license: You are not allowed to sell or distribute this software without permission
* Copyright reserved
* File: src/CAMOO/Authentifications/
Credentials
.php
* File: src/CAMOO/Authentifications/
Token
.php
* updated: Mai 2017
* Created by: Epiphane Tchabom (e.tchabom@camoo.cm)
* Description: CAMOO API generate auth Token
...
...
src/CAMOO/Balance/Balance.php
0 → 100644
View file @
fb3ab65c
<?php
namespace
CAMOO\Balance
;
/**
*
* CAMOO SARL: http://www.camoo.cm
* @copyright (c) camoo.cm
* @license: You are not allowed to sell or distribute this software without permission
* Copyright reserved
* File: src/CAMOO/Balance/Balance.php
* updated: Mai 2017
* Created by: Epiphane Tchabom (e.tchabom@camoo.cm)
* Description: CAMOO Airtime API
*
* @link http://www.camoo.cm
*/
use
CAMOO\Client
;
class
Balance
extends
Client
{
public
function
__construct
(
$api_key
,
$api_secret
)
{
parent
::
__construct
(
$api_key
,
$api_secret
,
__CLASS__
);
}
/**
* read the current user balance
* @return mixed Balance
*/
public
function
current
()
{
return
$this
->
get
();
}
/**
* Initiate a recharge for an user account
* Only available for MTN Mobile Money Cameroon
*
* @param $hData, ['phonenumber' => '671234567', 'amount' => 1000]
* @return mixed Trx
*/
public
function
add
(
$hData
)
{
$this
->
oHttpClient
->
setResourceName
(
'topup'
);
return
$this
->
post
(
$hData
);
}
}
src/CAMOO/Base.php
View file @
fb3ab65c
...
...
@@ -88,7 +88,7 @@ class Base {
/**
* Target version for "Classic" Camoo API
*/
protected
$camooClassicApiVersion
=
'v
1
'
;
protected
$camooClassicApiVersion
=
'v
2
'
;
/**
* Returns the CAMOO API URL
*-
...
...
src/CAMOO/HttpClients/CamooHttpClient.php
View file @
fb3ab65c
...
...
@@ -26,7 +26,7 @@ class CamooHttpClient extends Base {
const
REQUEST_GET
=
'GET'
;
const
REQUEST_POST
=
'POST'
;
const
HTTP_NO_CONTENT
=
204
;
const
CLIENT_VERSION
=
'
1.2
.0'
;
const
CLIENT_VERSION
=
'
2.0
.0'
;
/**
* @var string
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment