/// <summary> /// Gets an existing user. /// </summary> /// <param name="id">User's id.</param> /// <returns>The found user.</returns> public User get(string id) { Callbackurl = "users/" + id + "?access_token=" + this._api.client.token; restClient = new RestClient(this._api.Baseapiurl, HttpVerb.GET, "", Callbackurl, this._api.client.token); User User_getbyid = DeserializeJson(restClient.MakeRequest()); return User_getbyid; }
/// <summary> /// Gets resource owner user. /// </summary> /// <returns>Resource owner user.</returns> public User self() { Callbackurl = "user/?access_token=" + this._api.client.token; restClient = new RestClient(this._api.Baseapiurl, HttpVerb.GET, "", Callbackurl, this._api.client.token); User User_self = DeserializeJson(restClient.MakeRequest()); return User_self; }
/// <summary> /// Gets a list of accounts and balances associated with a merchant. /// </summary> /// <param name="id">Merchant's id</param> /// <returns>List of accounts of the given merchant.</returns> public List<Accounts> alist(string id) { Callbackurl = "merchants/" + id + "/accounts"+ "?access_token=" + this._api.client.token; restClient = new RestClient(this._api.Baseapiurl, HttpVerb.GET, "", Callbackurl, this._api.client.token); List<Accounts> Accounts_list = DeserializeListJson(restClient.MakeRequest()); return Accounts_list; }
/// <summary> /// Updates an existing user. /// </summary> /// <param name="_user">New data for the user.</param> /// <returns>The updated user.</returns> public User update(User _user) { Callbackurl = "users/" + _user.id + "?access_token=" + this._api.client.token; restClient = new RestClient(this._api.Baseapiurl, HttpVerb.PATCH, SerializeJson(_user), Callbackurl, this._api.client.token); User User_update = DeserializeJson(restClient.MakeRequest()); return User_update; }
/// <summary> /// Updates an existing merchant. /// </summary> /// <param name="_merchant">New merchant data.</param> /// <returns>The updated merchant.</returns> public Merchant update(Merchant _merchant) { Callbackurl = "merchants/" + _merchant.id + "?access_token=" + this._api.client.token; restClient = new RestClient(this._api.Baseapiurl, HttpVerb.PATCH, SerializeJson(_merchant), Callbackurl, this._api.client.token); Merchant Merchant_update = DeserializeJson(restClient.MakeRequest()); return Merchant_update; }
/// <summary> /// Changes user password. /// </summary> /// <param name="_user">User data with current, new and new confirmation passwords.</param> /// <returns>The updated user.</returns> public User update_password(User _user) { Callbackurl = "users/" + _user.id + "/password" + "?access_token=" + this._api.client.token; restClient = new RestClient(this._api.Baseapiurl, HttpVerb.PATCH, SerializeJson(_user), Callbackurl, this._api.client.token); restClient.MakeRequest(); return _user; }
/// <summary> /// Searches invoices. /// </summary> /// <param name="_invoiceparams">Querystring with the invoice parameters.</param> /// <returns>The invoices that match the search parameters.</returns> public Invoices[] search(string _invoiceparams) { Callbackurl = "invoices/search?" + _invoiceparams;// +"?access_token=" + this._api.client.token; restClient = new RestClient(this._api.BaseapiSecureUrl, HttpVerb.GET, "", Callbackurl, this._api.client.token); Invoices[] Invoices_update = DeserializeJsonArray(restClient.MakeRequest()); return Invoices_update; }
/// <summary> /// Create a new invoice. /// </summary> /// <param name="_merchantid">Merchant's id.</param> /// <param name="_invoice">New invoice data.</param> /// <returns>The created Invoice.</returns> public Invoices create(string _merchantid, Invoices _invoice) { Callbackurl = "merchants/" + _merchantid + "/invoices"; restClient = new RestClient(this._api.BaseapiSecureUrl, HttpVerb.POST, SerializeJson(_invoice), Callbackurl, this._api.client.token); Invoices Invoices_create = DeserializeJson(restClient.MakeRequest()); return Invoices_create; }
public AccessToken getAccessToken(string url ,AuthorizationCode authCode) { restClient = new RestClient(url, HttpVerb.POST, SerializeJson(authCode), "", ""); AccessToken accessTokenObj = DeserializeJson(restClient.MakeRequest()); return accessTokenObj; }