def oauth2_authorize_url(
      redirect_uri,
      user_email   = false,
      user_name    = false,
      permissions  = "manage_accounts,collect_payments,view_user,send_money,preapprove_payments,manage_subscriptions",
      user_country = false
    )
      url = @ui_endpoint +
            '/oauth2/authorize?client_id=' + @client_id.to_s +
            '&redirect_uri=' + redirect_uri +
            '&scope=' + permissions

      url += user_name ?    '&user_name='    + CGI::escape(user_name)    : ''
      url += user_email ?   '&user_email='   + CGI::escape(user_email)   : ''
      url += user_country ? '&user_country=' + CGI::escape(user_country) : ''
    end
def oauth2_authorize_url(
      redirect_uri,
      user_email   = false,
      user_name    = false,
      permissions  = "manage_accounts,collect_payments,view_user,send_money,preapprove_payments,manage_subscriptions",
      user_country = false
    )
      url = @ui_endpoint +
            '/oauth2/authorize?client_id=' + @client_id.to_s +
            '&redirect_uri=' + redirect_uri +
            '&scope=' + permissions

      url += user_name ?    '&user_name='    + CGI::escape(user_name)    : ''
      url += user_email ?   '&user_email='   + CGI::escape(user_email)   : ''
      url += user_country ? '&user_country=' + CGI::escape(user_country) : ''
    end
Returns the OAuth 2.0 URL that users should be redirected to for
 authorizing your API application. The `redirect_uri` must be a
 fully-qualified URL (e.g., `https://www.wepay.com`).