public IHttpActionResult Post([FromBody] ClientPaymentModel payment, int staffId) { try { var rowAffected = _repo.UpdatePayment(payment); if (rowAffected > 0) { return(Ok("Payment Updated Successfully")); } else { return(BadRequest("Update failed")); } } catch (Exception ex) { throw ex; } }
public async Task <HttpResponseMessage> Post(ClientPaymentModel model) { // Get company for user DomainCompany company = await _companyService.FindByUserAsync(UserId); var chargeCreateOptions = new CompanyChargeOptions { Id = company.Id, AmountInCents = model.AmountInCents, Currency = DomainCurrencies.Default, Description = model.Description, TokenId = model.TokenId }; // Charging // balance will be updated after callback (webhook) from billing system await _companyService.ChargeAsync(chargeCreateOptions); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created); return(response); }
public int UpdatePayment(ClientPaymentModel cp) { return(_ctx.ssp_PMUpdateClientBalance(cp.ClientId, cp.UserId, cp.DateReceived, cp.NameIfNotClient, cp.PaymentMethod, cp.ReferenceNumber, cp.CardNumber, cp.ExpirationDate, cp.Amount, cp.LocationId, cp.PaymentMethod, cp.Comment, cp.ServiceId, cp.TypeofPosting, cp.CopayAmounts)); }