· 6 years ago · Jun 26, 2019, 12:40 PM
1<?php
2require WP_DIR.'wp-blog-header.php';
3$secret_key = 'I took this off to protect info';
4$remote_url = 'I took this off to protect info ';
5
6$action = 'CREDIT';
7$account = 'email@example.com';
8$amount = 10;
9$ref = 'reference';
10$ref_id = 0;
11$entry = 'Points for viewing video';
12$data = 'optional extra';
13$point_type = 'Kanobia Credit';
14$host = get_bloginfo( 'url' );
15
16$token = md5( $host . $action . $amount . $secret_key );
17
18$request = array(
19 'method' => 'POST',
20 'body' => array(
21 'action' => $action,
22 'account' => $account,
23 'amount' => $amount,
24 'ref' => $ref,
25 'ref_id' => $ref_id,
26 'type' => $point_type,
27 'entry' => $entry,
28 'data' => $data,
29 'token' => $token,
30 'host' => $host
31 )
32);
33
34$response = wp_remote_post( $remote_url, $request );
35?>