Difference between revisions of "Balance in phone"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 1: Line 1:
=Description=
Some phones and softphones support displaying your account balance on their screens.
Some phones and softphones support displaying your account balance on their screens.


Line 4: Line 6:


'''Note! Same URL is used for MOR Phone APP.'''
'''Note! Same URL is used for MOR Phone APP.'''
<br><br>
=Configuration=


In '''SETTINGS –> Setup –> Settings –> API –> Allow devices to check balance over HTTP''', check to allow this functionality:
1. Go to '''SETTINGS –> Setup –> Settings'''
<br><br>
[[File:settings_path.png]]
<br><br>
<!---This functionality is available from MOR 12--->
2. In API tab check the marked option:
<br><br>
[[File:Settings_various_balance_over_http.png]]
<br><br>


'''Please note:''' do not forget to enable the '''API''' on your system before you will use Balance in the Phone. If API will be not enabled you will see ''Balance:<?xml...'' instead of the real Balance.
'''Please note:''' do not forget to enable the '''API''' on your system before you will use Balance in the Phone. If API will be not enabled you will see ''Balance:<?xml...'' instead of the real Balance.
 
<br><br>
 
=Usage=


Log in as the user you want to check your balance:
Log in as the user you want to check your balance:
 
<br><br>
[[Image:bif2.png]]
[[Image:bif2.png]]
 
<br><br>
 
... and in Details you will see the link:
... and in Details you will see the link:
 
<br><br>
[[Image:bif3.png]]
[[Image:bif3.png]]
 
<br><br>
 
Copy and paste this link into the phone:
Copy and paste this link into the phone:
 
<br><br>
[[Image:bif4.png]]
[[Image:bif4.png]]
 
<br><br>
 
... and you will see your balance:
... and you will see your balance:
 
<br><br>
[[Image:bif5.png]]
[[Image:bif5.png]]
<br><br>
=Advanced options=


Optionaly you can send api request and specify currency, valid values are USER, in that case balance is returned in user's currency. And currency code(EUR, USD etc.)  
Optionaly you can send api request and specify currency, valid values are USER, in that case balance is returned in user's currency. And currency code(EUR, USD etc.)  
<br><br>
===Request===


  HTML POST: http://<SERVER_IP>/billing/api/simple_balance?id=UNIQUEHASH&currency={USER|CURRENCY_CODE}
  HTML POST: http://<SERVER_IP>/billing/api/simple_balance?id=UNIQUEHASH&currency={USER|CURRENCY_CODE}
<br><br>
===Returns===
'''Success'''


<html>
    <head></head>
    <body>60.0000</body>
</html>
<br><br>
<br><br>
= Errors =  
----
'''Errors'''
 
* Incorrect hash
 
<?xml version="1.0" encoding="UTF-8"?>
<status>
  <error>Incorrect hash</error>
</status>
 
* '''Allow devices to check balance over HTTP''' is not set
 
<html>
    <head></head>
    <body>Feature disabled</body>
</html>


== API Requests are disabled ==
* Your API is disabled.


It means that your API is disabled.
<?xml version="1.0" encoding="UTF-8"?>
<status>
  <error>API Requests are disabled</error>
</status>


Enable API in the MOR's SETTINGS under API section.
Enable API in the MOR's SETTINGS under API section.
<br><br>
=See also=
* [[MOR API]]
* [[MOR API user balance get]]

Revision as of 06:49, 27 May 2013

Description

Some phones and softphones support displaying your account balance on their screens.

For example, we will use iaxLite. Download link

Note! Same URL is used for MOR Phone APP.

Configuration

1. Go to SETTINGS –> Setup –> Settings

Settings path.png

2. In API tab check the marked option:

Settings various balance over http.png

Please note: do not forget to enable the API on your system before you will use Balance in the Phone. If API will be not enabled you will see Balance:<?xml... instead of the real Balance.

Usage

Log in as the user you want to check your balance:

Bif2.png

... and in Details you will see the link:

Bif3.png

Copy and paste this link into the phone:

Bif4.png

... and you will see your balance:

Bif5.png

Advanced options

Optionaly you can send api request and specify currency, valid values are USER, in that case balance is returned in user's currency. And currency code(EUR, USD etc.)

Request

HTML POST: http://<SERVER_IP>/billing/api/simple_balance?id=UNIQUEHASH&currency={USER|CURRENCY_CODE}



Returns

Success

    
    60.0000
 




Errors

  • Incorrect hash
<?xml version="1.0" encoding="UTF-8"?>
<status>
 <error>Incorrect hash</error>
</status>
  • Allow devices to check balance over HTTP is not set
    
    Feature disabled
 
  • Your API is disabled.
<?xml version="1.0" encoding="UTF-8"?>
<status>
  <error>API Requests are disabled</error>
</status>

Enable API in the MOR's SETTINGS under API section.

See also