Making WordPress.org

Changeset 3287


Ignore:
Timestamp:
06/01/2016 07:25:41 PM (9 years ago)
Author:
iandunn
Message:

WordCamp Budgets: Add more logging to help troubleshoot invoice bugs.

Location:
sites/trunk/wordcamp.org/public_html/wp-content/plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/includes/sponsor-invoices-dashboard.php

    r3120 r3287  
    22
    33namespace WordCamp\Budgets_Dashboard\Sponsor_Invoices;
     4use \WordCamp\Logger;
    45
    56defined( 'WPINC' ) or die();
     
    218219
    219220    $quickbooks_result = \WordCamp_QBO_Client::send_invoice_to_quickbooks( $invoice_id );
     221    Logger\log( 'send_invoice', compact( 'invoice_id', 'quickbooks_result' ) );
    220222
    221223    if ( is_int( $quickbooks_result ) ) {
     
    333335        $status_message   = "has been sent to $sponsor_name via $sponsor_email. You will receive another notification when they have paid the invoice.";
    334336        $invoice_filename = \WordCamp_QBO_Client::get_invoice_filename( $qbo_invoice_id );
     337
     338        Logger\log( 'get_invoice_filename', compact( 'qbo_invoice_id', 'invoice_filename' ) );
    335339
    336340        if ( ! is_wp_error( $invoice_filename ) ) {
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-qbo-client/wordcamp-qbo-client.php

    r3119 r3287  
    33 * Plugin Name: WordCamp.org QBO Client
    44 */
     5
     6use WordCamp\Logger;
    57
    68class WordCamp_QBO_Client {
     
    9294
    9395        $request_url = esc_url_raw( self::$api_base . '/classes/' );
    94         $response = wp_remote_get( $request_url, array(
     96        $request_args = array(
    9597            'headers' => array(
    9698                'Content-Type' => 'application/json',
    9799                'Authorization' => self::_get_auth_header( 'get', $request_url ),
    98100            ),
    99         ) );
     101        );
     102        $response = wp_remote_get( $request_url, $request_args );
     103
     104        Logger\log( 'remote_request', compact( 'request_url', 'request_args', 'response' ) );
    100105
    101106        $classes = array();
     
    236241        $body = json_encode( $body );
    237242        $request_url = esc_url_raw( self::$api_base . '/expense/' );
    238         $response = wp_remote_post( $request_url, array(
     243        $request_args = array(
    239244            'body' => $body,
    240245            'headers' => array(
     
    242247                'Authorization' => self::_get_auth_header( 'post', $request_url, $body ),
    243248            ),
    244         ) );
     249        );
     250        $response = wp_remote_post( $request_url, $request_args );
     251
     252        Logger\log( 'remote_request', compact( 'request_url', 'request_args', 'response' ) );
    245253
    246254        if ( is_wp_error( $response ) ) {
     
    280288        $response = wp_remote_post( $request['url'], $request['args'] );
    281289
     290        Logger\log( 'remote_request', compact( 'request', 'response' ) );
     291
    282292        if ( is_wp_error( $response ) ) {
    283293            $sent = $response->get_error_message();
     
    390400        $response      = wp_remote_get( $request['url'], $request['args'] );
    391401
     402        Logger\log( 'remote_request', compact( 'request', 'response' ) );
     403
    392404        if ( ! is_wp_error( $response ) ) {
    393405            $body = json_decode( wp_remote_retrieve_body( $response ) );
     
    444456        $response = wp_remote_get( $request['url'], $request['args'] );
    445457
     458        Logger\log( 'remote_request', compact( 'request', 'response' ) );
     459
    446460        if ( is_wp_error( $response ) ) {
    447461            $result = $response;
Note: See TracChangeset for help on using the changeset viewer.