示例#1
0
 public async Task SaleAsync(string transactionId, ProcessRequestOptions options = null)
 {
     await this.ProcessInternalAsync(OperationSale, transactionId, options);
 }
示例#2
0
 public async Task AnnulAsync(string transactionId, ProcessRequestOptions options)
 {
     await this.ProcessInternalAsync(OperationAnnul, transactionId, options);
 }
示例#3
0
        private async Task ProcessInternalAsync(string operation, string transactionId, ProcessRequestOptions options = null)
        {
            var rb  = new RequestBuilder();
            var uri = rb.GetUri(this._endpoints.Process, new Dictionary <string, string>
            {
                { "merchantId", this._merchantId },
                { "token", this._token },
                { "transactionId", transactionId },
                { "operation", operation }
            }, options ?? new ProcessRequestOptions());
            var response = await this._caller.CallAsync <ProcessResponse>(uri);

            if (response.ResponseCode != "OK")
            {
                throw new ProcessException(response);
            }
        }