Changeset 2532 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/includes/sponsor-invoices-dashboard.php
- Timestamp:
- 02/19/2016 12:10:43 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/includes/sponsor-invoices-dashboard.php
r2528 r2532 217 217 switch_to_blog( $site_id ); 218 218 219 $quickbooks_result = send_invoice_to_quickbooks( $site_id,$invoice_id );219 $quickbooks_result = \WordCamp_QBO_Client::send_invoice_to_quickbooks( $invoice_id ); 220 220 221 221 if ( is_int( $quickbooks_result ) ) { … … 236 236 wp_send_json_error( $result ); 237 237 } 238 }239 240 /**241 * Send an invoice to the sponsor through QuickBooks Online's API242 *243 * @param int $site_id244 * @param int $invoice_id245 *246 * @return int|string247 */248 function send_invoice_to_quickbooks( $site_id, $invoice_id ) {249 switch_to_blog( $site_id );250 251 $invoice_meta = get_post_custom( $invoice_id );252 $sponsor_meta = get_post_custom( $invoice_meta['_wcbsi_sponsor_id'][0] );253 254 /* these are the values needed for the API call. they're guaranteed to exist.255 wp_send_json_error( array(256 $sponsor_meta['_wcpt_sponsor_company_name'][0],257 $sponsor_meta['_wcpt_sponsor_first_name'][0],258 $sponsor_meta['_wcpt_sponsor_last_name'][0],259 $sponsor_meta['_wcpt_sponsor_email_address'][0],260 $sponsor_meta['_wcpt_sponsor_phone_number'][0],261 262 $sponsor_meta['_wcpt_sponsor_street_address1'][0],263 $sponsor_meta['_wcpt_sponsor_street_address2'][0],264 $sponsor_meta['_wcpt_sponsor_city'][0],265 $sponsor_meta['_wcpt_sponsor_state'][0],266 $sponsor_meta['_wcpt_sponsor_zip_code'][0],267 $sponsor_meta['_wcpt_sponsor_country'][0],268 269 $invoice_meta['_wcbsi_due_date'][0],270 $invoice_meta['_wcbsi_description'][0],271 $invoice_meta['_wcbsi_currency'][0],272 $invoice_meta['_wcbsi_amount'][0],273 ) );274 */275 276 $sent = 'QuickBooks integration is not complete yet.';277 // todo return QBO invoice ID on success, or an error message string on failure278 279 restore_current_blog();280 281 return $sent;282 238 } 283 239
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)