Plugin Directory

Changeset 3447104


Ignore:
Timestamp:
01/26/2026 01:10:42 PM (4 weeks ago)
Author:
digitallychee
Message:

Release 1.0.4 – fix gift credit application after successful payment

Location:
dl-gift-wallet
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • dl-gift-wallet/tags/1.0.4/changelog.txt

    r3445720 r3447104  
    11*** DL Gift Wallet ***
     2
     32026-01-26 - version 1.0.4
     4* Fix: Gift Wallet credit is now applied as soon as payment is successful, rather than waiting for the order to be manually completed.
     5* Fix: Prevented gift credit from being applied unless an order has been fully paid.
     6* Improvement: Increased reliability for mixed orders containing both Gift Wallet products and physical items.
    27
    382026-01-23 - version 1.0.3
  • dl-gift-wallet/tags/1.0.4/dl-gift-wallet.php

    r3445720 r3447104  
    33 * Plugin Name: DL Gift Wallet
    44 * Description: Allow customers to purchase gift credit that is automatically added to a recipient’s store account as balance.
    5  * Version: 1.0.3
     5 * Version: 1.0.4
    66 * Requires at least: 6.0
    77 * Requires PHP: 8.3
     
    131131    const OPTION_KEY = 'dl_gift_wallet_settings_v1';
    132132    const SETTINGS_TAB_ID = 'dl_gift_wallet';
    133     private $version = '1.0.3';
     133    private $version = '1.0.4';
    134134
    135135    public function __construct()
     
    180180        add_action('woocommerce_checkout_create_order_line_item', [$this, 'copy_meta_to_order_item'], 10, 4);
    181181
    182         // Credit recipients + send email
    183         add_action('woocommerce_order_status_completed', [$this, 'handle_order_completed'], 10);
     182        // Credit recipients + send email (safe for mixed orders).
     183        // Trigger on successful payment.
     184        add_action('woocommerce_payment_complete', [$this, 'handle_order_paid'], 10);
     185
     186        // Optional fallback: some gateways set processing without firing payment_complete reliably
     187        add_action('woocommerce_order_status_processing', [$this, 'handle_order_paid'], 10);
    184188
    185189        // Wallet use at checkout
     
    11681172     * --------------------------------------------------------------------- */
    11691173
    1170 public function handle_order_completed($order_id)
     1174public function handle_order_paid($order_id)
    11711175{
    11721176    $order = wc_get_order($order_id);
     
    11751179    }
    11761180
    1177     // Prevent double-crediting (e.g. if status changes trigger this again)
     1181    // SAFETY: don't process gifts unless the order is actually paid.
     1182    if (!$order->is_paid()) {
     1183        return;
     1184    }
     1185
     1186    // Prevent double-crediting (gateway callbacks / status changes etc)
    11781187    if ($order->get_meta('_giftwallet_credited') === 'yes') {
    11791188        return;
     
    12191228            }
    12201229
    1221             // Send standard WP account email
    12221230            wp_new_user_notification($user_id, null, 'user');
    12231231        } else {
     
    12411249    }
    12421250
    1243     // Only mark the order as credited if we actually credited something
    12441251    if ($did_credit_any) {
    12451252        $order->update_meta_data('_giftwallet_credited', 'yes');
  • dl-gift-wallet/tags/1.0.4/readme.txt

    r3445720 r3447104  
    55Tested up to: 6.9
    66Requires PHP: 8.3
    7 Stable tag: 1.0.3
     7Stable tag: 1.0.4
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    250250
    251251== Changelog ==
     252
     253= 1.0.4 =
     254* Fix: Gift Wallet credit is now applied immediately after successful payment.
     255* Fix: Prevented gift credit from being applied unless an order has been fully paid.
     256* Improvement: Increased reliability for orders containing both Gift Wallet products and physical items.
    252257
    253258= 1.0.3 =
     
    279284= Upgrade Notice =
    280285
    281 = 1.0.3 =
    282 Gift Wallet orders are now automatically completed after successful payment, ensuring store credit is applied instantly. This prevents gift credits from being delayed when orders remain in “Processing”.
     286= 1.0.4 =
     287Improves reliability of gift deliverability.
  • dl-gift-wallet/trunk/changelog.txt

    r3445720 r3447104  
    11*** DL Gift Wallet ***
     2
     32026-01-26 - version 1.0.4
     4* Fix: Gift Wallet credit is now applied as soon as payment is successful, rather than waiting for the order to be manually completed.
     5* Fix: Prevented gift credit from being applied unless an order has been fully paid.
     6* Improvement: Increased reliability for mixed orders containing both Gift Wallet products and physical items.
    27
    382026-01-23 - version 1.0.3
  • dl-gift-wallet/trunk/dl-gift-wallet.php

    r3445720 r3447104  
    33 * Plugin Name: DL Gift Wallet
    44 * Description: Allow customers to purchase gift credit that is automatically added to a recipient’s store account as balance.
    5  * Version: 1.0.3
     5 * Version: 1.0.4
    66 * Requires at least: 6.0
    77 * Requires PHP: 8.3
     
    131131    const OPTION_KEY = 'dl_gift_wallet_settings_v1';
    132132    const SETTINGS_TAB_ID = 'dl_gift_wallet';
    133     private $version = '1.0.3';
     133    private $version = '1.0.4';
    134134
    135135    public function __construct()
     
    180180        add_action('woocommerce_checkout_create_order_line_item', [$this, 'copy_meta_to_order_item'], 10, 4);
    181181
    182         // Credit recipients + send email
    183         add_action('woocommerce_order_status_completed', [$this, 'handle_order_completed'], 10);
     182        // Credit recipients + send email (safe for mixed orders).
     183        // Trigger on successful payment.
     184        add_action('woocommerce_payment_complete', [$this, 'handle_order_paid'], 10);
     185
     186        // Optional fallback: some gateways set processing without firing payment_complete reliably
     187        add_action('woocommerce_order_status_processing', [$this, 'handle_order_paid'], 10);
    184188
    185189        // Wallet use at checkout
     
    11681172     * --------------------------------------------------------------------- */
    11691173
    1170 public function handle_order_completed($order_id)
     1174public function handle_order_paid($order_id)
    11711175{
    11721176    $order = wc_get_order($order_id);
     
    11751179    }
    11761180
    1177     // Prevent double-crediting (e.g. if status changes trigger this again)
     1181    // SAFETY: don't process gifts unless the order is actually paid.
     1182    if (!$order->is_paid()) {
     1183        return;
     1184    }
     1185
     1186    // Prevent double-crediting (gateway callbacks / status changes etc)
    11781187    if ($order->get_meta('_giftwallet_credited') === 'yes') {
    11791188        return;
     
    12191228            }
    12201229
    1221             // Send standard WP account email
    12221230            wp_new_user_notification($user_id, null, 'user');
    12231231        } else {
     
    12411249    }
    12421250
    1243     // Only mark the order as credited if we actually credited something
    12441251    if ($did_credit_any) {
    12451252        $order->update_meta_data('_giftwallet_credited', 'yes');
  • dl-gift-wallet/trunk/readme.txt

    r3445720 r3447104  
    55Tested up to: 6.9
    66Requires PHP: 8.3
    7 Stable tag: 1.0.3
     7Stable tag: 1.0.4
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    250250
    251251== Changelog ==
     252
     253= 1.0.4 =
     254* Fix: Gift Wallet credit is now applied immediately after successful payment.
     255* Fix: Prevented gift credit from being applied unless an order has been fully paid.
     256* Improvement: Increased reliability for orders containing both Gift Wallet products and physical items.
    252257
    253258= 1.0.3 =
     
    279284= Upgrade Notice =
    280285
    281 = 1.0.3 =
    282 Gift Wallet orders are now automatically completed after successful payment, ensuring store credit is applied instantly. This prevents gift credits from being delayed when orders remain in “Processing”.
     286= 1.0.4 =
     287Improves reliability of gift deliverability.
Note: See TracChangeset for help on using the changeset viewer.