Plugin Directory

Changeset 3445579


Ignore:
Timestamp:
01/23/2026 12:44:17 PM (2 months ago)
Author:
mdintegrations
Message:

Automated deployment via GitHub Actions (trunk 1.0.2)

Location:
m-d-integrations-connect/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • m-d-integrations-connect/trunk/class.mdi-partner-integration-wc-public.php

    r3279401 r3445579  
    5252        $order = wc_get_order($order_id);
    5353
     54        if (! $order) {
     55            return;
     56        }
     57
     58        // avoid sending the same order more than once (covers thankyou + payment_complete).
     59        if ($order->get_meta('_mdi_api_sent') === 'yes') {
     60            return;
     61        }
     62
    5463        $apiSettings = get_option('mdintegrations_partner_integration_wc_options');
    5564
    5665        if (!empty($apiSettings['client_id']) && !empty($apiSettings['client_secret'])) {
    5766            $content = self::$core->post_cart_info($order_id);
     67
     68            // Mark as sent only when we got a structured response back.
     69            if (is_array($content)) {
     70                $order->update_meta_data('_mdi_api_sent', 'yes');
     71                $order->save();
     72            }
     73
    5874            $vouchersData = $content['data'] ?? [];
    5975
  • m-d-integrations-connect/trunk/class.mdi-partner-integration-wc-route.php

    r3345159 r3445579  
    99            /** It will be requested by the MDI when the partner grants access to the API after installing the plugin; */
    1010            register_rest_route('mdi-partner-integration-wc/v1', '/options', array(
    11                 'methods' => 'PATCH',
     11                'methods' => WP_REST_Server::EDITABLE, // POST/PUT/PATCH
    1212                'callback' => array('MDI_Partner_Integration_WC_Route', 'patch_partner_option_auth_granted'),
    13                 'permission_callback' => '__return_true',
     13                'permission_callback' => ['MDI_Partner_Integration_WC_Route', 'validate_token'],
    1414            ));
    1515
    1616            /** It will allow to update the mdi tag from MDI side; */
    1717            register_rest_route('mdi-partner-integration-wc/v1', '/orders/(?P<id>\d+)/tags/(?P<tag>[^/]+)', array(
    18                 'methods' => 'PATCH',
     18                'methods' =>  WP_REST_Server::EDITABLE, // POST/PUT/PATCH
    1919                'callback' => array('MDI_Partner_Integration_WC_Route', 'patch_mdi_order_tag'),
    2020                'permission_callback' => ['MDI_Partner_Integration_WC_Route', 'validate_token'],
     
    2222
    2323            register_rest_route('mdi-partner-integration-wc/v1', '/orders/(?P<id>\d+)/tags', array(
    24                 'methods' => 'GET',
     24                'methods' => WP_REST_Server::READABLE, // GET
    2525                'callback' => array('MDI_Partner_Integration_WC_Route', 'get_mdi_order_tags'),
    2626                'permission_callback' => ['MDI_Partner_Integration_WC_Route', 'validate_token'],
     
    2828
    2929            register_rest_route('mdi-partner-integration-wc/v1', '/customers/(?P<id>\d+)', [
    30                 'methods'  => 'PATCH',
     30                'methods'  => WP_REST_Server::EDITABLE, // POST/PUT/PATCH
    3131                'callback' => ['MDI_Partner_Integration_WC_Route', 'patch_customer'],
    3232                'permission_callback' => ['MDI_Partner_Integration_WC_Route', 'validate_token'],
  • m-d-integrations-connect/trunk/md-integrations-connect.php

    r3345159 r3445579  
    44* Plugin URI:        https://mdintegrations.com/woocommerce-plugin
    55* Description:       Integrates M.D.Integrations with your WooCommerce store
    6 * Version:           1.0.1
     6* Version:           1.0.2
    77* Requires at least: 6.4
    88* Requires PHP:      8.2
  • m-d-integrations-connect/trunk/readme.txt

    r3345159 r3445579  
    44Tested up to: 6.7
    55Requires PHP: 8.2
    6 Stable tag: 1.0.1
     6Stable tag: 1.0.2
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2929== Changelog ==
    3030
     31= 1.0.2 =
     32Fixed: WooCommerce authorization flow in specific environments.
     33
    3134= 1.0.1 =
    3235Automatically releasing new versions to Wordpress repository.
Note: See TracChangeset for help on using the changeset viewer.