Skip to content

Instantly share code, notes, and snippets.

<?php
const SOURCE = 'zniUqv9KavZegrPBrbkNt9YZJf4gjvn5kNG';
const DESTINATION = 'znmdTn1Fs3Uc1tBzdKqEswcymhAi3nNj2Xy';
const AMOUNT_PER_TX = 0.0001;
const FEE = 0.00001;
function send($tx, $balance) {
$in = new stdClass();
@ondrejnov
ondrejnov / example.php
Last active February 25, 2017 15:49
JsonRpcClient
<?php
define('API', 'https://HOST/api');
define('USERNAME', '******');
define('PASSWORD', '******');
$client = new SimpleJsonRpcClient(API);
$result = $client->login(['username' => USERNAME, 'password' => PASSWORD]);
$client->setAuthToken($result->token);
$result = $client->{'product.sell'}(['id' => 1, 'price' => 100]);
<html>
<body>
<form id="form" method="post" action="https://******.eetapp.cz/embed">
<input type="hidden" name="data" value='{"items":[{"title":"polozka 1","price":90,"amount":2,"dph":21},{"title":"polozka 2","price":"1000","amount":1,"dph":"21"}],"device":1,"reference":"OBJ1040","payment":1}' />
<input type="hidden" name="callback" value="window.location = 'https://vas-eshop.cz/eet/saved/?id=' + result.id + '&ref=' + result.reference + '&number=' + result.number" />
</form>
<script>
document.getElementById('form').submit();
</script>
</body>
@ondrejnov
ondrejnov / EETAppAPI.php
Last active April 1, 2019 17:43
EETAPP.cz API example
<?php
define('API', 'https://DOMAIN.eetapp.cz/api');
define('USERNAME', '******');
define('PASSWORD', '******');
$client = new SimpleJsonRpcClient(API);
// Prihlaseni
$result = $client->{'system.login'}(['username' => USERNAME, 'password' => PASSWORD]);
$client->setAuthToken($result->token);