Skip to content

Commit

Permalink
Merge pull request #28 from darrick/CIVIQBO-94
Browse files Browse the repository at this point in the history
CIVIQBO-94: Add setting for Development or Production environment.
  • Loading branch information
agileware-justin authored Jul 26, 2022
2 parents 666622b + 4a6cf35 commit c693544
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CRM/Quickbooks/APIHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public static function getAccountingDataServiceObject($forRefreshToken = FALSE)
$QBCredentials = self::getQuickBooksCredentials();
$logLocation = civicrm_api3('Setting', 'getvalue', array('name' => "quickbooks_log_dir"));
$logActivated = civicrm_api3('Setting', 'getvalue', array('name' => "quickbooks_activate_qbo_logging"));
$baseUrl = civicrm_api3('Setting', 'getvalue', array('name' => "quickbooks_baseurl"));

$dataServiceParams = array(
'auth_mode' => 'oauth2',
Expand All @@ -99,7 +100,7 @@ public static function getAccountingDataServiceObject($forRefreshToken = FALSE)
'accessTokenKey' => $QBCredentials['accessToken'],
'refreshTokenKey' => $QBCredentials['refreshToken'],
'QBORealmID' => $QBCredentials['realMId'],
'baseUrl' => "Production",
'baseUrl' => $baseUrl,
);

if ($forRefreshToken) {
Expand Down
19 changes: 19 additions & 0 deletions settings/civiquickbooks.setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,25 @@
),
'quick_form_type' => 'Element',
),
'quickbooks_baseurl' => array(
'group_name' => E::ts('QuickBooks Online Settings'),
'group' => 'civiquickbooks',
'name' => 'quickbooks_baseurl',
'type' => 'String',
'add' => '4.7',
'default' => 'Production',
'title' => E::ts('Environment'),
'is_domain' => 1,
'is_contact' => 0,
'description' => E::ts('Development or Production mode.'),
'help_text' => E::ts('Use Development to test with your sandbox.'),
'html_type' => 'Select',
'html_attributes' => array(
'Production' => E::ts('Production'),
'Development' => E::ts('Development'),
),
'quick_form_type' => 'Element',
),
'quickbooks_access_token' => array(
'group_name' => E::ts('QuickBooks Online Settings'),
'group' => 'civiquickbooks',
Expand Down

0 comments on commit c693544

Please sign in to comment.