5using System.Threading.Tasks;
59 internal static async Task ContractSigned(
Contract Contract,
bool ContractIsLocked,
60 Dictionary<CaseInsensitiveString, Parameter> TransientParameters,
69 switch (
Contract.ForMachinesLocalName)
74 case "PaymentInstructions":
78 foreach (XmlNode N
in Contract.ForMachinesParsed.DocumentElement.ChildNodes)
102 out
string PaymentLegalId, out
string PaymentJid))
108 ContractIsLocked, TransientParameters, Legal,
EDaler,
109 PaymentLegalId, PaymentJid);
115 out PaymentLegalId, out PaymentJid))
121 ContractIsLocked, TransientParameters, Legal,
EDaler,
122 PaymentLegalId, PaymentJid);
127 "Unrecognized content in payments contract: " +
Contract.ForMachinesLocalName,
135 private static async Task BuyEDaler(XmlElement Instructions,
Contract Contract,
bool ContractIsLocked,
136 Dictionary<CaseInsensitiveString, Parameter> TransientParameters,
LegalComponent Legal,
141 string ServiceId =
XML.
Attribute(Instructions,
"serviceId");
143 decimal? Amount =
null;
146 if (
string.IsNullOrEmpty(ServiceId))
172 foreach (XmlNode N
in Instructions.ChildNodes)
174 if (N is XmlElement E)
179 if (!(await GetParameterValue(E,
Contract) is decimal d))
189 if (!(await GetParameterValue(E,
Contract) is
string s))
205 if (!Amount.HasValue ||
string.IsNullOrEmpty(Currency))
211 if (Amount.Value <= 0)
224 if (!
EDaler.Server.IsServerDomain(PaymentAddress.
Domain,
true))
232 if (PaymentIdentity is
null)
240 if (
string.IsNullOrEmpty(Country))
267 (
EDaler.Server.Domain !=
"example.com" ||
277 Dictionary<CaseInsensitiveString, object> ContractParameters =
new Dictionary<CaseInsensitiveString, object>();
278 Dictionary<CaseInsensitiveString, CaseInsensitiveString> BuyerIdParameters =
new Dictionary<CaseInsensitiveString, CaseInsensitiveString>();
283 if (!(TransientParameters is
null))
285 foreach (KeyValuePair<CaseInsensitiveString, Parameter> P
in TransientParameters)
286 ContractParameters[P.Key] = P.Value.ObjectValue;
292 BuyEDaler(
Contract, ContractIsLocked, Amount.Value, Currency, Service, Legal,
EDaler,
301 private static async
void BuyEDaler(
Contract Contract,
bool ContractIsLocked,
304 string ContractId, Dictionary<CaseInsensitiveString, object> ContractParameters,
305 Dictionary<CaseInsensitiveString, CaseInsensitiveString> BuyerIdParameters)
309 if (!
string.IsNullOrEmpty(ContractId) && !ContractParameters.ContainsKey(nameof(ContractId)))
310 ContractParameters[nameof(ContractId)] = ContractId;
313 BuyerIdParameters, Amount, Currency,
null,
null,
null, async (Sender, e) =>
317 StringBuilder Xml = new StringBuilder();
319 Xml.Append(
"<buyEDalerClientUrl xmlns='");
320 Xml.Append(EDalerComponent.NamespaceEDaler);
321 Xml.Append(
"' tid='");
322 Xml.Append(XML.Encode(Contract.ContractId));
323 Xml.Append(
"' url='");
324 Xml.Append(XML.Encode(e.Url));
327 await EDaler.Server.SendMessage(string.Empty, string.Empty, EDaler.MainDomain,
328 new XmppAddress(JID), string.Empty, Xml.ToString());
338 StringBuilder Uri =
new StringBuilder();
339 DateTime Expires = Contract.Duration.HasValue ? (DateTime.Today +
Contract.Duration.Value) : DateTime.Today.AddDays(365);
340 Guid Id = Guid.NewGuid();
341 DateTime Created = DateTime.UtcNow;
343 Uri.Append(
"edaler:is=");
344 Uri.Append(
EDaler.Server.Domain);
346 Uri.Append(PaymentLegalId);
348 Uri.Append(Id.ToString());
354 Uri.Append(Currency);
358 Uri.Append(Convert.ToBase64String(Encoding.UTF8.GetBytes(
"iotsc:" +
Contract.
ContractId)));
362 string Msg = await ProcessPayment(Uri.ToString(),
EDaler);
363 if (!
string.IsNullOrEmpty(Msg))
375 internal static async Task<PaymentResult> BuyEDaler(decimal Amount,
string Currency,
string SuccessUrl,
string FailureUrl,
string CancelUrl,
377 Dictionary<CaseInsensitiveString, object> ContractParameters, Dictionary<CaseInsensitiveString, CaseInsensitiveString> BuyerIdParameters,
378 string Reference, EventHandlerAsync<ClientUrlEventArgs> ClientUrlCallback,
object State)
382 if (!
string.IsNullOrEmpty(ContractId) && !ContractParameters.ContainsKey(nameof(ContractId)))
383 ContractParameters[nameof(ContractId)] = ContractId;
386 Amount, Currency, SuccessUrl, FailureUrl, CancelUrl, ClientUrlCallback, State);
391 StringBuilder Uri =
new StringBuilder();
392 DateTime Expires = DateTime.Today.AddDays(365);
393 Guid Id = Guid.NewGuid();
394 DateTime Created = DateTime.UtcNow;
396 Uri.Append(
"edaler:is=");
397 Uri.Append(
EDaler.Server.Domain);
399 Uri.Append(PaymentLegalId);
401 Uri.Append(Id.ToString());
411 if (!
string.IsNullOrEmpty(Reference))
414 Uri.Append(Convert.ToBase64String(Encoding.UTF8.GetBytes(Reference)));
419 string Msg = await ProcessPayment(Uri.ToString(),
EDaler);
420 if (!
string.IsNullOrEmpty(Msg))
435 private static async Task SellEDaler(XmlElement Instructions,
Contract Contract,
bool ContractIsLocked,
436 Dictionary<CaseInsensitiveString, Parameter> TransientParameters,
LegalComponent Legal,
441 string ServiceId =
XML.
Attribute(Instructions,
"serviceId");
443 decimal? Amount =
null;
446 if (
string.IsNullOrEmpty(ServiceId))
472 foreach (XmlNode N
in Instructions.ChildNodes)
474 if (N is XmlElement E)
479 if (!(await GetParameterValue(E,
Contract) is decimal d))
489 if (!(await GetParameterValue(E,
Contract) is
string s))
505 if (!Amount.HasValue ||
string.IsNullOrEmpty(Currency))
511 if (Amount.Value <= 0)
524 if (!
EDaler.Server.IsServerDomain(PaymentAddress.
Domain,
true))
532 if (PaymentIdentity is
null)
540 if (
string.IsNullOrEmpty(Country))
567 (
EDaler.Server.Domain !=
"example.com" ||
577 Dictionary<CaseInsensitiveString, object> ContractParameters =
new Dictionary<CaseInsensitiveString, object>();
578 Dictionary<CaseInsensitiveString, CaseInsensitiveString> SellerIdParameters =
new Dictionary<CaseInsensitiveString, CaseInsensitiveString>();
583 if (!(TransientParameters is
null))
585 foreach (KeyValuePair<CaseInsensitiveString, Parameter> P
in TransientParameters)
586 ContractParameters[P.Key] = P.Value.ObjectValue;
592 SellEDaler(
Contract, ContractIsLocked, Amount.Value, Currency, Service, Legal,
EDaler,
601 internal static async
void SellEDaler(
Contract Contract,
bool ContractIsLocked, decimal Amount,
string Currency,
603 string PaymentLegalId,
string ContractId, Dictionary<CaseInsensitiveString, object> ContractParameters,
604 Dictionary<CaseInsensitiveString, CaseInsensitiveString> SellerIdParameters)
608 if (!
string.IsNullOrEmpty(ContractId) && !ContractParameters.ContainsKey(nameof(ContractId)))
609 ContractParameters[nameof(ContractId)] = ContractId;
611 StringBuilder Uri =
new StringBuilder();
612 DateTime Expires = Contract.Duration.HasValue ? (DateTime.Today +
Contract.Duration.Value) : DateTime.Today.AddDays(365);
613 Guid Id = Guid.NewGuid();
614 DateTime Created = DateTime.UtcNow;
616 Uri.Append(
"edaler:xx=");
617 Uri.Append(
EDaler.Server.Domain);
619 Uri.Append(PaymentLegalId);
621 Uri.Append(Id.ToString());
627 Uri.Append(Currency);
631 Uri.Append(Convert.ToBase64String(Encoding.UTF8.GetBytes(
"iotsc:" +
Contract.
ContractId)));
637 string Msg = await ProcessPayment(Uri.ToString(),
EDaler);
638 if (!
string.IsNullOrEmpty(Msg))
645 SellerIdParameters, Amount, Currency,
null,
null,
null,
null,
null);
651 Created = DateTime.UtcNow;
653 Uri.Append(
"edaler:is=");
654 Uri.Append(
EDaler.Server.Domain);
656 Uri.Append(PaymentLegalId);
658 Uri.Append(Id.ToString());
664 Uri.Append(Currency);
668 Uri.Append(Convert.ToBase64String(Encoding.UTF8.GetBytes(
"iotsc:" +
Contract.
ContractId)));
672 Msg = await ProcessPayment(Uri.ToString(),
EDaler);
673 if (
string.IsNullOrEmpty(Msg))
679 ". Furthermore, unable to re-issue eDaler: " + Msg +
680 ". Contact operator.",
true, Legal,
EDaler);
692 internal static async Task<PaymentResult> SellEDaler(decimal Amount,
string Currency,
string SuccessUrl,
string FailureUrl,
string CancelUrl,
694 string SignaturesContractId, Dictionary<CaseInsensitiveString, object> ContractParameters,
695 Dictionary<CaseInsensitiveString, CaseInsensitiveString> SellerIdParameters,
696 string Reference, EventHandlerAsync<ClientUrlEventArgs> ClientUrlCallback,
object State)
700 if (!
string.IsNullOrEmpty(SignaturesContractId) && !ContractParameters.ContainsKey(nameof(SignaturesContractId)))
701 ContractParameters[nameof(SignaturesContractId)] = SignaturesContractId;
703 StringBuilder Uri =
new StringBuilder();
704 DateTime Expires = DateTime.Today.AddDays(365);
705 Guid Id = Guid.NewGuid();
706 DateTime Created = DateTime.UtcNow;
708 Uri.Append(
"edaler:xx=");
709 Uri.Append(
EDaler.Server.Domain);
711 Uri.Append(PaymentLegalId);
713 Uri.Append(Id.ToString());
719 Uri.Append(Currency);
723 if (!
string.IsNullOrEmpty(Reference))
726 Uri.Append(Convert.ToBase64String(Encoding.UTF8.GetBytes(Reference)));
729 if (!
string.IsNullOrEmpty(SignaturesContractId))
732 Uri.Append(SignaturesContractId);
737 string Msg = await ProcessPayment(Uri.ToString(),
EDaler);
738 if (!
string.IsNullOrEmpty(Msg))
742 SuccessUrl, FailureUrl, CancelUrl, ClientUrlCallback, State);
748 Created = DateTime.UtcNow;
750 Uri.Append(
"edaler:is=");
751 Uri.Append(
EDaler.Server.Domain);
753 Uri.Append(PaymentLegalId);
755 Uri.Append(Id.ToString());
761 Uri.Append(Currency);
765 Uri.Append(Convert.ToBase64String(Encoding.UTF8.GetBytes(Reference)));
769 Msg = await ProcessPayment(Uri.ToString(),
EDaler);
770 if (
string.IsNullOrEmpty(Msg))
775 ". Furthermore, unable to re-issue eDaler: " + Msg +
776 ". Contact operator.");
792 Guid Id = Guid.NewGuid();
795 string Currency =
null;
796 string Reference =
null;
798 decimal? Amount =
null;
799 decimal? AmountExtra =
null;
800 double? ValidDays =
null;
802 foreach (XmlNode N
in Payment.ChildNodes)
810 FromLegalId = GetLegalId(E,
Contract);
811 if (FromLegalId is
null)
819 ToLegalId = GetLegalId(E,
Contract);
820 if (ToLegalId is
null)
828 if (!(await GetParameterValue(E,
Contract) is decimal d))
839 if (!(await GetParameterValue(E,
Contract) is decimal d2))
849 if (!(await GetParameterValue(E,
Contract) is
string s))
859 if (!(await GetParameterValue(E,
Contract) is decimal d3))
865 ValidDays = (double)d3;
869 if (!(await GetParameterValue(E,
Contract) is
string s2))
879 if (!(await GetParameterValue(E,
Contract) is
string s3))
885 int i = s3.IndexOf(
'@');
886 if (i < 0 || !Guid.TryParse(s3[..i], out Guid
_))
892 ConditionContractId = s3;
897 if (FromLegalId is
null || ToLegalId is
null || Currency is
null || !Amount.HasValue || !ValidDays.HasValue || Reference is
null)
903 string Uri = GenerateContractualPaymentUri(Id, FromLegalId,
true, ToLegalId,
true, Currency, Amount.Value, AmountExtra, Reference,
906 Payment PaymentInstance =
new Payment()
910 FromLegalId = FromLegalId,
911 ToLegalId = ToLegalId,
912 Amount = Amount.
Value,
913 AmountExtra = AmountExtra,
915 ConditionContractId = ConditionContractId,
918 Reference = Reference,
923 QueueForProcessing(PaymentInstance,
EDaler);
926 internal static string GenerateContractualPaymentUri(Guid Id,
string From,
bool FromIsLegalId,
string To,
bool ToIsLegalId,
string Currency,
927 decimal Amount, decimal? AmountExtra,
string Reference,
string ContractId,
string ConditionContractId,
double ValidDays,
928 out DateTime Created, out DateTime Expires)
930 StringBuilder Uri =
new StringBuilder();
932 Created = DateTime.UtcNow;
933 Expires = Created.AddDays(ValidDays);
935 Uri.Append(
"edaler:id=");
936 Uri.Append(Id.ToString());
952 Uri.Append(Currency);
956 if (AmountExtra.HasValue)
967 Uri.Append(Convert.ToBase64String(Encoding.UTF8.GetBytes(Reference)));
969 Uri.Append(ContractId);
971 if (!
string.IsNullOrEmpty(ConditionContractId))
974 Uri.Append(ConditionContractId);
979 return Uri.ToString();
982 internal static string GenerateReserveAmountUri(Guid Id,
string From,
bool FromIsLegalId,
string Currency,
983 decimal Amount,
string Reference,
string ContractId,
double ValidDays, out DateTime Created, out DateTime Expires)
985 StringBuilder Uri =
new StringBuilder();
987 Created = DateTime.UtcNow;
988 Expires = Created.AddDays(ValidDays);
990 Uri.Append(
"edaler:id=");
991 Uri.Append(Id.ToString());
1000 Uri.Append(Currency);
1008 Uri.Append(Convert.ToBase64String(Encoding.UTF8.GetBytes(Reference)));
1010 if (!
string.IsNullOrEmpty(ContractId))
1013 Uri.Append(ContractId);
1018 return Uri.ToString();
1021 private static void SignUri(StringBuilder Uri)
1023 byte[] PreSign = Encoding.UTF8.GetBytes(Uri.ToString());
1027 Uri.Append(Convert.ToBase64String(S));
1030 internal static string GenerateReleaseAmountUri(Guid Id,
string To,
bool ToIsLegalId,
string Currency,
1031 decimal Amount,
string Reference,
string ContractId,
double ValidDays, out DateTime Created, out DateTime Expires)
1033 StringBuilder Uri =
new StringBuilder();
1035 Created = DateTime.UtcNow;
1036 Expires = Created.AddDays(ValidDays);
1038 Uri.Append(
"edaler:id=");
1039 Uri.Append(Id.ToString());
1048 Uri.Append(Currency);
1056 Uri.Append(Convert.ToBase64String(Encoding.UTF8.GetBytes(Reference)));
1058 if (!
string.IsNullOrEmpty(ContractId))
1061 Uri.Append(ContractId);
1066 return Uri.ToString();
1078 foreach (XmlNode N
in Part.ChildNodes)
1080 if (!(N is XmlElement E))
1083 switch (E.LocalName)
1085 case "RoleReference":
1086 if (
Contract.ClientSignatures is
null)
1090 if (
string.IsNullOrEmpty(
Role))
1093 string Result =
null;
1120 List<CaseInsensitiveString> Result =
null;
1123 foreach (XmlNode N
in Part.ChildNodes)
1125 if (!(N is XmlElement E))
1128 switch (E.LocalName)
1130 case "RoleReference":
1131 if (
Contract.ClientSignatures is
null)
1135 if (
string.IsNullOrEmpty(
Role))
1142 Result ??=
new List<CaseInsensitiveString>();
1150 return Result?.ToArray();
1153 internal static Task<object> GetParameterValue(XmlElement Value,
Contract Contract)
1155 return GetParameterValue(Value,
Contract,
true);
1158 internal static async Task<object> GetParameterValue(XmlElement Value,
Contract Contract,
1159 bool DecodeAttachments)
1161 foreach (XmlNode N
in Value.ChildNodes)
1163 if (!(N is XmlElement E))
1166 switch (E.LocalName)
1168 case "ParameterReference":
1189 Url = RoleParameter.AttachmentUrl
1194 return P2.ObjectValue;
1199 case "RoleReference":
1201 if (
string.IsNullOrEmpty(
Role))
1204 if (
Contract.ClientSignatures is
null)
1254 return Convert.FromBase64String(E.InnerText);
1269 if (TimeSpan.TryParse(E.InnerText, out TimeSpan TS))
1282 QueueForProcessing(Payment,
EDaler);
1285 internal static async Task StopProcessingPayments()
1295 await paymentsToProcess.Terminate();
1307 private static void QueueForProcessing(
WorkItem Item)
1309 paymentsToProcess.Queue(Item);
1315 Task
_ = Task.Run(() => ProcessingTask());
1323 public Payment Payment;
1327 private static readonly
object synchObj =
new object();
1328 private static bool started =
false;
1330 private static async Task ProcessingTask()
1337 while (!((Item = await paymentsToProcess.Wait()) is
null))
1339 Payment = Item.Payment;
1340 if (Payment.Processed.HasValue)
1345 DateTime Now = DateTime.UtcNow;
1347 if (Payment.Expires.ToUniversalTime() <= Now)
1349 Payment.Processed = Now;
1351 if (Payment.LastError is
null)
1353 Payment.LastError =
"Expired";
1359 string ErrorMessage = await ProcessPayment(Payment.Uri, Item.EDaler);
1361 if (
string.IsNullOrEmpty(ErrorMessage))
1363 Payment.Processed = Now;
1364 Payment.LastError =
null;
1368 Payment.LastError = ErrorMessage;
1377 catch (Exception ex)
1380 new KeyValuePair<string, object>(
"PaymentId", Payment.PaymentId.ToString()),
1381 new KeyValuePair<string, object>(
"ContractId", Payment.ContractId));
1385 catch (Exception ex)
1395 private static void RetryPayment(
object State)
1397 QueueForProcessing((
WorkItem)State);
1411 return "Unable to parse payment URI: " + PaymentUri;
1414 List<ITransaction> Parts =
new List<ITransaction>();
1417 if (Parts.Count == 1)
1418 UriTransaction = Parts[0];
1424 if (!await UriTransaction.
Prepare())
1430 catch (Exception ex)
1438 if (await UriTransaction.
Execute())
1440 if (await UriTransaction.
Commit())
1450 catch (Exception ex)
1452 await UriTransaction.
Abort();
Contains information about a service provider that users can use to buy eDaler.
Result of request payment.
bool Ok
If payment was successful or not.
string Currency
Currency of amount paid.
decimal Amount
Amount paid.
string Error
Error message, if payment was not successful.
Contains information about a service provider that users can use to sell eDaler.
Contains information about a service provider.
Helps with parsing of commong data types.
static string Encode(bool x)
Encodes a Boolean for use in XML and other formats.
static bool TryParse(string s, out double Value)
Tries to decode a string encoded double.
Helps with common XML-related tasks.
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
static string Encode(string s)
Encodes a string for use in XML.
static bool TryParse(string s, out DateTime Value)
Tries to decode a string encoded DateTime.
Static class managing the application event log. Applications and services log events on this static ...
static void Exception(Exception Exception, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, params KeyValuePair< string, object >[] Tags)
Logs an exception. Event type will be determined by the severity of the exception.
static void Error(string Message, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, string StackTrace, params KeyValuePair< string, object >[] Tags)
Logs an error event.
Static class managing the runtime environment of the IoT Gateway.
static DateTime ScheduleEvent(Action< object > Callback, DateTime When, object State)
Schedules a one-time event.
Implements an HTTP server.
static SessionVariables CreateSessionVariables()
Creates a new collection of variables, that contains access to the global set of variables.
Contains information about one XMPP address.
bool HasAccount
If the address has an account part.
CaseInsensitiveString Domain
Domain
CaseInsensitiveString Account
Account
static bool CheckExpressionSafe(Expression Expression, out ScriptNode Prohibited)
Checks if an expression is safe to execute (if it comes from an external source).
Represents a case-insensitive string.
string Value
String-representation of the case-insensitive string. (Representation is case sensitive....
static bool IsNullOrEmpty(CaseInsensitiveString value)
Indicates whether the specified string is null or an CaseInsensitiveString.Empty string.
Static interface for database persistence. In order to work, a database provider has to be assigned t...
static async Task Update(object Object)
Updates an object in the database.
static Task< IEnumerable< object > > Find(string Collection, params string[] SortOrder)
Finds objects in a given collection.
static async Task Insert(object Object)
Inserts an object into the default collection of the database.
This filter selects objects that have a named field equal to a given value.
Static class that dynamically manages types and interfaces available in the runtime environment.
static Type GetType(string FullName)
Gets a type, given its full name.
static object Instantiate(Type Type, params object[] Arguments)
Returns an instance of the type Type . If one needs to be created, it is. If the constructor requires...
Asynchronous First-in-First-out (FIFO) Queue, for use when transporting items of type T between task...
Represents an asynchronous operation to be performed.
A transaction built up of a set of sub-transactions.
Class managing a script expression.
async Task< object > EvaluateAsync(Variables Variables)
Evaluates the expression, using the variables provided in the Variables collection....
Manages eDaler on accounts connected to the broker.
Abstract base class for eDaler URIs
abstract void AddTransactionParts(List< ITransaction > Subtransactions, bool LocalOnly, LegalComponent Legal)
Adds subtransaction objects necessary to process the URI.
EDalerUriState State
URI State object.
static async Task< EDalerUri > Parse(string Uri, EDalerUriState State, EDalerComponent EDaler)
Parses an eDaler URI
virtual void Error(EDalerUriErrorType ErrorType, string ErrorMessage, bool LogAsNotice)
Reports an error with the URI
string ErrorMessage
Error message, or null if no error.
Current state of URI from internal source
Represents an attachment to a document, with a corresponding URL.
Represents a digital signature on a contract.
Contains the definition of a contract
bool TryGetParameter(CaseInsensitiveString ParameterName, out Parameter Result)
Tries to get a parameter, given its name.
CaseInsensitiveString ContractId
Contract Identity
Abstract base class for contractual parameters
abstract object ObjectValue
Parameter value.
CaseInsensitiveString Name
Parameter name
Class defining a part in a contract
Role-reference contractual parameter
string AttachmentFileName
Filename of attachment.
byte[] AttachmentSignature
Binary signature of the attachment, generated by an approved legal identity of the account-holder....
CaseInsensitiveString AttachmentId
Attachment ID
bool HasAttachmentValue
If the value is an attachment reference.
string AttachmentContentType
Internet Content Type of binary attachment.
override object ObjectValue
Parameter value.
CaseInsensitiveString AttachmentLegalId
Legal ID of uploader of the attachment
DateTime AttachmentTimestamp
Timestamp of signature. If no signature, value is DateTime.MinValue
Abstract base class of signatures
Property[] Properties
Properties detailing the legal identity.
CaseInsensitiveString Name
Property name
CaseInsensitiveString Value
Property value
Legal (digital identities, smart contracts) service component.
Marketplace processor, brokering sales of items via tenders and offers defined in smart contracts.
const string SellerRole
Role name of seller.
const string BuyerRole
Role name of buyer.
Marketplace processor, brokering sales of items via tenders and offers defined in smart contracts.
Paiwise processor, processing payment instructions defined in smart contracts.
const string PaymentInstructionsNamespace
https://paiwise.tagroot.io/Schema/PaymentInstructions.xsd
const string TrustProviderRole
Role name of Trust Provider.
static byte[] Sign(byte[] Data)
Signs data with the private key of the ledger.
Interface for information about a service provider that users can use to buy eDaler.
string BuyEDalerTemplateContractId
Contract ID of Template, for buying e-Daler
Task< PaymentResult > BuyEDaler(IDictionary< CaseInsensitiveString, object > ContractParameters, IDictionary< CaseInsensitiveString, CaseInsensitiveString > IdentityProperties, decimal Amount, string Currency, string SuccessUrl, string FailureUrl, string CancelUrl, EventHandlerAsync< ClientUrlEventArgs > ClientUrlCallback, object State)
Processes payment for buying eDaler.
Task< bool > CanBuyEDaler(CaseInsensitiveString AccountName)
If the service provider can be used to process a request to buy eDaler of a certain amount,...
Interface for information about a service provider that users can use to buy eDaler.
Interface for information about a service provider that users can use to sell eDaler.
Task< bool > CanSellEDaler(CaseInsensitiveString AccountName)
If the service provider can be used to process a request to sell eDaler of a certain amount,...
string SellEDalerTemplateContractId
Contract ID of Template, for selling e-Daler
Task< PaymentResult > SellEDaler(IDictionary< CaseInsensitiveString, object > ContractParameters, IDictionary< CaseInsensitiveString, CaseInsensitiveString > IdentityProperties, decimal Amount, string Currency, string SuccessUrl, string FailureUrl, string CancelUrl, EventHandlerAsync< ClientUrlEventArgs > ClientUrlCallback, object State)
Processes payment for selling eDaler.
Interface for information about a service provider that users can use to sell eDaler.
Grade Supports(T Object)
If the interface understands objects such as Object .
Interface for transactions
Task< bool > Execute()
Executes the transaction.
Task< bool > Prepare()
Prepares the transaction for execution. This step can be used for validation and authorization of the...
Task< bool > Rollback()
Rolls back any changes made during the execution phase.
Task Abort()
Aborts the transaction.
Task< bool > Commit()
Commits any changes made during the execution phase.
ContentType
DTLS Record content type.
EDalerUriErrorType
Type of URI Error
ContractState
Recognized contract states