Changeset 2471
- Timestamp:
- 02/05/2016 12:04:01 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-qbo/wordcamp-qbo.php
r2470 r2471 10 10 private static $hmac_key; 11 11 12 private static $api_base_url; 12 13 private static $options; 13 14 private static $categories_map; … … 49 50 if ( empty( self::$consumer_key ) ) 50 51 return; 52 53 self::$api_base_url = sprintf( 54 'https://%squickbooks.api.intuit.com', 55 apply_filters( 'wordcamp_qbo_sandbox_mode', false ) ? 'sandbox-' : '' 56 ); 51 57 52 58 add_action( 'admin_menu', array( __CLASS__, 'admin_menu' ) ); … … 140 146 $payload['Id'] = absint( $request->get_param('id') ); 141 147 142 $request_url = esc_url_raw( sprintf( 'https://quickbooks.api.intuit.com/v3/company/%d/purchase/%d', 143 self::$options['auth']['realmId'], $payload['Id'] ) ); 148 $request_url = esc_url_raw( sprintf( '%s/v3/company/%d/purchase/%d', 149 self::$api_base_url, self::$options['auth']['realmId'], $payload['Id'] ) ); 150 144 151 $oauth_header = $oauth->get_oauth_header( 'GET', $request_url ); 145 152 $response = wp_remote_get( $request_url, array( … … 162 169 163 170 $payload = json_encode( $payload ); 164 $request_url = esc_url_raw( sprintf( ' https://quickbooks.api.intuit.com/v3/company/%d/purchase',165 self::$ options['auth']['realmId'] ) );171 $request_url = esc_url_raw( sprintf( '%s/v3/company/%d/purchase', 172 self::$api_base_url, self::$options['auth']['realmId'] ) ); 166 173 167 174 $oauth_header = $oauth->get_oauth_header( 'POST', $request_url, $payload ); … … 222 229 ); 223 230 224 $request_url = esc_url_raw( sprintf( ' https://quickbooks.api.intuit.com/v3/company/%d/query',225 self::$ options['auth']['realmId'] ) );231 $request_url = esc_url_raw( sprintf( '%s/v3/company/%d/query', 232 self::$api_base_url, self::$options['auth']['realmId'] ) ); 226 233 227 234 $oauth_header = $oauth->get_oauth_header( 'GET', $request_url, $args ); … … 342 349 343 350 $oauth->set_token( self::$options['auth']['oauth_token'], self::$options['auth']['oauth_token_secret'] ); 344 $request_url = sprintf( ' https://quickbooks.api.intuit.com/v3/company/%d/companyinfo/%d',345 self::$ options['auth']['realmId'], self::$options['auth']['realmId'] );351 $request_url = sprintf( '%s/v3/company/%d/companyinfo/%d', 352 self::$api_base_url, self::$options['auth']['realmId'], self::$options['auth']['realmId'] ); 346 353 347 354 $oauth_header = $oauth->get_oauth_header( 'GET', $request_url );
Note: See TracChangeset
for help on using the changeset viewer.