Plugin Directory

Changeset 2314035


Ignore:
Timestamp:
05/28/2020 09:17:40 PM (6 years ago)
Author:
pcis
Message:

Updates to the error reporting and handling

Location:
zsquared-connector-for-zoho-inventory
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • zsquared-connector-for-zoho-inventory/tags/1.0/include/ZsqConnectorOptions.php

    r2310371 r2314035  
    4545            $check = zsq_inv_sync_order($order_number, '', $this->hook_trigger);
    4646            if(false === $check) {
    47                 echo "<div class=\"notice notice-error is-dismissible\"><p>Order replay failed. Please see Slack output for details.</p></div>";
     47                echo "<div class=\"notice notice-error is-dismissible\"><p>Order replay failed. Please see Slack output or error output for details.</p></div>";
    4848            }
    4949            else if(true === $check) {
    50                 echo "<div class=\"notice notice-success is-dismissible\"><p>Order replay succeeded.</p></div>";
     50                echo "<div class=\"notice notice-success is-dismissible\"><p>Order replay accepted. ZSquared will now attempt to transfer the order into Zoho Inventory again.</p></div>";
    5151            }
    5252            else if(is_null($check)) {
     
    225225            array('sslverify' => FALSE));
    226226        if(is_a($response, WP_Error::class)) {
    227             echo "ERROR: " . $response->get_error_message();
    228             die;
     227            ZsqSlackNotifications::send('Error on taxes API call: '.$response->get_error_message());
     228            return [];
    229229        }
    230230        $output = json_decode($response['body'], true);
  • zsquared-connector-for-zoho-inventory/tags/1.0/templates/options.php

    r2305892 r2314035  
    7777            <h2>Replay order submission</h2>
    7878            <p>Sometimes an order may not make it into Zoho for a variety of reasons. When this happens, you can replay the order submission to try again.</p>
    79             <p>Enter the woocommerce sales order number to attempt to send it again to zoho inventory, regardless of status.</p>
     79            <p>Enter the Woocommerce sales order number to attempt to send it again to Zoho Inventory.</p>
    8080            <form method="post" action="options-general.php?page=zsq_inv.php&replay=1&show=replay">
    8181                <table class="form-table">
     
    102102            <h2>Tax Information Mapping</h2>
    103103            <?php if(empty($woo_taxes)) : ?>
    104                 <p>No Woocommerce taxes found; sales orders will be transferred to Zoho Inventory without any tax information applied.</p>
     104                <p>No Woocommerce or Zoho tax settings found; sales orders will be transferred to Zoho Inventory without any tax information applied.</p>
    105105            <?php elseif(!empty($woo_taxes) && empty($ex_taxes)) : ?>
    106106                <p>Woocommerce tax settings detected but no Zoho Inventory taxes detected. Please check your tax settings in Zoho Inventory, and confirm that your ZSquared API key has been added here. If you have set your taxes in Woocommerce and Zoho Inventory and you still see this message, please contact the ZSquared team.</p>
  • zsquared-connector-for-zoho-inventory/tags/1.0/templates/scripts.php

    r2305892 r2314035  
    2222                        }, 10000);
    2323                    }
     24                },
     25                error: function(error) {
     26                    $("#zsq_inv_manual_sync_message").text("ERROR: "+error);
    2427                }
    2528            });
  • zsquared-connector-for-zoho-inventory/tags/1.0/zsq-connector-inventory.php

    r2305892 r2314035  
    5656    }
    5757    $order = wc_get_order($order_id);
     58    if($order == false) {
     59        return "order $order_id not found";
     60    }
    5861    $obj = new \PCIS\ZSquared\Inventory\ZsqOrderSync($order);
    5962    if(!$obj->getState()) {
  • zsquared-connector-for-zoho-inventory/trunk/include/ZsqConnectorOptions.php

    r2310371 r2314035  
    4545            $check = zsq_inv_sync_order($order_number, '', $this->hook_trigger);
    4646            if(false === $check) {
    47                 echo "<div class=\"notice notice-error is-dismissible\"><p>Order replay failed. Please see Slack output for details.</p></div>";
     47                echo "<div class=\"notice notice-error is-dismissible\"><p>Order replay failed. Please see Slack output or error output for details.</p></div>";
    4848            }
    4949            else if(true === $check) {
    50                 echo "<div class=\"notice notice-success is-dismissible\"><p>Order replay succeeded.</p></div>";
     50                echo "<div class=\"notice notice-success is-dismissible\"><p>Order replay accepted. ZSquared will now attempt to transfer the order into Zoho Inventory again.</p></div>";
    5151            }
    5252            else if(is_null($check)) {
     
    225225            array('sslverify' => FALSE));
    226226        if(is_a($response, WP_Error::class)) {
    227             echo "ERROR: " . $response->get_error_message();
    228             die;
     227            ZsqSlackNotifications::send('Error on taxes API call: '.$response->get_error_message());
     228            return [];
    229229        }
    230230        $output = json_decode($response['body'], true);
  • zsquared-connector-for-zoho-inventory/trunk/templates/options.php

    r2305892 r2314035  
    7777            <h2>Replay order submission</h2>
    7878            <p>Sometimes an order may not make it into Zoho for a variety of reasons. When this happens, you can replay the order submission to try again.</p>
    79             <p>Enter the woocommerce sales order number to attempt to send it again to zoho inventory, regardless of status.</p>
     79            <p>Enter the Woocommerce sales order number to attempt to send it again to Zoho Inventory.</p>
    8080            <form method="post" action="options-general.php?page=zsq_inv.php&replay=1&show=replay">
    8181                <table class="form-table">
     
    102102            <h2>Tax Information Mapping</h2>
    103103            <?php if(empty($woo_taxes)) : ?>
    104                 <p>No Woocommerce taxes found; sales orders will be transferred to Zoho Inventory without any tax information applied.</p>
     104                <p>No Woocommerce or Zoho tax settings found; sales orders will be transferred to Zoho Inventory without any tax information applied.</p>
    105105            <?php elseif(!empty($woo_taxes) && empty($ex_taxes)) : ?>
    106106                <p>Woocommerce tax settings detected but no Zoho Inventory taxes detected. Please check your tax settings in Zoho Inventory, and confirm that your ZSquared API key has been added here. If you have set your taxes in Woocommerce and Zoho Inventory and you still see this message, please contact the ZSquared team.</p>
  • zsquared-connector-for-zoho-inventory/trunk/templates/scripts.php

    r2305892 r2314035  
    2222                        }, 10000);
    2323                    }
     24                },
     25                error: function(error) {
     26                    $("#zsq_inv_manual_sync_message").text("ERROR: "+error);
    2427                }
    2528            });
  • zsquared-connector-for-zoho-inventory/trunk/zsq-connector-inventory.php

    r2305892 r2314035  
    5656    }
    5757    $order = wc_get_order($order_id);
     58    if($order == false) {
     59        return "order $order_id not found";
     60    }
    5861    $obj = new \PCIS\ZSquared\Inventory\ZsqOrderSync($order);
    5962    if(!$obj->getState()) {
Note: See TracChangeset for help on using the changeset viewer.