This repository has been archived on 2026-10-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
inside/api/test.php
T
2015-08-06 19:11:05 +02:00

30 lines
837 B
PHP

<?php
require_once("api_functions.php");
require_once("../includes/DB.php");
define("API_URL", 'http://inside.dev');
/* cardnumber.php */
function test_post_card() {
$data = json_encode(array(
'user_id' => '1',
'card_number' => '123456789'
));
$ch = curl_init(API_URL.'/api/card.php?apikey='.USER_API_KEY_KASSA);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING ,"");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=UTF-8'));
$result = curl_exec($ch);
var_dump($result);
$decoded_result = json_decode($result, true);
var_dump($decoded_result);
/* Register */
curl_close ($ch);
}
test_post_card();