fix: api now returns payment info

This commit is contained in:
Damien Ostler 2024-02-24 21:55:24 -05:00
parent dcca20068e
commit 2af2fef7a0
3 changed files with 8 additions and 0 deletions

View File

@ -843,6 +843,8 @@ public class RequestsController : Controller
var paymentUrl = _paymentService.Charge(request.Id,request.Artist.StripeAccountId,Convert.ToDouble(request.Amount));
request.Accepted = true;
request.AcceptedDate = DateTime.UtcNow;
request.Paid = false;
request.PaymentUrl = paymentUrl;
_dbContext.Entry(request).State = EntityState.Modified;
await _dbContext.SaveChangesAsync();
var newTriggerModel = new EventCreateData()

View File

@ -14,4 +14,7 @@ public class RequestModel
public DateTime? DeclinedDate { get; set; }
public bool Completed { get; set; } = false;
public DateTime? CompletedDate { get; set; }
public string? PaymentUrl { get; set; }
public DateTime? PaidDate { get; set; }
public bool Paid { get; set; }
}

View File

@ -16,6 +16,9 @@ public static class RequestModelExtensions
CompletedDate = sellerProfile.CompletedDate,
Declined = sellerProfile.Declined,
DeclinedDate = sellerProfile.DeclinedDate,
Paid = sellerProfile.Paid,
PaidDate = sellerProfile.PaidDate,
PaymentUrl = sellerProfile.PaymentUrl,
Message = sellerProfile.Message
};
}