示例#1
0
        /// <summary>Creates refund object for PayIn.</summary>
        /// <param name="payIn">PayIn entity.</param>
        /// <returns>Refund instance returned from API.</returns>
        protected async Task <RefundDTO> GetNewRefundForPayIn(PayInDTO payIn, string idempotencyKey)
        {
            UserNaturalDTO user = await this.GetJohn();

            Money debitedFunds = new Money();

            debitedFunds.Amount   = payIn.DebitedFunds.Amount;
            debitedFunds.Currency = payIn.DebitedFunds.Currency;
            Money fees = new Money();

            fees.Amount   = payIn.Fees.Amount;
            fees.Currency = payIn.Fees.Currency;

            RefundPayInPostDTO refund = new RefundPayInPostDTO(user.Id, fees, debitedFunds);

            return(await this.Api.PayIns.CreateRefund(idempotencyKey, payIn.Id, refund));
        }
示例#2
0
        /// <summary>Creates refund object for PayIn.</summary>
        /// <param name="payIn">PayIn entity.</param>
        /// <returns>Refund instance returned from API.</returns>
        protected RefundDTO GetNewRefundForPayIn(PayInDTO payIn)
        {
            UserNaturalDTO user = this.GetJohn();

            Money debitedFunds = new Money();

            debitedFunds.Amount   = payIn.DebitedFunds.Amount;
            debitedFunds.Currency = payIn.DebitedFunds.Currency;
            Money fees = new Money();

            fees.Amount   = payIn.Fees.Amount;
            fees.Currency = payIn.Fees.Currency;

            RefundPayInPostDTO refund = new RefundPayInPostDTO(user.Id, fees, debitedFunds);

            return(this.Api.PayIns.CreateRefund(payIn.Id, refund));
        }
示例#3
0
        public async Task <RefundDTO> CreateRefund(string idempotencyKey, string payInId, RefundPayInPostDTO refund)
        {
            var targetUrl = $"{_baseUrl}/payins/{payInId}/refunds";

            return(await CreateEntity <RefundDTO, RefundPayInPostDTO>(targetUrl, refund, idempotencyKey));
        }
示例#4
0
 /// <summary>Creates refund for PayIn object.</summary>
 /// <param name="idempotencyKey">Idempotency key for this request.</param>
 /// <param name="payInId">PayIn identifier.</param>
 /// <param name="refund">Refund object to be created.</param>
 /// <returns>Refund entity instance returned from API.</returns>
 public RefundDTO CreateRefund(String idempotencyKey, String payInId, RefundPayInPostDTO refund)
 {
     return(this.CreateObject <RefundDTO, RefundPayInPostDTO>(idempotencyKey, MethodKey.PayinsCreateRefunds, refund, payInId));
 }
示例#5
0
 /// <summary>Creates refund for PayIn object.</summary>
 /// <param name="payInId">PayIn identifier.</param>
 /// <param name="refund">Refund object to be created.</param>
 /// <returns>Refund entity instance returned from API.</returns>
 public RefundDTO CreateRefund(String payInId, RefundPayInPostDTO refund)
 {
     return(CreateRefund(null, payInId, refund));
 }
 /// <summary>Creates refund for PayIn object.</summary>
 /// <param name="payInId">PayIn identifier.</param>
 /// <param name="refund">Refund object to be created.</param>
 /// <returns>Refund entity instance returned from API.</returns>
 public async Task <RefundDTO> CreateRefund(String payInId, RefundPayInPostDTO refund)
 {
     return(await CreateRefund(null, payInId, refund));
 }
示例#7
0
 /// <summary>Creates refund for PayIn object.</summary>
 /// <param name="idempotencyKey">Idempotency key for this request.</param>
 /// <param name="payInId">PayIn identifier.</param>
 /// <param name="refund">Refund object to be created.</param>
 /// <returns>Refund entity instance returned from API.</returns>
 public async Task <RefundDTO> CreateRefundAsync(String idempotencyKey, String payInId, RefundPayInPostDTO refund)
 {
     return(await this.CreateObjectAsync <RefundDTO, RefundPayInPostDTO>(idempotencyKey, MethodKey.PayinsCreateRefunds, refund, payInId));
 }