public OneSpanSign.API.Account createSubAccount(OneSpanSign.API.SubAccount subAccount) { string path = template.UrlFor(UrlTemplate.ACCOUNT_SUBACCOUNTS_PATH).Build(); try { string payload = JsonConvert.SerializeObject(subAccount, jsonSettings); string response = restClient.Post(path, payload); return(JsonConvert.DeserializeObject <OneSpanSign.API.Account> (response, jsonSettings)); }catch (OssServerException e) { throw new OssServerException("Could not create subAccount.\t" + " Exception: " + e.Message, e.ServerError, e); } catch (Exception e) { throw new OssException("Could not create subAccount.\t" + " Exception: " + e.Message, e); } }
public void updateSubAccount(OneSpanSign.API.SubAccount subAccount, string accountId) { string path = template.UrlFor(UrlTemplate.ACCOUNT_SUBACCOUNTS_ID_PATH) .Replace("{accountId}", accountId) .Build(); try { string payload = JsonConvert.SerializeObject(subAccount, jsonSettings); restClient.Put(path, payload); } catch (OssServerException e) { throw new OssServerException("Could not update subAccount.\t" + " Exception: " + e.Message, e.ServerError, e); } catch (Exception e) { throw new OssException("Could not update subAccount.\t" + " Exception: " + e.Message, e); } }