Closed momostafa closed 1 month ago
Describe your task When I try to delete a transaction that is not confirmed i get below error
Bavix\Wallet\Exceptions\UnconfirmedInvalid Confirmation has already been reset
To Reproduce Steps to reproduce the behavior: I am using Filament v3.2.92 for rendering tables
Trace Error I don't have it...
Expected behavior I expect to be able to delete transactions record either confirmed or unconfirmed
Server:
my extended transaction model
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; use App\Models\User; use Bavix\Wallet\Traits\CanConfirm; use Kevupton\LaravelCoinpayments\Models\Transaction as CoinpaymentsTransaction; use Kevupton\LaravelCoinpayments\Coinpayments; class Transaction extends \Bavix\Wallet\Models\Transaction { use HasFactory; use CanConfirm; //use WatchableTrait; protected $fillable = [ 'payable_type', 'payable_id', 'wallet_id', 'uuid', 'type', 'amount', 'confirmed', 'meta', 'created_at', 'updated_at', ]; protected $casts = [ 'wallet_id' => 'int', 'confirmed' => 'bool', 'meta' => 'array', ]; public function owner(): BelongsTo { return $this->belongsTo(User::class, 'id', 'payable_id'); } public function wallet(): BelongsTo { return $this->belongsTo(Wallet::class); } public function onModelSaved(): void { optional($this->wallet)->refreshBalance(); } public static function refreshTransactionStatus($TxnId, $all = false) { $private_key = env('COINPAYMENTS_PRIVATE_KEY'); $public_key = env('COINPAYMENTS_PUBLIC_KEY'); $merchant_id = env('COINPAYMENTS_MERCHANT_ID'); $ipn_secret = env('COINPAYMENTS_IPN_SECRET'); $ipn_url = env('COINPAYMENTS_IPN_URL'); $transaction = new Coinpayments($private_key, $public_key, $merchant_id, $ipn_secret, $ipn_url,'json'); $txn_id = $transaction->getTransactionInfo($TxnId, $all); $status = $txn_id->getResponse()['result']['status']; $status_text = $txn_id->getResponse()['result']['status_text']; $error = $txn_id->getResponse()['error']; // dd($error); if($error == 'ok') { CoinpaymentsTransaction::where('txn_id', $TxnId)->update(['status' => $status, 'status_text' => $status_text]); $updated = 'Status:'. ' ' . $status_text; return $updated; } else { return $error; } } }
Thanks for your help and support
Yes, this is god related to adding soft delete. I'll fix it today or tomorrow.
Thank you for your quick response
@momostafa FYI. Tag 11.1.0
Thanks for your feedback
Thanks a lot I will update
Describe your task When I try to delete a transaction that is not confirmed i get below error
Bavix\Wallet\Exceptions\UnconfirmedInvalid Confirmation has already been reset
To Reproduce Steps to reproduce the behavior: I am using Filament v3.2.92 for rendering tables
Trace Error I don't have it...
Expected behavior I expect to be able to delete transactions record either confirmed or unconfirmed
Server:
my extended transaction model
Thanks for your help and support