3using System.Collections.Generic;
5using System.Threading.Tasks;
58 internal static async Task ContractSigned(
Contract Contract,
bool ContractIsLocked,
59 Dictionary<CaseInsensitiveString, Parameter> TransientParameters,
68 switch (
Contract.ForMachinesLocalName)
73 case "PaymentInstructions":
77 XmlDocument Doc =
new XmlDocument()
79 PreserveWhitespace =
true
83 foreach (XmlNode N
in Doc.DocumentElement.ChildNodes)
101 Doc =
new XmlDocument()
103 PreserveWhitespace =
true
113 out
string PaymentLegalId, out
string PaymentJid))
118 Doc =
new XmlDocument()
120 PreserveWhitespace =
true
124 await BuyEDaler(Doc.DocumentElement,
Contract, ContractIsLocked,
125 TransientParameters, Legal,
EDaler, PaymentLegalId, PaymentJid);
131 out PaymentLegalId, out PaymentJid))
136 Doc =
new XmlDocument()
138 PreserveWhitespace =
true
142 await SellEDaler(Doc.DocumentElement,
Contract, ContractIsLocked,
143 TransientParameters, Legal,
EDaler, PaymentLegalId, PaymentJid);
148 "Unrecognized content in payments contract: " +
Contract.ForMachinesLocalName,
156 private static async Task BuyEDaler(XmlElement Instructions,
Contract Contract,
bool ContractIsLocked,
157 Dictionary<CaseInsensitiveString, Parameter> TransientParameters,
LegalComponent Legal,
162 string ServiceId =
XML.
Attribute(Instructions,
"serviceId");
164 decimal? Amount =
null;
167 if (
string.IsNullOrEmpty(ServiceId))
193 foreach (XmlNode N
in Instructions.ChildNodes)
195 if (N is XmlElement E)
200 if (!(await GetParameterValue(E,
Contract) is decimal d))
210 if (!(await GetParameterValue(E,
Contract) is
string s))
226 if (!Amount.HasValue ||
string.IsNullOrEmpty(Currency))
232 if (Amount.Value <= 0)
245 if (!
EDaler.Server.IsServerDomain(PaymentAddress.
Domain,
true))
253 if (PaymentIdentity is
null)
259 string Country = PaymentIdentity[
"COUNTRY"];
261 if (
string.IsNullOrEmpty(Country))
288 (
EDaler.Server.Domain !=
"example.com" ||
298 Dictionary<CaseInsensitiveString, object> ContractParameters =
new Dictionary<CaseInsensitiveString, object>();
299 Dictionary<CaseInsensitiveString, CaseInsensitiveString> BuyerIdParameters =
new Dictionary<CaseInsensitiveString, CaseInsensitiveString>();
304 if (!(TransientParameters is
null))
306 foreach (KeyValuePair<CaseInsensitiveString, Parameter> P
in TransientParameters)
307 ContractParameters[P.Key] = P.Value.ObjectValue;
310 foreach (
Property P
in PaymentIdentity.Properties)
313 BuyEDaler(
Contract, ContractIsLocked, Amount.Value, Currency, Service, Legal,
EDaler,
322 private static async
void BuyEDaler(
Contract Contract,
bool ContractIsLocked,
325 string ContractId, Dictionary<CaseInsensitiveString, object> ContractParameters,
326 Dictionary<CaseInsensitiveString, CaseInsensitiveString> BuyerIdParameters)
330 if (!
string.IsNullOrEmpty(ContractId) && !ContractParameters.ContainsKey(nameof(ContractId)))
331 ContractParameters[nameof(ContractId)] = ContractId;
334 BuyerIdParameters, Amount, Currency,
null,
null,
null, async (Sender, e) =>
338 StringBuilder Xml = new StringBuilder();
340 Xml.Append(
"<buyEDalerClientUrl xmlns='");
341 Xml.Append(EDalerComponent.NamespaceEDaler);
342 Xml.Append(
"' tid='");
343 Xml.Append(XML.Encode(Contract.ContractId));
344 Xml.Append(
"' url='");
345 Xml.Append(XML.Encode(e.Url));
348 await EDaler.Server.SendMessage(string.Empty, string.Empty, EDaler.MainDomain,
349 new XmppAddress(JID), string.Empty, Xml.ToString());
359 StringBuilder Uri =
new StringBuilder();
360 DateTime Expires = Contract.Duration.HasValue ? (DateTime.Today +
Contract.Duration.Value) : DateTime.Today.AddDays(365);
361 Guid Id = Guid.NewGuid();
362 DateTime Created = DateTime.UtcNow;
364 Uri.Append(
"edaler:is=");
365 Uri.Append(
EDaler.Server.Domain);
367 Uri.Append(PaymentLegalId);
369 Uri.Append(Id.ToString());
375 Uri.Append(Currency);
379 Uri.Append(Convert.ToBase64String(Encoding.UTF8.GetBytes(
"iotsc:" +
Contract.
ContractId)));
383 string Msg = await ProcessPayment(Uri.ToString(),
EDaler);
384 if (!
string.IsNullOrEmpty(Msg))
396 internal static async Task<PaymentResult> BuyEDaler(decimal Amount,
string Currency,
string SuccessUrl,
string FailureUrl,
string CancelUrl,
398 Dictionary<CaseInsensitiveString, object> ContractParameters, Dictionary<CaseInsensitiveString, CaseInsensitiveString> BuyerIdParameters,
403 if (!
string.IsNullOrEmpty(ContractId) && !ContractParameters.ContainsKey(nameof(ContractId)))
404 ContractParameters[nameof(ContractId)] = ContractId;
407 Amount, Currency, SuccessUrl, FailureUrl, CancelUrl, ClientUrlCallback, State);
412 StringBuilder Uri =
new StringBuilder();
413 DateTime Expires = DateTime.Today.AddDays(365);
414 Guid Id = Guid.NewGuid();
415 DateTime Created = DateTime.UtcNow;
417 Uri.Append(
"edaler:is=");
418 Uri.Append(
EDaler.Server.Domain);
420 Uri.Append(PaymentLegalId);
422 Uri.Append(Id.ToString());
432 if (!
string.IsNullOrEmpty(Reference))
435 Uri.Append(Convert.ToBase64String(Encoding.UTF8.GetBytes(Reference)));
440 string Msg = await ProcessPayment(Uri.ToString(),
EDaler);
441 if (!
string.IsNullOrEmpty(Msg))
456 private static async Task SellEDaler(XmlElement Instructions,
Contract Contract,
bool ContractIsLocked,
457 Dictionary<CaseInsensitiveString, Parameter> TransientParameters,
LegalComponent Legal,
462 string ServiceId =
XML.
Attribute(Instructions,
"serviceId");
464 decimal? Amount =
null;
467 if (
string.IsNullOrEmpty(ServiceId))
493 foreach (XmlNode N
in Instructions.ChildNodes)
495 if (N is XmlElement E)
500 if (!(await GetParameterValue(E,
Contract) is decimal d))
510 if (!(await GetParameterValue(E,
Contract) is
string s))
526 if (!Amount.HasValue ||
string.IsNullOrEmpty(Currency))
532 if (Amount.Value <= 0)
545 if (!
EDaler.Server.IsServerDomain(PaymentAddress.
Domain,
true))
553 if (PaymentIdentity is
null)
559 string Country = PaymentIdentity[
"COUNTRY"];
561 if (
string.IsNullOrEmpty(Country))
588 (
EDaler.Server.Domain !=
"example.com" ||
598 Dictionary<CaseInsensitiveString, object> ContractParameters =
new Dictionary<CaseInsensitiveString, object>();
599 Dictionary<CaseInsensitiveString, CaseInsensitiveString> SellerIdParameters =
new Dictionary<CaseInsensitiveString, CaseInsensitiveString>();
604 if (!(TransientParameters is
null))
606 foreach (KeyValuePair<CaseInsensitiveString, Parameter> P
in TransientParameters)
607 ContractParameters[P.Key] = P.Value.ObjectValue;
610 foreach (
Property P
in PaymentIdentity.Properties)
613 SellEDaler(
Contract, ContractIsLocked, Amount.Value, Currency, Service, Legal,
EDaler,
622 internal static async
void SellEDaler(
Contract Contract,
bool ContractIsLocked, decimal Amount,
string Currency,
624 string PaymentLegalId,
string ContractId, Dictionary<CaseInsensitiveString, object> ContractParameters,
625 Dictionary<CaseInsensitiveString, CaseInsensitiveString> SellerIdParameters)
629 if (!
string.IsNullOrEmpty(ContractId) && !ContractParameters.ContainsKey(nameof(ContractId)))
630 ContractParameters[nameof(ContractId)] = ContractId;
632 StringBuilder Uri =
new StringBuilder();
633 DateTime Expires = Contract.Duration.HasValue ? (DateTime.Today +
Contract.Duration.Value) : DateTime.Today.AddDays(365);
634 Guid Id = Guid.NewGuid();
635 DateTime Created = DateTime.UtcNow;
637 Uri.Append(
"edaler:xx=");
638 Uri.Append(
EDaler.Server.Domain);
640 Uri.Append(PaymentLegalId);
642 Uri.Append(Id.ToString());
648 Uri.Append(Currency);
652 Uri.Append(Convert.ToBase64String(Encoding.UTF8.GetBytes(
"iotsc:" +
Contract.
ContractId)));
658 string Msg = await ProcessPayment(Uri.ToString(),
EDaler);
659 if (!
string.IsNullOrEmpty(Msg))
666 SellerIdParameters, Amount, Currency,
null,
null,
null,
null,
null);
672 Created = DateTime.UtcNow;
674 Uri.Append(
"edaler:is=");
675 Uri.Append(
EDaler.Server.Domain);
677 Uri.Append(PaymentLegalId);
679 Uri.Append(Id.ToString());
685 Uri.Append(Currency);
689 Uri.Append(Convert.ToBase64String(Encoding.UTF8.GetBytes(
"iotsc:" +
Contract.
ContractId)));
693 Msg = await ProcessPayment(Uri.ToString(),
EDaler);
694 if (
string.IsNullOrEmpty(Msg))
700 ". Furthermore, unable to re-issue eDaler: " + Msg +
701 ". Contact operator.",
true, Legal,
EDaler);
713 internal static async Task<PaymentResult> SellEDaler(decimal Amount,
string Currency,
string SuccessUrl,
string FailureUrl,
string CancelUrl,
715 string SignaturesContractId, Dictionary<CaseInsensitiveString, object> ContractParameters,
716 Dictionary<CaseInsensitiveString, CaseInsensitiveString> SellerIdParameters,
721 if (!
string.IsNullOrEmpty(SignaturesContractId) && !ContractParameters.ContainsKey(nameof(SignaturesContractId)))
722 ContractParameters[nameof(SignaturesContractId)] = SignaturesContractId;
724 StringBuilder Uri =
new StringBuilder();
725 DateTime Expires = DateTime.Today.AddDays(365);
726 Guid Id = Guid.NewGuid();
727 DateTime Created = DateTime.UtcNow;
729 Uri.Append(
"edaler:xx=");
730 Uri.Append(
EDaler.Server.Domain);
732 Uri.Append(PaymentLegalId);
734 Uri.Append(Id.ToString());
740 Uri.Append(Currency);
744 if (!
string.IsNullOrEmpty(Reference))
747 Uri.Append(Convert.ToBase64String(Encoding.UTF8.GetBytes(Reference)));
750 if (!
string.IsNullOrEmpty(SignaturesContractId))
753 Uri.Append(SignaturesContractId);
758 string Msg = await ProcessPayment(Uri.ToString(),
EDaler);
759 if (!
string.IsNullOrEmpty(Msg))
763 SuccessUrl, FailureUrl, CancelUrl, ClientUrlCallback, State);
769 Created = DateTime.UtcNow;
771 Uri.Append(
"edaler:is=");
772 Uri.Append(
EDaler.Server.Domain);
774 Uri.Append(PaymentLegalId);
776 Uri.Append(Id.ToString());
782 Uri.Append(Currency);
786 Uri.Append(Convert.ToBase64String(Encoding.UTF8.GetBytes(Reference)));
790 Msg = await ProcessPayment(Uri.ToString(),
EDaler);
791 if (
string.IsNullOrEmpty(Msg))
796 ". Furthermore, unable to re-issue eDaler: " + Msg +
797 ". Contact operator.");
813 Guid Id = Guid.NewGuid();
816 string Currency =
null;
817 string Reference =
null;
819 decimal? Amount =
null;
820 decimal? AmountExtra =
null;
821 double? ValidDays =
null;
823 foreach (XmlNode N
in Payment.ChildNodes)
831 FromLegalId = GetLegalId(E,
Contract);
832 if (FromLegalId is
null)
840 ToLegalId = GetLegalId(E,
Contract);
841 if (ToLegalId is
null)
849 if (!(await GetParameterValue(E,
Contract) is decimal d))
860 if (!(await GetParameterValue(E,
Contract) is decimal d2))
870 if (!(await GetParameterValue(E,
Contract) is
string s))
880 if (!(await GetParameterValue(E,
Contract) is decimal d3))
886 ValidDays = (double)d3;
890 if (!(await GetParameterValue(E,
Contract) is
string s2))
900 if (!(await GetParameterValue(E,
Contract) is
string s3))
906 int i = s3.IndexOf(
'@');
907 if (i < 0 || !Guid.TryParse(s3.Substring(0, i), out Guid _))
913 ConditionContractId = s3;
918 if (FromLegalId is
null || ToLegalId is
null || Currency is
null || !Amount.HasValue || !ValidDays.HasValue || Reference is
null)
924 string Uri = GenerateContractualPaymentUri(Id, FromLegalId,
true, ToLegalId,
true, Currency, Amount.Value, AmountExtra, Reference,
927 Payment PaymentInstance =
new Payment()
931 FromLegalId = FromLegalId,
932 ToLegalId = ToLegalId,
933 Amount = Amount.
Value,
934 AmountExtra = AmountExtra,
936 ConditionContractId = ConditionContractId,
939 Reference = Reference,
944 QueueForProcessing(PaymentInstance,
EDaler);
947 internal static string GenerateContractualPaymentUri(Guid Id,
string From,
bool FromIsLegalId,
string To,
bool ToIsLegalId,
string Currency,
948 decimal Amount, decimal? AmountExtra,
string Reference,
string ContractId,
string ConditionContractId,
double ValidDays,
949 out DateTime Created, out DateTime Expires)
951 StringBuilder Uri =
new StringBuilder();
953 Created = DateTime.UtcNow;
954 Expires = Created.AddDays(ValidDays);
956 Uri.Append(
"edaler:id=");
957 Uri.Append(Id.ToString());
973 Uri.Append(Currency);
977 if (AmountExtra.HasValue)
988 Uri.Append(Convert.ToBase64String(Encoding.UTF8.GetBytes(Reference)));
990 Uri.Append(ContractId);
992 if (!
string.IsNullOrEmpty(ConditionContractId))
995 Uri.Append(ConditionContractId);
1000 return Uri.ToString();
1003 internal static string GenerateReserveAmountUri(Guid Id,
string From,
bool FromIsLegalId,
string Currency,
1004 decimal Amount,
string Reference,
string ContractId,
double ValidDays, out DateTime Created, out DateTime Expires)
1006 StringBuilder Uri =
new StringBuilder();
1008 Created = DateTime.UtcNow;
1009 Expires = Created.AddDays(ValidDays);
1011 Uri.Append(
"edaler:id=");
1012 Uri.Append(Id.ToString());
1021 Uri.Append(Currency);
1029 Uri.Append(Convert.ToBase64String(Encoding.UTF8.GetBytes(Reference)));
1031 if (!
string.IsNullOrEmpty(ContractId))
1034 Uri.Append(ContractId);
1039 return Uri.ToString();
1042 private static void SignUri(StringBuilder Uri)
1044 byte[] PreSign = Encoding.UTF8.GetBytes(Uri.ToString());
1048 Uri.Append(Convert.ToBase64String(S));
1051 internal static string GenerateReleaseAmountUri(Guid Id,
string To,
bool ToIsLegalId,
string Currency,
1052 decimal Amount,
string Reference,
string ContractId,
double ValidDays, out DateTime Created, out DateTime Expires)
1054 StringBuilder Uri =
new StringBuilder();
1056 Created = DateTime.UtcNow;
1057 Expires = Created.AddDays(ValidDays);
1059 Uri.Append(
"edaler:id=");
1060 Uri.Append(Id.ToString());
1069 Uri.Append(Currency);
1077 Uri.Append(Convert.ToBase64String(Encoding.UTF8.GetBytes(Reference)));
1079 if (!
string.IsNullOrEmpty(ContractId))
1082 Uri.Append(ContractId);
1087 return Uri.ToString();
1099 foreach (XmlNode N
in Part.ChildNodes)
1101 if (!(N is XmlElement E))
1104 switch (E.LocalName)
1106 case "RoleReference":
1107 if (
Contract.ClientSignatures is
null)
1111 if (
string.IsNullOrEmpty(
Role))
1114 string Result =
null;
1141 List<CaseInsensitiveString> Result =
null;
1144 foreach (XmlNode N
in Part.ChildNodes)
1146 if (!(N is XmlElement E))
1149 switch (E.LocalName)
1151 case "RoleReference":
1152 if (
Contract.ClientSignatures is
null)
1156 if (
string.IsNullOrEmpty(
Role))
1164 Result =
new List<CaseInsensitiveString>();
1173 return Result?.ToArray();
1176 internal static async Task<object> GetParameterValue(XmlElement Value,
Contract Contract)
1178 foreach (XmlNode N
in Value.ChildNodes)
1180 if (!(N is XmlElement E))
1183 switch (E.LocalName)
1185 case "ParameterReference":
1192 case "RoleReference":
1194 if (
string.IsNullOrEmpty(
Role))
1197 if (
Contract.ClientSignatures is
null)
1247 return Convert.FromBase64String(E.InnerText);
1262 if (TimeSpan.TryParse(E.InnerText, out TimeSpan TS))
1275 QueueForProcessing(Payment,
EDaler);
1278 internal static async Task StopProcessingPayments()
1288 await paymentsToProcess.Terminate();
1293 QueueForProcessing(
new WorkItem()
1300 private static void QueueForProcessing(WorkItem Item)
1302 paymentsToProcess.Add(Item);
1308 Task _ = Task.Run(() => ProcessingTask());
1314 private class WorkItem
1316 public Payment Payment;
1320 private static readonly
object synchObj =
new object();
1321 private static bool started =
false;
1323 private static async Task ProcessingTask()
1330 while (!((Item = await paymentsToProcess.Wait()) is
null))
1332 Payment = Item.Payment;
1333 if (Payment.Processed.HasValue)
1338 DateTime Now = DateTime.UtcNow;
1340 if (Payment.Expires.ToUniversalTime() <= Now)
1342 Payment.Processed = Now;
1344 if (Payment.LastError is
null)
1346 Payment.LastError =
"Expired";
1352 string ErrorMessage = await ProcessPayment(Payment.Uri, Item.EDaler);
1354 if (
string.IsNullOrEmpty(ErrorMessage))
1356 Payment.Processed = Now;
1357 Payment.LastError =
null;
1361 Payment.LastError = ErrorMessage;
1370 catch (Exception ex)
1373 new KeyValuePair<string, object>(
"PaymentId", Payment.PaymentId.ToString()),
1374 new KeyValuePair<string, object>(
"ContractId", Payment.ContractId));
1378 catch (Exception ex)
1388 private static void RetryPayment(
object State)
1390 QueueForProcessing((WorkItem)State);
1404 return "Unable to parse payment URI: " + PaymentUri;
1407 List<ITransaction> Parts =
new List<ITransaction>();
1410 if (Parts.Count == 1)
1411 UriTransaction = Parts[0];
1417 if (!await UriTransaction.
Prepare())
1423 catch (Exception ex)
1431 if (await UriTransaction.
Execute())
1433 if (await UriTransaction.
Commit())
1443 catch (Exception ex)
1445 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(ScheduledEventCallback Callback, DateTime When, object State)
Schedules a one-time event.
Implements an HTTP server.
static Variables CreateVariables()
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...
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 a digital signature on a contract.
Contains the definition of a contract
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
Abstract base class of signatures
CaseInsensitiveString Name
Property name
CaseInsensitiveString Value
Property value
Provisioning and registry 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, ClientUrlEventHandler 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, ClientUrlEventHandler 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.
delegate Task ClientUrlEventHandler(object Sender, ClientUrlEventArgs e)
Delegat for client URL callback methods.
EDalerUriErrorType
Type of URI Error
ContractState
Recognized contract states