php - Blocktrail API: Payments, always giving as canceled, and change the first line giving as processed. -
when buyer buys bitcoin first time, created txid in first line.. when buy bitcoin, payment in first line changed new txid (of new payment , processed) , new payments canceled.
i'm using laravel.
check in picture
payments canceled
the way have code this
$new = new webhook; $new->hash = $txdata['data']['hash']; $new->wallet = $wallet; $new->vezes = $semanas; $new->valor = blocktrailsdk::tobtc($txdata['data']['estimated_value']); $new->pagamento = $pagar; $new->save(); $user = wallets::where('wallet', $wallet)->get(); foreach($user $usuario){ $id = $usuario->id_user; $invest = investimento::where('wallet', $wallet)->first(); $invest->hash = $txdata['data']['hash']; $invest->id_user = $id; $invest->wallet = $wallet; $invest->deposito = blocktrailsdk::tobtc($txdata['data']['estimated_value']); $invest->status = 'pendente'; $invest->save(); }
i've used way
$invest = investimento::where(array('id_user' => $id, 'wallet' => $wallet));
but nothing done, result same.
Comments
Post a Comment