4using System.Threading.Tasks;
98 public override async Task
Parse(XmlElement Xml)
100 await base.Parse(Xml);
130 base.OnChildNodesUpdated();
132 this.from = this.GetValueElement<From>();
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,
"Sell eDaler contract reference must be either the creation contract, or the current ownership contract.");
174 if (
string.IsNullOrEmpty(P.Value?.
ErrorText))
199 if (PaymentLegalId is
null || PaymentJid is
null)
203 throw new StateMachineException(Arguments.Machine,
"Unable to sell eDaler: Service ID not defined.");
206 throw new StateMachineException(Arguments.Machine,
"Unable to sell eDaler: Service Provider not defined.");
214 throw new StateMachineException(Arguments.Machine,
"Unable to sell eDaler: Service Provider does not support selling of eDaler.");
221 throw new StateMachineException(Arguments.Machine,
"Unable to sell eDaler: Amount must be positive.");
228 throw new StateMachineException(Arguments.Machine,
"Unable to sell eDaler: Seller does not have an account on the current broker.");
235 if (
string.IsNullOrEmpty(Country))
242 throw new StateMachineException(Arguments.Machine,
"Unable to sell eDaler: Selected service provider cannot perform action.");
245 throw new StateMachineException(Arguments.Machine,
"Unable to sell eDaler: Selected service provider does not support currency.");
247 Dictionary<CaseInsensitiveString, object> ContractParameters =
new Dictionary<CaseInsensitiveString, object>();
248 Dictionary<CaseInsensitiveString, CaseInsensitiveString> SellerIdParameters =
new Dictionary<CaseInsensitiveString, CaseInsensitiveString>();
250 foreach (
Parameter P2
in this.parameters)
252 string Key = (await P2.
Key.Evaluate(Arguments))?.ToString() ??
string.Empty;
253 object Value = await P2.
Value.Evaluate(Arguments);
255 ContractParameters[Key] = Value;
258 foreach (
Property P2
in PaymentIdentity.Properties)
262 XmppServerModule.EDaler, PaymentLegalId, ContractId, ContractParameters, SellerIdParameters,
Result of request payment.
bool Ok
If payment was successful or not.
string Error
Error message, if payment was not successful.
Contains information about a service provider that users can use to sell eDaler.
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.
Defines a payment contract.
Defines currency to be sent.
Defines from whom a payment (or message) is sent.
HeaderValue Value
Parameter value
Defines a payment reference.
Sells eDaler to an account.
SellEDaler()
Sells eDaler to an account.
override string LocalName
Local name
override void OnChildNodesUpdated()
Method called whenever ChildNodes is updated.
override async Task Parse(XmlElement Xml)
Parses the State-machine node.
override async Task Execute(EvaluationArguments Arguments)
Evaluates the action node
override IStateMachineNode Create()
Creates a new node of the corresponding type.
Parameter[] Parameters
Parameters
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 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,...
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 State-Machine nodes
ContractState
Recognized contract states