2017-11-08 2 views
2

ブロックチェインを完全にコーディングしています。関連付けられたアカウントで金額が受信されましたが、ユーザーの残高は更新されませんでした。エラーが存在するかどうかを確認してください。 iamはなぜそれが起こっているのか理解できません。もし誰かがエラーを見つけたら、私はあまりにもあなたに感謝するでしょう。 BTCプレビュー用 コード:ブロックチェーンが動作していませんか?

@extends('layouts.user') 
@section('style') 

    <link rel="stylesheet" href="{{ asset('assets/dashboard/css/cus.css') }}"> 

@endsection 
@section('content') 

    <div class="row"> 
     <div class="col-md-12"> 
      <div class="panel panel-default panel-shadow" data-collapsed="0"><!-- to apply shadow add class "panel-shadow" --> 

       <!-- panel head --> 
       <div class="panel-heading"> 
        <div class="panel-title"><i class="fa fa-send"></i> <strong>{{ $page_title }}</strong></div> 
       </div> 

       <!-- panel body --> 
       <div class="panel-body"> 
        <div class="row"> 
         <div class="col-md-4"> 
          <div class="col-sm-12 text-center"> 
           <div class="panel panel-info"> 
            <div class="panel-heading"> 
             <h3 style="font-size: 28px;"><b> 
               @if($fund->payment_type == 1) 
                Paypal 
               @elseif($fund->payment_type == 2) 
                Perfect Money 
               @elseif($fund->payment_type == 3) 
                BTC - (BlockChain) 
               @else 
                Credit Card 
               @endif 
              </b></h3> 
            </div> 
            <div style="font-size: 18px;padding: 18px;" class="panel-body text-center"> 
             @if($fund->payment_type == 1) 
              @php $img = $payment->paypal_image @endphp 
             @elseif($fund->payment_type == 2) 
              @php $img = $payment->perfect_image @endphp 
             @elseif($fund->payment_type == 3) 
              @php $img = $payment->btc_image @endphp 
             @else 
              @php $img = $payment->stripe_image @endphp 
             @endif 
             <img width="100%" class="image-responsive" src="{{ asset('assets/images') }}/{{ $img }}" alt=""> 
            </div> 
            <hr> 
            <div class="panel-footer"> 
             <a href="{{ url('user/fund-add') }}" class="btn btn-info btn-block btn-icon icon-left"><i 
                class="fa fa-arrow-left"></i> Back to Payment Method Page</a> 
            </div> 
           </div> 
          </div> 
         </div> 
         <div class="col-md-8"> 
          <div class="panel panel-info panel-shadow" data-collapsed="0"><!-- to apply shadow add class "panel-shadow" --> 

           <!-- panel head --> 
           <div class="panel-heading"> 
            <div class="panel-title"><i class="fa fa-money"></i> <strong>{{ $page_title }}</strong></div> 
           </div> 
           <!-- panel body --> 
           <div class="panel-body"> 
            <div class="text-center"> 
             <h3>Current Balance : <strong>{{ Auth::user()->amount }} - {{ $basic->currency }}</strong></h3> 
            </div> 
            <hr> 
            <div class="row"> 
             <h4 style="text-align: center;"> SEND EXACTLY <strong>{{ $btc }} BTC </strong> TO <strong>{{ $add }}</strong><br> 
              {!! $code !!} <br> 
              <strong>SCAN TO SEND</strong> <br><br> 
              <strong style="color: red;">NB: 3 Confirmation required to Credited your Account</strong> 
             </h4> 
            </div> 
           </div> 
          </div> 
         </div> 
        </div> 
       </div> 

      </div> 
     </div> 
    </div><!---ROW--> 



@endsection 
@section('scripts') 


@endsection 

ここでは、IPNのコードです:

public function btcIPN() 
    { 
     $depoistTrack = $_GET['invoice_id']; 
     $secret = $_GET['secret']; 
     $address = $_GET['address']; 
     $value = $_GET['value']; 
     $confirmations = $_GET['confirmations']; 
     $value_in_btc = $_GET['value']/100000000; 

     $trx_hash = $_GET['transaction_hash']; 

     $DepositData = FundLog::whereTransaction_id($depoistTrack)->first(); 

     if ($DepositData->status == 0){ 

     if ($DepositData->btc_amo == $value_in_btc && $DepositData->btc_acc == $address && $secret=="ABIR" && $confirmations>2){ 

      $charge = $DepositData->fix + ($DepositData->amount * $DepositData->percent)/100; 
      $uuuu = User::findOrFail($DepositData->user_id); 

      // Fun Create 

      $fun['user_id'] = $DepositData->user_id; 
      $fun['payment_type'] = 1; 
      $fun['transaction_id'] = $DepositData->transaction_id; 
      $fun['amount'] = $DepositData->amount; 
      $fun['rate'] = $DepositData->rate; 
      $fun['charge'] = $charge; 
      $fun['total'] = $DepositData->btc_amo; 
      Fund::create($fun); 

      // User Log Create 

      $us['user_id'] = $DepositData->user_id; 
      $us['payment_type'] = 1; 
      $us['derails'] = "Fund Add via BlockChain. Transaction id : # ".$DepositData->transaction_id; 
      $us['balance'] = $DepositData->amount; 
      $us['charge'] = $charge; 
      $us['old_balance'] = $uuuu->amount; 
      $us['new_balance'] = $DepositData->amount + $us['old_balance']; 
      $uuuu->amount = $us['new_balance']; 
      $uuuu->save(); 
      UserBalance::create($us); 

      // Admin Log 

      $bas = BasicSetting::first(); 
      $ad['user_id'] = $DepositData->user_id; 
      $ad['payment_type'] = 3; //Blockchain 
      $ad['transaction_id'] = $DepositData->transaction_id; 
      $ad['balance'] = $DepositData->amount; 
      $ad['details'] = "Fund Deposit via BlockChain. Transaction ID : # ".$DepositData->transaction_id; 
      $ad['charge'] = $charge; 
      $ad['old_balance'] = $bas->admin_total; 
      $ad['new_balance'] = $bas->admin_total + $DepositData->amount + $charge; 
      AdminBalance::create($ad); 
      $bas->admin_total = $ad['new_balance']; 
      $bas->save(); 

      session()->flash('message','Fund Successfully Deposit.'); 
       session()->flash('type','success'); 
       session()->flash('title','Success'); 
       return redirect()->route('add-fund'); 
     } 
     } 
    } 

答えて

1

私はそれがこれを試して修正しています。

@extends('layouts.user') 
@section('style') 

    <link rel="stylesheet" href="{{ asset('assets/dashboard/css/cus.css') }}"> 

@endsection 
@section('content') 

    <div class="row"> 
     <div class="col-md-12"> 
      <div class="panel panel-default panel-shadow" data-collapsed="0"><!-- to apply shadow add class "panel-shadow" --> 

       <!-- panel head --> 
       <div class="panel-heading"> 
        <div class="panel-title"><i class="fa fa-send"></i> <strong>{{ $page_title }}</strong></div> 
       </div> 

       <!-- panel body --> 
       <div class="panel-body"> 
        <div class="row"> 
         <div class="col-md-4"> 
          <div class="col-sm-12 text-center"> 
           <div class="panel panel-info"> 
            <div class="panel-heading"> 
             <h3 style="font-size: 28px;"><b> 
               @if($fund->payment_type == 1) 
                Paypal 
               @elseif($fund->payment_type == 2) 
                Perfect Money 
               @elseif($fund->payment_type == 3) 
                BTC - (BlockChain) 
               @else 
                Credit Card 
               @endif 
              </b></h3> 
            </div> 
            <div style="font-size: 18px;padding: 18px;" class="panel-body text-center"> 
             @if($fund->payment_type == 1) 
              @php $img = $payment->paypal_image @endphp 
             @elseif($fund->payment_type == 2) 
              @php $img = $payment->perfect_image @endphp 
             @elseif($fund->payment_type == 3) 
              @php $img = $payment->btc_image @endphp 
             @else 
              @php $img = $payment->stripe_image @endphp 
             @endif 
             <img width="100%" class="image-responsive" src="{{ asset('assets/images') }}/{{ $img }}" alt=""> 
            </div> 
            <hr> 
            <div class="panel-footer"> 
             <a href="{{ url('user/fund-add') }}" class="btn btn-info btn-block btn-icon icon-left"><i 
                class="fa fa-arrow-left"></i> Back to Payment Method Page</a> 
            </div> 
           </div> 
          </div> 
         </div> 
         <div class="col-md-8"> 
          <div class="panel panel-info panel-shadow" data-collapsed="0"><!-- to apply shadow add class "panel-shadow" --> 

           <!-- panel head --> 
           <div class="panel-heading"> 
            <div class="panel-title"><i class="fa fa-money"></i> <strong>{{ $page_title }}</strong></div> 
           </div> 
           <!-- panel body --> 
           <div class="panel-body"> 
            <div class="text-center"> 
             <h3>Current Balance : <strong>{{ Auth::user()->amount }} - {{ $basic->currency }}</strong></h3> 
            </div> 
            <hr> 
            <div class="row"> 
             <h4 style="text-align: center;"> SEND EXACTLY <strong>{{ $btc }} BTC </strong> TO <strong>{{ $add }}</strong><br> 
              {!! $code !!} <br> 
              <strong>SCAN TO SEND</strong> <br><br> 
              <strong style="color: red;">NB: 3 Confirmation required to Credited your Account</strong> 
             </h4> 
            </div> 
           </div> 
          </div> 
         </div> 
        </div> 
       </div> 

      </div> 
     </div> 
    </div><!---ROW--> 



@endsection 
@section('scripts') 


@endsection 

here is ipn code: 

public function btcIPN() 
    { 
     $depoistTrack = $_GET['invoice_id']; 
     $secret = $_GET['secret']; 
     $address = $_GET['address']; 
     $value = $_GET['value']; 
     $confirmations = $_GET['confirmations']; 
     $value_in_btc = $_GET['value']/100000000; 

     $trx_hash = $_GET['transaction_hash']; 

     $DepositData = FundLog::whereTransaction_id($depoistTrack)->first(); 

     if ($DepositData->status == 0){ 

     if ($DepositData->btc_amo == $value_in_btc && $DepositData->btc_acc == $address && $secret=="ABIR" && $confirmations>2){ 

      $charge = $DepositData->fix + ($DepositData->amount * $DepositData->percent)/100; 
      $uuuu = User::findOrFail($DepositData->user_id); 

      // Fun Create 

      $fun['user_id'] = $DepositData->user_id; 
      $fun['payment_type'] = 1; 
      $fun['transaction_id'] = $DepositData->transaction_id; 
      $fun['amount'] = $DepositData->amount; 
      $fun['rate'] = $DepositData->rate; 
      $fun['charge'] = $charge; 
      $fun['total'] = $DepositData->btc_amo; 
      Fund::create($fun); 

      // User Log Create 

      $us['user_id'] = $DepositData->user_id; 
      $us['payment_type'] = 1; 
      $us['derails'] = "Fund Add via BlockChain. Transaction id : # ".$DepositData->transaction_id; 
      $us['balance'] = $DepositData->amount; 
      $us['charge'] = $charge; 
      $us['old_balance'] = $uuuu->amount; 
      $us['new_balance'] = $DepositData->amount + $us['old_balance']; 
      $uuuu->amount = $us['new_balance']; 
      $uuuu->save(); 
      UserBalance::create($us); 

      // Admin Log 

      $bas = BasicSetting::first(); 
      $ad['user_id'] = $DepositData->user_id; 
      $ad['payment_type'] = 3; //Blockchain 
      $ad['transaction_id'] = $DepositData->transaction_id; 
      $ad['balance'] = $DepositData->amount; 
      $ad['details'] = "Fund Deposit via BlockChain. Transaction ID : # ".$DepositData->transaction_id; 
      $ad['charge'] = $charge; 
      $ad['old_balance'] = $bas->admin_total; 
      $ad['new_balance'] = $bas->admin_total + $DepositData->amount + $charge; 
      AdminBalance::create($ad); 
      $bas->admin_total = $ad['new_balance']; 
      $bas->save(); 

      session()->flash('message','Fund Successfully Deposit.'); 
       session()->flash('type','success'); 
       session()->flash('title','Success'); 
       return redirect()->route('add-fund'); 
     } 
     } 
    } 
関連する問題