/** * do process authorization * * @param array $options Authorization options */ public AccessToken authenticate(AuthorizationCode options) { string authenticate_url = null; authenticate_url = _client.request_client(_client.secure) + "://" + _client.host + _client.path + "/" + _client.api_version + "/oauth/token/"; _accesstoken = new AccessToken(); return(_accesstoken.getAccessToken(authenticate_url, options)); }
public Api(Client client) { this._client = client; this._user = new User(this); this._merchants = new Merchant(this); this._invoices = new Invoices(this); this._accounts = new Accounts(this); this.Baseapiurl = client.request_client(client.secure) + "://" + client.host.Trim('/') + "/" + client.path.Trim('/') + "/" + client.api_version.Trim('/') + "/"; this.BaseapiSecureUrl = this.Baseapiurl.Replace("http://", "https://"); }
protected void getauthorizeapi() { string Redirecturl = null; Client client = new Client(); client.client_id = "895963850ade9e8f5652ecabc7e16b3d561ea22f8d8b4c4207e6784a0db3a01f"; client.client_secret = "6b08be21178a7f76229d7cae91a33eed023b7bf5aede577f4cc7d73ec5bd6e3f"; client.scope = "user_read_write merchant_read_write invoice_read_write oauth_read_write"; //client.scope = "user_read_write user_password_write"; client.redirect_uri = "http://119.226.189.186:8100/DemoWebGoCoin/"; Redirecturl = client.request_client(client.secure) + "://" + client.get_auth_url(); client.initToken(); Boolean b_auth = client.authorize_api(); if (b_auth) { string token = client.getToken(); LitAccessToken.Text = token; } else { Response.Redirect(Redirecturl, false); } }