-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.php
70 lines (61 loc) · 2.87 KB
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
// function getPoints() {
// $url = "https://india5.adscendmedia.com/adwall/api/publisher/24235/profile/9/user/faunas/transactions.json";
// $ch = curl_init($url);
// $options = array(
// CURLOPT_RETURNTRANSFER => true, // return web page
// CURLOPT_HEADER => false, // don't return headers
// CURLOPT_FOLLOWLOCATION => false, // follow redirects
// CURLOPT_ENCODING => "utf-8", // handle all encodings
// CURLOPT_AUTOREFERER => true, // set referer on redirect
// CURLOPT_CONNECTTIMEOUT => 20, // timeout on connect
// CURLOPT_TIMEOUT => 20, // timeout on response
// CURLOPT_HTTPGET => 1, // i am getting get data
// CURLOPT_SSL_VERIFYHOST => 0, // don't verify ssl
// CURLOPT_SSL_VERIFYPEER => false, //
// CURLOPT_VERBOSE => 1,
// );
// curl_setopt_array($ch, $options);
// $response = curl_exec($ch);
// curl_close($ch);
// $response = json_decode($response, true);
// $return = 0;
// if (isset($response['currency_count'])) {
// $return = $response['currency_count'];
// }
// $_SESSION['points'] = $return;
// return $return;
// }
// echo $points = getPoints();
// ==============================================
function createTransaction() {
$user_id = 'faunas';
$reward_amount = 2000;
$api_key = '$2y$10$Xa9H.eCQxmXrwu8WaKS0L.nMDr0W90ou0WY/1uFHmxP7/BIhIfuaG';
//$api_key = 'sY3C0wjWCxseKx8nCTRLrUr2tw96YXf6jz5wFspxBYJED2qkf2zydc9CiNhb';
$description = 'bentofox redeemed';
$params = '?api_key=' . $api_key . '¤cy_adjustment=' . $reward_amount . '&description=' . $description;
$url = "https://adscendmedia.com/adwall/api/publisher/24235/profile/9/user/faunas/transactions.json". $params;
$ch = curl_init($url);
$post_data = [24235, 9, $user_id];
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don't return headers
CURLOPT_FOLLOWLOCATION => false, // follow redirects
CURLOPT_ENCODING => "utf-8", // handle all encodings
CURLOPT_AUTOREFERER => true, // set referer on redirect
CURLOPT_CONNECTTIMEOUT => 20, // timeout on connect
CURLOPT_TIMEOUT => 20, // timeout on response
CURLOPT_POST => 1, // i am sending post data
CURLOPT_POSTFIELDS => $post_data, // this are my post vars
CURLOPT_SSL_VERIFYHOST => 0, // don't verify ssl
CURLOPT_SSL_VERIFYPEER => false, //
CURLOPT_VERBOSE => 1,
);
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
$trans = createTransaction();
print_r($trans);