From cbeba02e5901a3889cfc8fcecc7651df14cab49f Mon Sep 17 00:00:00 2001
From: Dominik Hebeler <dominik@hebeler.club>
Date: Thu, 6 Apr 2023 22:15:05 +0200
Subject: [PATCH] postgres config

---
 pass/app/Payment.js      | 5 +++--
 pass/config/default.json | 8 +++++++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/pass/app/Payment.js b/pass/app/Payment.js
index 2afa698..8f0cf6d 100644
--- a/pass/app/Payment.js
+++ b/pass/app/Payment.js
@@ -36,8 +36,8 @@ class Payment {
     this.id = payment_data.id;
     this.public_id =
       "A" + (payment_data.id + config.get("price.number_range.payments"));
-    this.price = payment_data.price;
-    this.converted_price = payment_data.converted_price;
+    this.price = parseFloat(payment_data.price);
+    this.converted_price = parseFloat(payment_data.converted_price);
     this.converted_currency = payment_data.converted_currency;
     this.payment_reference_id = payment_data.payment_reference_id;
     if (payment_data.payment_processor) {
@@ -76,6 +76,7 @@ class Payment {
    * @returns {number}
    */
   getBruttoPrice() {
+    console.log(this.price);
     return this.price.toFixed(2);
   }
 
diff --git a/pass/config/default.json b/pass/config/default.json
index 803f50f..4f915c1 100644
--- a/pass/config/default.json
+++ b/pass/config/default.json
@@ -4,7 +4,13 @@
     "secret": "dq+]Q64f?YLCC=Wsxn:0M.Kr`_t)",
     "api_token": "no-auth",
     "database": {
-      "pg_connection": "postgresql://metager:secure@express_postgres:5432/metager"
+      "pg_connection": {
+        "host": "express_postgres",
+        "port": 5432,
+        "user": "metager",
+        "password": "secure",
+        "database": "metager"
+      }
     },
     "openid_auth": {
       "url": "<OPEN ID Base URL>",
-- 
GitLab