From 2e54f8ce44385d4c6858a22d7d05986e7277f98e Mon Sep 17 00:00:00 2001 From: Radoslav Radev Date: Fri, 17 May 2024 20:27:48 +0200 Subject: [PATCH] added paymentAmmount conversion in euros --- Backend/Account/Services/StripePaymentService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Backend/Account/Services/StripePaymentService.cs b/Backend/Account/Services/StripePaymentService.cs index 287071b..8e9b3e1 100644 --- a/Backend/Account/Services/StripePaymentService.cs +++ b/Backend/Account/Services/StripePaymentService.cs @@ -97,9 +97,11 @@ public async Task 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(); } }