public async Task <ActionResult> AddGeneralSettings(AddGeneralSettingsDialogViewModel model) { if (string.IsNullOrEmpty(model.AssetDisplayId)) { return(this.JsonFailResult(Phrases.FieldShouldNotBeEmpty, ErrorMessageAnchor)); } var request = new UpdateAssetGeneralSettingsRequest(); request.AssetDisplayId = model.AssetDisplayId; request.Network = (BlockchainType)Enum.Parse(typeof(BlockchainType), model.SelectedNetwork); request.PaymentAvailable = model.PaymentAvailable; request.SettlementAvailable = model.SettlementAvailable; try { await _payInternalClient.SetAssetGeneralSettingsAsync(request); } catch (DefaultErrorResponseException ex) { if (ex.InnerException != null) { var content = Newtonsoft.Json.JsonConvert.DeserializeObject <ErrorResponse>(((Refit.ApiException)ex.InnerException).Content); return(this.JsonFailResult(content.ErrorMessage, ErrorMessageAnchor)); } else { return(this.JsonFailResult(ex.Message, ErrorMessageAnchor)); } } return(this.JsonRequestResult("#generalSettingsList", Url.Action("GeneralSettingsList"))); }
public async Task <ActionResult> DeleteGeneralSettingsDialog(string assetId = "") { var vm = new AddGeneralSettingsDialogViewModel { Caption = "Delete payment asset", AssetDisplayId = assetId }; return(View(vm)); }
public async Task <ActionResult> AddGeneralSettingsDialog() { var vm = new AddGeneralSettingsDialogViewModel { Caption = "Add general setting", AssetDisplayId = string.Empty, NetworkList = Enum.GetNames(typeof(BlockchainType)).ToList() }; return(View(vm)); }