Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="transaction"></param>
        /// <returns></returns>
        public async Task <TransactionResult> PayAsync(Transaction transaction)
        {
            try
            {
                //
                var validateResult = await ValidateTransaction.ValidateModelAsync(transaction, Domain.Enums.TransactionType.Pay);

                if (validateResult.Status == Domain.Enums.TransactionStatus.Error)
                {
                    return(validateResult);
                }
                //
                return(await TransactionPool.ExecuteAsync(transaction, Domain.Enums.TransactionType.Pay));
            }
            catch
            {
                throw;
            }
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="transaction"></param>
        /// <returns></returns>
        public async Task <TransactionResult> VoidAsync(string OrderId)
        {
            try
            {
                //
                var transaction = new Transaction {
                    OrderId = OrderId
                };
                var validateResult = await ValidateTransaction.ValidateModelAsync(transaction, Domain.Enums.TransactionType.Chargeback);

                if (validateResult.Status == Domain.Enums.TransactionStatus.Error)
                {
                    return(validateResult);
                }
                //
                return(await TransactionPool.ExecuteAsync(transaction, Domain.Enums.TransactionType.Chargeback));
            }
            catch
            {
                throw;
            }
        }