예제 #1
0
 /// <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;
 }
예제 #2
0
 /// <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;
 }
예제 #3
0
 /// <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;
 }
예제 #4
0
        /// <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;
        }
예제 #5
0
        /// <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;
        }
예제 #6
0
 /// <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;
 }
예제 #7
0
        /// <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;
        }
예제 #8
0
 /// <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;
 }
예제 #9
0
 public AccessToken getAccessToken(string url ,AuthorizationCode authCode)
 {
     restClient = new RestClient(url, HttpVerb.POST, SerializeJson(authCode), "", "");
     AccessToken accessTokenObj = DeserializeJson(restClient.MakeRequest());
     return accessTokenObj;
 }