27 lines
809 B
C#
27 lines
809 B
C#
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());
|
|
}
|
|
}
|
|
}
|
|
|
|
} |