public void RegisterPaymentOnDb() { var repository = new PagoEfectivoRepository(); var client = new PagoEfectivoClient(); var transactionCode = repository.RegisterPagoEfectivoPayment(new RegisterPagoEfectivoPayment { AdditionalData = "First Payment", AdminEmail = "*****@*****.**", Amount = 100, Currency = Currency.PEN.ToString(), DateExpiry = new DateTime(2021, 1, 3), PaymentConcept = "Food", UserCodeCountry = "PE", UserCountry = "PERU", UserDocumentNumber = "70007800", UserDocumentType = UserDocumentType.DNI.ToString(), UserEmail = "*****@*****.**", UserLastName = "Carbajal", UserName = "******", UserPhone = "980784506", UserUbigeo = "150101" }); var result = client.RegisterNewPayment(new RegisterPayment { AdditionalData = "First Payment", AdminEmail = "*****@*****.**", Amount = 100, Currency = Currency.PEN, DateExpiry = new DateTime(2021, 1, 3), PaymentConcept = "Food", TransactionCode = transactionCode.ToString(), UserCodeCountry = "PE", UserCountry = "PERU", UserDocumentNumber = "70007800", UserDocumentType = UserDocumentType.DNI, UserEmail = "*****@*****.**", UserLastName = "Carbajal", UserName = "******", UserPhone = "980784506", UserUbigeo = "150101" }); repository.UpdateCiffOnPagoEfectivoPayment(new UpdateCiffOnPagoEfectivoPayment { Cip = result.Cip, TransaccionCode = transactionCode, CipUrl = result.CipUrl }); repository.RegisterPaymentOnPagoEfectivo(new RegisterPaymentOnPagoEfectivo { EventType = "cip.paid", OperationNumber = 1233, PaymentDate = DateTime.Now, TransaccionCode = transactionCode }); }
public object Post(PaymentHappenedOnPagoEfectivo registerPaymentOnPagoEfectivo) { var repo = new PagoEfectivoRepository(); repo.RegisterPaymentOnPagoEfectivo(new RegisterPaymentOnPagoEfectivo { EventType = registerPaymentOnPagoEfectivo.EventType, OperationNumber = registerPaymentOnPagoEfectivo.OperationNumber, PaymentDate = registerPaymentOnPagoEfectivo.Data.PaymentDate, TransaccionCode = registerPaymentOnPagoEfectivo.Data.TransactionCode }); return(new { message = "It Was ok!" }); }