add a validation for call back and fill Id in transaction Get details

This commit is contained in:
MahanCh
2025-07-19 13:28:00 +03:30
parent 64422755f2
commit be2333cac8
2 changed files with 6 additions and 0 deletions

View File

@@ -95,6 +95,7 @@ public class PaymentTransactionRepository : RepositoryBase<long, PaymentTransact
var result = new PaymentTransactionDetailsViewModel()
{
Id = transaction.id,
Amount = transaction.Amount,
CallBackUrl = transaction.CallBackUrl,
ContractingPartyId = transaction.ContractingPartyId,

View File

@@ -57,6 +57,11 @@ public class GeneralController : GeneralBaseController
return NotFound("Transaction not found");
}
if (transaction.Status != PaymentTransactionStatus.Pending)
{
return BadRequest("این تراکنش قبلا پرداخت شده است");
}
// اگر شماره کارت یا شماره پیگیری خالی باشد، تراکنش ناموفق است
if (string.IsNullOrWhiteSpace(cardnumber) || string.IsNullOrWhiteSpace(tracking_number))
{