/// <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)); }
/// <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)); }
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)); }
/// <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)); }
/// <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)); }
/// <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)); }