Phriction DatingVIP Public Payment Application Project API Documentation api.commands History Version 1 vs 4
Version 1 vs 4
Version 1 vs 4
Content Changes
Content Changes
== api.commands ==
==== Description ====
Returns list of implemented commands
==== Input Parameters ====
None
==== Return ====
<table>
<tr><th>Name</th><th>Type</th><th>Description</th></tr>
<tr><td>result</td><td>array</td><td>List with implemented commands</td></tr>
</table>
==== Usage Example ====
```
<?php
require_once "curl_http_client/curl_http_client.php";
$curl = new Curl_HTTP_Client();
//setup payment url and timeout
$payment_url = 'https://dev-payment.datingvip.com';
$timeout = 30;
//generate post data
$post_data = array
(
'token' => 'some-token',
'password' => '130d04b8123456857e47b254ebfbb53f',
'command' => 'api.commands',
);
$response = $curl->send_post_data($payment_url, $post_data, null, $timeout);
if($response === false)
{
//handle errors
}
//decode json to get array
$response = json_decode($response, true);
var_dump($response);
?>
```
Excepted output after running this script should be:
```
array (size=9)
'code' => int 700
'status' => string 'Action completed succesfully' (length=28)
'command' => string 'api.commands' (length=12)
'result' =>
array (size=42)
0 => string 'api.client.log' (length=14)
1 => string 'api.commands' (length=12)
2 => string 'api.help' (length=8)
3 => string 'api.server.log' (length=14)
4 => string 'api.statuscodes' (length=15)
5 => string 'api.version' (length=11)
6 => string 'cards.add' (length=9)
7 => string 'cards.list' (length=10)
8 => string 'cards.update' (length=12)
9 => string 'dm.get.flow' (length=11)
10 => string 'dm.get.init' (length=11)
11 => string 'do.get.details' (length=14)
12 => string 'items.list' (length=10)
13 => string 'items.statistics' (length=16)
14 => string 'lb.get.epu' (length=10)
15 => string 'notifications.hash.validate' (length=27)
16 => string 'orders.list' (length=11)
17 => string 'overrides.delete' (length=16)
18 => string 'overrides.list' (length=14)
19 => string 'overrides.update' (length=16)
20 => string 'partner.info' (length=12)
21 => string 'partner.ip.add' (length=14)
22 => string 'partner.ip.del' (length=14)
23 => string 'partner.ip.list' (length=15)
24 => string 'partner.password.set' (length=20)
25 => string 'processor.accounts' (length=18)
26 => string 'processor.list' (length=14)
27 => string 'subscription.cancel' (length=19)
28 => string 'subscription.change' (length=19)
29 => string 'subscription.list' (length=17)
30 => string 'subscription.reactivate' (length=23)
31 => string 'subscription.rebill' (length=19)
32 => string 'subscription.statistics' (length=23)
33 => string 'transaction.finish' (length=18)
34 => string 'transaction.init' (length=16)
35 => string 'transaction.lastid' (length=18)
36 => string 'transaction.list' (length=16)
37 => string 'transaction.listsub' (length=19)
38 => string 'transaction.refund' (length=18)
39 => string 'transaction.statistics' (length=22)
40 => string 'transaction.verify' (length=18)
41 => string 'users.search' (length=12)
'request' =>
array (size=3)
'token' => string 'some-token' (length=10)
'password' => string '130d04b80a4196857e47b254ebfbb53f' (length=32)
'command' => string 'api.commands' (length=12)
'ts' => int 1399411073
'origin_ip' => string '178.149.27.234' (length=14)
'debug' => null
'errors' => null
```
== api.commands ==
==== Description ====
Returns list of implemented commands
==== Input Parameters ====
None
==== Return ====
<table>
<tr><th>Name</th><th>Type</th><th>Description</th></tr>
<tr><td>result</td><td>array</td><td>List with implemented commands</td></tr>
</table>
==== Usage Example ====
```
<?php
require_once "curl_http_client/curl_http_client.php";
$curl = new Curl_HTTP_Client();
//setup payment url and timeout
$payment_url = 'https://dev-payment.datingvip.com';
$timeout = 30;
//generate post data
$post_data = array
(
'token' => 'some-token',
'password' => '130d04b8123456857e47b254ebfbb53f',
'command' => 'api.commands',
);
$response = $curl->send_post_data($payment_url, $post_data, null, $timeout);
if($response === false)
{
//handle errors
}
//decode json to get array
$response = json_decode($response, true);
var_dump($response);
?>
```
Excepted output after running this script should be:
```
array (size=9)
'code' => int 700
'status' => string 'Action completed succesfully' (length=28)
'command' => string 'api.commands' (length=12)
'result' =>
array (size=42)
0 => string 'api.client.log' (length=14)
1 => string 'api.commands' (length=12)
2 => string 'api.help' (length=8)
3 => string 'api.server.log' (length=14)
4 => string 'api.statuscodes' (length=15)
5 => string 'api.version' (length=11)
6 => string 'cards.add' (length=9)
7 => string 'cards.list' (length=10)
8 => string 'cards.update' (length=12)
9 => string 'dm.get.flow' (length=11)
10 => string 'dm.get.init' (length=11)
11 => string 'do.get.details' (length=14)
12 => string 'items.list' (length=10)
13 => string 'items.statistics' (length=16)
14 => string 'lb.get.epu' (length=10)
15 => string 'notifications.hash.validate' (length=27)
16 => string 'orders.list' (length=11)
17 => string 'overrides.delete' (length=16)
18 => string 'overrides.list' (length=14)
19 => string 'overrides.update' (length=16)
20 => string 'partner.info' (length=12)
21 => string 'partner.ip.add' (length=14)
22 => string 'partner.ip.del' (length=14)
23 => string 'partner.ip.list' (length=15)
24 => string 'partner.password.set' (length=20)
25 => string 'processor.accounts' (length=18)
26 => string 'processor.list' (length=14)
27 => string 'subscription.cancel' (length=19)
28 => string 'subscription.change' (length=19)
29 => string 'subscription.list' (length=17)
30 => string 'subscription.reactivate' (length=23)
31 => string 'subscription.rebill' (length=19)
32 => string 'subscription.statistics' (length=23)
33 => string 'transaction.finish' (length=18)
34 => string 'transaction.init' (length=16)
35 => string 'transaction.lastid' (length=18)
36 => string 'transaction.list' (length=16)
37 => string 'transaction.listsub' (length=19)
38 => string 'transaction.refund' (length=18)
39 => string 'transaction.statistics' (length=22)
40 => string 'transaction.verify' (length=18)
41 => string 'users.search' (length=12)
'request' =>
array (size=3)
'token' => string 'some-token' (length=10)
'password' => string '130d04b80a4196857e47b254ebfbb53f' (length=32)
'command' => string 'api.commands' (length=12)
'ts' => int 1399411073
'origin_ip' => string '178.149.27.234' (length=14)
'debug' => null
'errors' => null
```