GetTermsAndConditions
- Method
- Example C#
- Example JS
GetTermsAndConditions(GetTermsAndConditionsRequest)
This method will allow a user to retrieve the Terms and Conditions in order to agree to them before continuing.
Declaration
public GetTermsAndConditionsResponse GetTermsAndConditions(GetTermsAndConditionsRequest request)
Parameters
| TYPE | NAME | DESCRIPTION |
|---|---|---|
| GetTermsAndConditionsRequest | request |
Returns
| TYPE | DESCRIPTION |
|---|---|
| GetTermsAndConditionsResponse |
private TermsAndConditions GetTermsAndConditions()
{
using (RDAWebServiceClient client = new RDAWebServiceClient())
{
var request = new GetTermsAndConditionsRequest()
{
Credentials = credentials,
RequestDate = DateTime.Now,
RequestId = NewRequestId()
};
var response = client.GetTermsAndConditions(request);
if (CheckSuccess(response))
{
return response.TermsAndConditions;
}
else
{
HandleOther(response);
return null;
}
}
}
function GetTermsAndConditions(success, error) {
var request = new XMLHttpRequest();
var data = new GetTermsAndConditionsRequest();
data.Credentials = token;
request.setRequestHeader("Content-type", "application/json; charset=utf-8");
request.open(
"POST",
"http://localhost/mobile/RDAWebService.svc/GetTermsAndConditions",
true
);
request.onreadystatechange = function () {
if (request.readyState === 4) {
if (request.status !== 200) {
return error(request.statusText);
}
var response = JSON.parse(request.responseText);
switch (response.Result) {
case Result.Error:
case Result.ValidationError:
return error(response);
case Result.Success:
default:
return success(response.TermsAndConditions);
}
}
};
request.send(data);
}