1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-06 03:50:04 +02:00

Adding Blockonomics payment method

This commit is contained in:
daniel 2019-03-04 14:19:59 -03:00
parent a462edb16b
commit 0da4a27e6d
2 changed files with 11 additions and 7 deletions

View file

@ -46,7 +46,7 @@ if ($status == 0 && time() > strtotime($order->getCreated()) + $obj->ExpireInSec
$new_status = -3; $new_status = -3;
print('expired'); print('expired');
} }
if ($status == 2 && $value != $order->getBits()) { if ($status == 2 && $value < $order->getBits()) {
//Payment error, amount paid not matching expected //Payment error, amount paid not matching expected
$new_status = -2; $new_status = -2;
} }

View file

@ -61,13 +61,13 @@ $order = new BlockonomicsOrder($order_id);
<br/> <br/>
<h2 ng-hide="invoice.status == -1">Payment Details: </h2> <h2>Payment Details: </h2>
<div ng-hide="invoice.status == -1" class="value ng-binding"> <div>
Received : <strong><?php echo $order->getFormatedBits_payed(); ?></strong> Received : <strong id="received"><?php echo $order->getFormatedBits_payed(); ?></strong>
<small>BTC</small> <small>BTC</small>
</div> </div>
<div ng-show="invoice.status != -1" class="value ng-binding" style="margin-bottom:10px;" > <div style="margin-bottom:10px;" >
Transaction : <a target="_blank" href="http://www.blockonomics.co/api/tx?txid={{invoice.txid}}&addr={{<?php echo $order->getAddr(); ?>}}">{{invoice.txid|limitTo: 20}}</a> Transaction : <span id="transaction"></span>
</div> </div>
</div> </div>
</div> </div>
@ -112,7 +112,11 @@ $order = new BlockonomicsOrder($order_id);
url: '<?php echo $global['webSiteRootURL']; ?>plugin/BlockonomicsYPT/check.php?addr=<?php echo $order->getAddr(); ?>', url: '<?php echo $global['webSiteRootURL']; ?>plugin/BlockonomicsYPT/check.php?addr=<?php echo $order->getAddr(); ?>',
success: function (response) { success: function (response) {
console.log(response); console.log(response);
setTimeout(function(){check();},3000); if(response.status<2){
$("#transaction").html('<a target="_blank" href="http://www.blockonomics.co/api/tx?txid='+response.txid+'&addr={{<?php echo $order->getAddr(); ?>}}">'+response.txid+'</a>');
$("#received").html(response.bits_payed);
setTimeout(function(){check();},3000);
}
} }
}); });
} }