1using System.Threading.Tasks;
18 private readonly TaskCompletionSource<Contract> contractWaiter =
new TaskCompletionSource<Contract>();
19 private bool prepareCompleted =
false;
31 this.contractualPaymentUri =
Uri;
34 internal async Task<Contract> GetContractAsync()
36 if (this.prepareCompleted)
39 return await this.contractWaiter.Task;
54 this.contract = await this.legal.GetContract(ContractId);
58 bool SenderFound =
false;
65 if (
Signature.LegalId ==
this.Uri.From.Address)
70 if (
Signature.BareJid ==
this.Uri.From.Address)
81 this.
Uri.
State.Error(Uris.States.EDalerUriErrorType.BadRequest,
"Sender not part in the contract.",
false);
86 if (!await this.legal.ValidateServerSignature(Addr.
Domain,
this.Uri.PreSign,
this.Uri.Signature))
88 this.
Uri.
State.Error(Uris.States.EDalerUriErrorType.Forbidden,
"Invalid server signature.",
false);
96 this.prepareCompleted =
true;
97 this.contractWaiter.TrySetResult(this.contract);
107 return Task.FromResult(
true);
116 return Task.FromResult(
true);
125 return Task.FromResult(
true);
Contains information about one XMPP address.
CaseInsensitiveString Domain
Domain
Represents a case-insensitive string.
static bool IsNullOrEmpty(CaseInsensitiveString value)
Indicates whether the specified string is null or an CaseInsensitiveString.Empty string.
Abstract base class for eDaler transactions.
Validates a contract has been signed before a transaction can be realized.
Validates that the sender has signed the contract and that the contract is valid.
override Task< bool > DoExecute()
Performs actual execution.
ValidateSenderContractSignature(IEDalerContractualPaymentUri Uri, LegalComponent Legal)
Validates that the sender has signed the contract and that the contract is valid.
override Task< bool > DoCommit()
Performs actual commit.
override async Task< bool > DoPrepare()
Performs actual preparation.
override Task< bool > DoRollback()
Performs actual rollback.
Abstract base class for eDaler URIs
EntityType FromType
Type of sender
EDalerUriState State
URI State object.
Represents a digital signature on a contract.
Contains the definition of a contract
CaseInsensitiveString ContractId
Contract Identity
Abstract base class of signatures
Provisioning and registry service component.
Service Module hosting the XMPP broker and its components.
Interface for eDaler URIs for contractual payments
EntityType
Type of entity referred to in transaction.