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)); var paymentUrl = _paymentService.Charge(request.Id,request.Artist.StripeAccountId,Convert.ToDouble(request.Amount));
request.Accepted = true; request.Accepted = true;
request.AcceptedDate = DateTime.UtcNow; request.AcceptedDate = DateTime.UtcNow;
request.Paid = false;
request.PaymentUrl = paymentUrl;
_dbContext.Entry(request).State = EntityState.Modified; _dbContext.Entry(request).State = EntityState.Modified;
await _dbContext.SaveChangesAsync(); await _dbContext.SaveChangesAsync();
var newTriggerModel = new EventCreateData() var newTriggerModel = new EventCreateData()

View File

@ -14,4 +14,7 @@ public class RequestModel
public DateTime? DeclinedDate { get; set; } public DateTime? DeclinedDate { get; set; }
public bool Completed { get; set; } = false; public bool Completed { get; set; } = false;
public DateTime? CompletedDate { get; set; } 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, CompletedDate = sellerProfile.CompletedDate,
Declined = sellerProfile.Declined, Declined = sellerProfile.Declined,
DeclinedDate = sellerProfile.DeclinedDate, DeclinedDate = sellerProfile.DeclinedDate,
Paid = sellerProfile.Paid,
PaidDate = sellerProfile.PaidDate,
PaymentUrl = sellerProfile.PaymentUrl,
Message = sellerProfile.Message Message = sellerProfile.Message
}; };
} }