4using System.Threading.Tasks;
98 public override async Task
Parse(XmlElement Xml)
100 await base.Parse(Xml);
130 base.OnChildNodesUpdated();
132 this.to = this.GetValueElement<To>();
133 this.amount = this.GetValueElement<Amount>();
134 this.currency = this.GetValueElement<Currency>();
135 this.reference = this.GetValueElement<Reference>();
136 this.contract = this.GetValueElement<Contract>();
137 this.serviceProvider = this.GetValueElement<ServiceProvider>();
138 this.serviceId = this.GetValueElement<ServiceId>();
139 this.parameters = this.GetChildElements<Parameter>();
148 string ContractId = (await this.contract.
Evaluate(Arguments))?.ToString();
150 ContractId != Arguments.
Token?.OwnershipContract)
152 throw new StateMachineException(Arguments.
Machine,
"Buy eDaler contract reference must be either the creation contract, or the current ownership contract.");
174 if (
string.IsNullOrEmpty(P.Value?.
ErrorText))
202 if (PaymentLegalId is
null || PaymentJid is
null)
209 throw new StateMachineException(Arguments.Machine,
"Unable to buy eDaler: Service Provider not defined.");
217 throw new StateMachineException(Arguments.Machine,
"Unable to buy eDaler: Service Provider does not support buying of eDaler.");
224 throw new StateMachineException(Arguments.Machine,
"Unable to buy eDaler: Amount must be positive.");
231 throw new StateMachineException(Arguments.Machine,
"Unable to buy eDaler: Buyer does not have an account on the current broker.");
238 if (
string.IsNullOrEmpty(Country))
245 throw new StateMachineException(Arguments.Machine,
"Unable to buy eDaler: Selected service provider cannot perform action.");
248 throw new StateMachineException(Arguments.Machine,
"Unable to buy eDaler: Selected service provider does not support currency.");
250 Dictionary<CaseInsensitiveString, object> ContractParameters =
new Dictionary<CaseInsensitiveString, object>();
251 Dictionary<CaseInsensitiveString, CaseInsensitiveString> BuyerIdParameters =
new Dictionary<CaseInsensitiveString, CaseInsensitiveString>();
253 foreach (
Parameter P2
in this.parameters)
255 string Key = (await P2.
Key.Evaluate(Arguments))?.ToString() ??
string.Empty;
256 object Value = await P2.
Value.Evaluate(Arguments);
258 ContractParameters[Key] = Value;
261 foreach (
Property P2
in PaymentIdentity.Properties)
265 PaymentLegalId, ContractId, ContractParameters, BuyerIdParameters,
Reference,
null,
null);
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 Error
Error message, if payment was not successful.
Event arguments for responses to IQ queries.
string ErrorText
Any error specific text.
Contains information about one XMPP address.
bool HasAccount
If the address has an account part.
CaseInsensitiveString Domain
Domain
CaseInsensitiveString Account
Account
bool IsServerDomain(CaseInsensitiveString Domain, bool IncludeAlternativeDomains)
Checks if a domain is the server domain, or optionally, an alternative domain.
Represents a case-insensitive string.
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...
Class managing a script expression.
static decimal ToDecimal(object Object)
Converts an object to a double value.
Represents a digital signature on a contract.
Contains the definition of a contract
Abstract base class of signatures
CaseInsensitiveString Name
Property name
CaseInsensitiveString Value
Property value
Legal (digital identities, smart contracts) service component.
Paiwise processor, processing payment instructions defined in smart contracts.
Exception related to state machine.
Abstract base class for State-Machine action nodes.
Defines amount to be sent.
Buys eDaler to an account.
BuyEDaler()
Buys eDaler to an account.
Parameter[] Parameters
Parameters
override IStateMachineNode Create()
Creates a new node of the corresponding type.
override async Task Execute(EvaluationArguments Arguments)
Evaluates the action node
override async Task Parse(XmlElement Xml)
Parses the State-machine node.
override void OnChildNodesUpdated()
Method called whenever ChildNodes is updated.
override string LocalName
Local name
Defines a payment contract.
Defines currency to be sent.
HeaderValue Value
Parameter value
Defines a payment reference.
Defines a service provider.
Defines to whom a payment (or message) is sent.
Contains information required for evaluating script in a state-machine.
StateMachine Machine
Reference to state-machine definition.
Token Token
Reference to related token.
void ConvertValueAttributesToElements(XmlElement Xml, Type[] ValueTypes, bool[] Required)
Converts value attributes to parsed elements. The XML definition has to be parsed before,...
Task< object > Evaluate(EvaluationArguments Arguments)
Evaluates the value node.
CaseInsensitiveString TrustProviderJid
JID of Trust Provider
CaseInsensitiveString DefinitionContractId
ID of Definition Contract
CaseInsensitiveString TrustProvider
ID of Trust Provider
Service Module hosting the XMPP broker and its components.
Interface for information about a service provider that users can use to buy 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.
Grade Supports(T Object)
If the interface understands objects such as Object .
Interface for State-Machine nodes
ContractState
Recognized contract states