当前位置: 首页>>代码示例>>PHP>>正文


PHP jsonRPCClient::getreceivedbyaccount方法代码示例

本文整理汇总了PHP中jsonRPCClient::getreceivedbyaccount方法的典型用法代码示例。如果您正苦于以下问题:PHP jsonRPCClient::getreceivedbyaccount方法的具体用法?PHP jsonRPCClient::getreceivedbyaccount怎么用?PHP jsonRPCClient::getreceivedbyaccount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jsonRPCClient的用法示例。


在下文中一共展示了jsonRPCClient::getreceivedbyaccount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: confirm_sent

 public function confirm_sent()
 {
     $this->load->model('checkout/order');
     $order_id = $this->session->data['order_id'];
     $order = $this->model_checkout_order->getOrder($order_id);
     $current_default_currency = "USD";
     $hazecoin_total = round($this->currency->convert($order['total'], $current_default_currency, "haze"), 4);
     require_once 'jsonRPCClient.php';
     $hazecoin = new jsonRPCClient('http://' . $this->config->get('hazecoin_rpc_username') . ':' . $this->config->get('hazecoin_rpc_password') . '@' . $this->config->get('hazecoin_rpc_address') . ':' . $this->config->get('hazecoin_rpc_port') . '/');
     try {
         $hazecoin_info = $hazecoin->getinfo();
     } catch (Exception $e) {
         $this->data['error'] = true;
     }
     $received_amount = $hazecoin->getreceivedbyaccount($this->config->get('hazecoin_prefix') . '_' . $order_id, 0);
     if (round((double) $received_amount, 4) >= round((double) $hazecoin_total, 4)) {
         $order = $this->model_checkout_order->getOrder($order_id);
         $this->model_checkout_order->confirm($order_id, $this->config->get('hazecoin_order_status_id'));
         echo true;
     } else {
         echo false;
     }
 }
开发者ID:HazeDev,项目名称:OpenCart_Hazecoin,代码行数:23,代码来源:hazecoin.php

示例2: jsonRPCClient

 if ($loaded === true || $blockchain == 'multi') {
     if ($blockchain != 'multi') {
         $bitcoind = new jsonRPCClient("http://" . $rpc_options[$blockchain]['username'] . ":" . $rpc_options[$blockchain]['password'] . "@" . $rpc_options[$blockchain]['host'] . ":" . $rpc_options[$blockchain]['port'] . "/");
         $raw = false;
         if ($debug && $bitcoind && $loaded) {
             $raw = $bitcoind->getinfo();
         }
     }
     if ($call == 'address') {
         $obj = ["address" => false, "blockchain" => $blockchain, "hash" => "N/A", "tx_count" => 0, "received" => 0, "balance" => 0, "raw" => []];
         if (isset($_GET['id']) && $_GET['id']) {
             $address = $_GET['id'];
             $obj['address'] = $address;
             $account_name = 'XXX_' . $address;
             $balance = $bitcoind->getbalance($account_name, 1, true);
             $received = $bitcoind->getreceivedbyaccount($account_name, 1);
             $address = $bitcoind->validateaddress($obj['address']);
             $txs = $bitcoind->listtransactions($account_name, 100, 0, true);
             foreach ($txs as $tx_key => $tx) {
                 $raw_tx = $bitcoind->getrawtransaction($tx['txid'], 1);
                 foreach ($raw_tx['vout'] as $output) {
                     if ($output['scriptPubKey']['addresses'][0] == $_GET['id']) {
                         $asm = explode(' ', $output['scriptPubKey']['asm']);
                         foreach ($asm as $op) {
                             if (substr($op, 0, 2) != 'OP') {
                                 $obj['hash'] = $op;
                             }
                         }
                     }
                 }
             }
开发者ID:blockstrap,项目名称:blockstrap.github.io,代码行数:31,代码来源:rpc.php


注:本文中的jsonRPCClient::getreceivedbyaccount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。