Impliment soft-payments

This commit is contained in:
2026-03-08 19:28:10 -07:00
parent 54ea7c3027
commit 78bdf250ff
7 changed files with 114 additions and 12 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
using Microsoft.Data.Sqlite;
namespace DataBase {
namespace Controllers.DataBase {
public class DbDriver {
@@ -0,0 +1,13 @@
namespace Controllers.Payment {
public interface IPayment {
// [ Success, ErrorMessage | ImpodentKey ]
public (bool, string) CreatePayment();
// [ Success, ErrorMessage ]
public (bool, string) TryPayment(string ImpodentKey, float Price);
}
}
@@ -0,0 +1,27 @@
namespace Controllers.Payment {
public class PaymentTestor : IPayment {
public static List<string> ImpodentKeys = new List<string>();
public (bool, string) CreatePayment() {
string guid = Guid.NewGuid().ToString();
ImpodentKeys.Add(guid);
return (true, guid);
}
public (bool, string) TryPayment(string ImpodentKey, float Price) {
try {
if (ImpodentKeys.Contains(ImpodentKey)) {
ImpodentKeys.Remove(ImpodentKey);
return (true, "");
} else {
return (false, "Payment session closed or never existed");
}
}catch(Exception e) {
return (false, e.ToString());
}
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
using Python.Runtime;
namespace PythonInterop {
namespace Controllers.PythonInterop {
public class AIModule {