Phriction DatingVIP Public Payment Application Project API Documentation api.commands History Version 3 vs 4
Version 3 vs 4
Version 3 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/src/CurlHttpClient.php";
$curl = new \Dinke\CurlHttpClient;
//setup payment url and timeout
$payment_url = 'https://dev-payment.datingvip.com/api.json';
$timeout = 30;
//generate post data
$post_data = array
(
'cmd' => 'api.help',
'data' => array('cmd' => 'api.commands')
);
$curl->setCredentials('some-token', 'some-pass');
$response = $curl->sendPostData($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=1)
'result' =>
array (size=8)
'code' => int 700
'status' => string 'Action completed succesfully' (length=28)
'command' => string 'api.commands' (length=12)
'result' =>
array (size=48)
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.info' (length=10)
8 => string 'cards.list' (length=10)
9 => string 'cards.update' (length=12)
10 => string 'dm.get.flow' (length=11)
11 => string 'dm.get.init' (length=11)
12 => string 'do.get.details' (length=14)
13 => string 'gp.revoke' (length=9)
14 => string 'items.list' (length=10)
15 => string 'notifications.hash.validate' (length=27)
16 => string 'orders.lastid' (length=13)
17 => string 'orders.list' (length=11)
18 => string 'overrides.delete' (length=16)
19 => string 'overrides.list' (length=14)
20 => string 'overrides.types' (length=15)
21 => string 'overrides.update' (length=16)
22 => string 'partner.info' (length=12)
23 => string 'partner.ip.add' (length=14)
24 => string 'partner.ip.del' (length=14)
25 => string 'partner.ip.list' (length=15)
26 => string 'partner.password.set' (length=20)
27 => string 'processor.accounts' (length=18)
28 => string 'processor.list' (length=14)
29 => string 'processor.merchant.info' (length=23)
30 => string 'pw.payment.systems' (length=18)
31 => string 'subscription.cancel' (length=19)
32 => string 'subscription.change' (length=19)
33 => string 'subscription.lastid' (length=19)
34 => string 'subscription.list' (length=17)
35 => string 'subscription.reactivate' (length=23)
36 => string 'subscription.rebill' (length=19)
37 => string 'transaction.chargeback' (length=22)
38 => string 'transaction.delete.chargeback' (length=29)
39 => string 'transaction.finish' (length=18)
40 => string 'transaction.init' (length=16)
41 => string 'transaction.lastid' (length=18)
42 => string 'transaction.list' (length=16)
43 => string 'transaction.listsub' (length=19)
44 => string 'transaction.refund' (length=18)
45 => string 'transaction.update' (length=18)
46 => string 'transaction.verify' (length=18)
47 => string 'users.search' (length=12)
'request' =>
array (size=4)
'cmd' => string 'api.commands' (length=12)
'token' => string 'some-token' (length=26)
'pass' => string 'some-pass' (length=32)
'prefixes' => string 'api' (length=3)
'ts' => int 1429543494
'origin_ip' => string '93.87.220.184' (length=13)
'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/src/CurlHttpClient.php";
$curl = new \Dinke\CurlHttpClient;
//setup payment url and timeout
$payment_url = 'https://dev-payment.datingvip.com/api.json';
$timeout = 30;
//generate post data
$post_data = array
(
'cmd' => 'api.help',
'data' => array('cmd' => 'api.commands')
);
$curl->setCredentials('some-token', 'some-pass');
$response = $curl->sendPostData($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=1)
'result' =>
array (size=8)
'code' => int 700
'status' => string 'Action completed succesfully' (length=28)
'command' => string 'api.commands' (length=12)
'result' =>
array (size=48)
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.info' (length=10)
8 => string 'cards.list' (length=10)
9 => string 'cards.update' (length=12)
10 => string 'dm.get.flow' (length=11)
11 => string 'dm.get.init' (length=11)
12 => string 'do.get.details' (length=14)
13 => string 'gp.revoke' (length=9)
14 => string 'items.list' (length=10)
15 => string 'notifications.hash.validate' (length=27)
16 => string 'orders.lastid' (length=13)
17 => string 'orders.list' (length=11)
18 => string 'overrides.delete' (length=16)
19 => string 'overrides.list' (length=14)
20 => string 'overrides.types' (length=15)
21 => string 'overrides.update' (length=16)
22 => string 'partner.info' (length=12)
23 => string 'partner.ip.add' (length=14)
24 => string 'partner.ip.del' (length=14)
25 => string 'partner.ip.list' (length=15)
26 => string 'partner.password.set' (length=20)
27 => string 'processor.accounts' (length=18)
28 => string 'processor.list' (length=14)
29 => string 'processor.merchant.info' (length=23)
30 => string 'pw.payment.systems' (length=18)
31 => string 'subscription.cancel' (length=19)
32 => string 'subscription.change' (length=19)
33 => string 'subscription.lastid' (length=19)
34 => string 'subscription.list' (length=17)
35 => string 'subscription.reactivate' (length=23)
36 => string 'subscription.rebill' (length=19)
37 => string 'transaction.chargeback' (length=22)
38 => string 'transaction.delete.chargeback' (length=29)
39 => string 'transaction.finish' (length=18)
40 => string 'transaction.init' (length=16)
41 => string 'transaction.lastid' (length=18)
42 => string 'transaction.list' (length=16)
43 => string 'transaction.listsub' (length=19)
44 => string 'transaction.refund' (length=18)
45 => string 'transaction.update' (length=18)
46 => string 'transaction.verify' (length=18)
47 => string 'users.search' (length=12)
'request' =>
array (size=4)
'cmd' => string 'api.commands' (length=12)
'token' => string 'some-token' (length=26)
'pass' => string 'some-pass' (length=32)
'prefixes' => string 'api' (length=3)
'ts' => int 1429543494
'origin_ip' => string '93.87.220.184' (length=13)
'errors' => null
```