Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public async Task <ObjectResult> Confirmation(PayUConfirmation model)
        {
            try
            {
                var result = await service.Confirm(model);

                return(Ok(result));
            }
            catch (Exception ex)
            {
                appInsights.TrackException(ex);
                throw;
            }
        }
Esempio n. 3
0
        public async Task <ActionResult> Create(PayUConfirmation model)
        {
            var result = await service.Confirm(model);

            return(Ok(result));
        }