1- /**********************************************
2- * Update of /apps-script-oauth1/.../samples/QuickBooks.gs
3- * to support OAuth2.
4- **********************************************
5-
6- /**
1+ /**
72 * Populate constants with data specific to your application,
83 * found at https://developer.intuit.com/v2/ui#/app/appdetail/XXXXXXX
94 */
@@ -29,8 +24,7 @@ function logRedirectUri() {
2924function run ( )
3025{
3126 var service = getService ( ) ;
32- if ( service . hasAccess ( ) )
33- {
27+ if ( service . hasAccess ( ) ) {
3428 // Get the Company ID to be used in the request.
3529 var companyId = PropertiesService . getUserProperties ( )
3630 . getProperty ( 'QuickBooks.companyId' ) ;
@@ -86,19 +80,16 @@ function getService() {
8680/**
8781 * Handles the OAuth callback.
8882 */
89- function authCallback ( request )
90- {
83+ function authCallback ( request ) {
9184 var service = getService ( ) ;
9285 var authorized = service . handleCallback ( request ) ;
93- if ( authorized )
94- {
86+ if ( authorized ) {
9587 PropertiesService . getUserProperties ( )
9688 . setProperty ( 'QuickBooks.companyId' , request . parameter . realmId ) ;
97- Logger . log ( " Success!" ) ;
89+ Logger . log ( ' Success!' ) ;
9890 return HtmlService . createHtmlOutput ( 'Success!' ) ;
9991 }
100- else
101- {
92+ else {
10293 return HtmlService . createHtmlOutput ( 'Denied' ) ;
10394 }
10495}
0 commit comments