unit View.QBInfo;

interface

uses
  System.SysUtils, System.Classes, JS, Web, WEBLib.Graphics, WEBLib.Controls,
  WEBLib.Forms, WEBLib.Dialogs, Vcl.Controls, Vcl.StdCtrls, WEBLib.StdCtrls;

type
  TFQBInfo = class(TWebForm)
    WebLabel1: TWebLabel;
    lblCompanyName: TWebLabel;
    lblCompanyID: TWebLabel;
    WebButton1: TWebButton;
    procedure WebButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FQBInfo: TFQBInfo;

implementation

{$R *.dfm}

procedure TFQBInfo.WebButton1Click(Sender: TObject);
var
  qblink, redirectUri: string;
  qbWindow: TJSWindow;
begin
//  qblink := 'https://appcenter.intuit.com/connect/oauth2';
//  //qblink := qblink + '?client_id=ABYqlDx1EsacZYXvHIJ7RDB7zmnQdwABU3fwQLIZPmBgU0VW1P';
//  qblink := qblink + '?client_id=ABXLUuBrwvodIZMtaPcBg9acYBPafUxP80qk5aQ9HOAw1i2W3s';
//  qblink := qblink + '&response_type=code';
//  qblink := qblink + '&scope=com.intuit.quickbooks.accounting';
//  qblink := qblink + '&state=7';
//  //redirectUri := DMConnection.AuthConnection.URL + 'AuthService/QBAuthorize';
//  qblink := qblink + '&redirect_uri=' + RedirectUri;
//  console.log(redirectUri);
//  qbWindow := window.open('', '_blank');
//  if Assigned(qbWindow) then
//      qbWindow.location.href := qbLink;
end;

end.
