public async Task <IActionResult> Config([FromBody] PaypalExpressConfigForm model) { if (ModelState.IsValid) { var stripeProvider = await _paymentProviderRepository.Query().FirstOrDefaultAsync(x => x.Id == PaymentProviderHelper.PaypalExpressProviderId); stripeProvider.AdditionalSettings = JsonConvert.SerializeObject(model); await _paymentProviderRepository.SaveChangesAsync(); return(Accepted()); } return(BadRequest(ModelState)); }
public IActionResult Config(PaypalExpressConfigForm model) { if (!ModelState.IsValid) { return(View(model)); } _payPalOptions.Update(options => { options.ClientId = model.ClientId; options.ClientSecret = model.ClientSecret; options.IsSandbox = model.IsSandbox; options.PaymentFee = model.PaymentFee; }); ViewData["isSuccess"] = true; return(View(model)); }