Skip to content

Commit

Permalink
added paymentAmmount conversion in euros
Browse files Browse the repository at this point in the history
  • Loading branch information
Radoslav Radev committed May 17, 2024
1 parent e0e459f commit 2e54f8c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Backend/Account/Services/StripePaymentService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ public async Task<PaymentIntent> ConfirmPaymentAsync(string paymentIntentId, str
{
// Update the account balance only if payment succeeds
var account = _accountDbContext.Accounts.FirstOrDefault(a => a.AccId == Guid.Parse(accId));

decimal paymentAmountBackInEuros = paymentIntent.Amount / 100;
if (account != null)
{
account.Balance += paymentIntent.Amount;
account.Balance += paymentAmountBackInEuros;
await _accountDbContext.SaveChangesAsync();
}
}
Expand Down

0 comments on commit 2e54f8c

Please sign in to comment.