/// <summary>The response service.</summary> /// <param name="ordersBrasPag">The orders bras pag.</param> /// <returns>The <see cref="Sale"/>.</returns> private Sale ResponseService(OrdersBrasPag ordersBrasPag) { var branch = this.branchsRepository.GetFirstOrDefault(x => x.BranchId == ordersBrasPag.BranchId); var paymentService = new PaymentApiService(this.settings.QueryUrl); var authentication = this.MerchantAuthentication(ordersBrasPag, branch); var responseService = paymentService.Get(new Guid(ordersBrasPag.PaymentGuid), authentication); return(responseService); }
/// <summary>The save order braspag log.</summary> /// <param name="ordersBrasPag">The orders bras pag.</param> private void SaveOrderBraspagLog(OrdersBrasPag ordersBrasPag, PaymentStatus paymentStatus) { ordersBrasPag.OrderBraspagId = null; ordersBrasPag.PaymentStatusId = paymentStatus.PaymentStatusId; ordersBrasPag.CreatedDate = DateTime.Now; ordersBrasPag.Details = "Notificação da Braspag"; ordersBrasPag.OrderStatus = null; this.orderBraspagRepository.Insert(ordersBrasPag); }
/// <summary>The save order braspag log.</summary> /// <param name="ordersBrasPag">The orders bras pag.</param> /// <param name="cybersourceUpdate">The cybersource update.</param> private void SaveOrderBraspagLog(OrdersBrasPag ordersBrasPag, CybersourceUpdate cybersourceUpdate) { ordersBrasPag.OrderBraspagId = null; ordersBrasPag.FraudAnalysisStatus = (int)cybersourceUpdate.NewDecision; ordersBrasPag.CreatedDate = DateTime.Now; ordersBrasPag.Details = "Resposta da CyberSource"; ordersBrasPag.OrderStatus = null; this.orderBraspagRepository.Insert(ordersBrasPag); }
/// <summary>The merchant authentication.</summary> /// <param name="ordersBrasPag">The orders bras pag.</param> /// <param name="branch">The branch.</param> /// <returns>The <see cref="MerchantAuthentication"/>.</returns> private MerchantAuthentication MerchantAuthentication(OrdersBrasPag ordersBrasPag, Branchs branch) { var authentication = new MerchantAuthentication(); if (ordersBrasPag.Value > 300) { authentication.MerchantId = new Guid(branch.MerchantIdCyber); authentication.MerchantKey = branch.MerchantKeyCyber; } else { authentication.MerchantId = new Guid(branch.MerchantId); authentication.MerchantKey = branch.MerchantKey; } return(authentication); }
/// <summary>The Insert of OrdersBrasPag.</summary> /// <param name="ordersBrasPag">The orders bras pag.</param> /// <returns>The id just insert.</returns> public async Task <long> Insert(OrdersBrasPag ordersBrasPag) { return(await this.ormLiteConnection.OpenConnection().InsertAsync(ordersBrasPag, true)); }