public async Task <TransactionResult> Confirm(PayUConfirmation confirmation) { var log = new PaymentConfirmationLog() { ProcessDate = DateTime.Now, TransactionId = new Guid(confirmation.reference_sale), RawData = Newtonsoft.Json.JsonConvert.SerializeObject(confirmation), ReferencePayU = confirmation.reference_pol, ResponseCodePol = confirmation.response_code_pol, ResponseMessagePol = confirmation.response_message_pol, StatePol = confirmation.state_pol }; context.PaymentConfirmationLogs.Add(log); await context.SaveChangesAsync(); var success = confirmation.state_pol.Equals("4"); var transactionResult = new TransactionResult() { Success = success }; await SaveTransactionConfirmation(log.TransactionId, log); return(transactionResult); }
public async Task <ObjectResult> Confirmation(PayUConfirmation model) { try { var result = await service.Confirm(model); return(Ok(result)); } catch (Exception ex) { appInsights.TrackException(ex); throw; } }
public async Task <ActionResult> Create(PayUConfirmation model) { var result = await service.Confirm(model); return(Ok(result)); }